This flag acts differently from ACKNOW that no pure ACK will be sent.
It is currently used by the (extended) limited transmit and the SACK
based fast recovery.
This flag is intended to fix the following bug in the SACK based fast
recovery:
The NextSeg() requires that if the unACKed segments could not pass
IsLost(), previously unsent segment should be selected. In the
application limited period, the size of the previously unsent segment
could be less than the MSS, thus it could not be sent immediately
according to the Nagle algorithm. In our SACK based fast recovery
implementation, if the tcp_output() sends no segments, the current
recovery transmit process will stop immediately. This could stop ACK
clock and cause timeout retransmit, which could be avoided, if the
Nagle algorithm is bypassed temporarily for the small unsent segment
selected by NextSeg().
When this flag is used with (extended) limited transmit, certain amount
of spurious early retranmits could be avoided.
old_snd_max = tp->snd_max;
if (nextrexmt == tp->snd_una)
tcp_callout_stop(tp, tp->tt_rexmt);
+ tp->t_flags |= TF_XMITNOW;
error = tcp_output(tp);
if (error != 0) {
tp->rexmt_high = old_rexmt_high;
tp->snd_cwnd = tp->snd_nxt - tp->snd_una +
rounddown(cwnd_left, tp->t_maxseg);
+ tp->t_flags |= TF_XMITNOW;
tcp_output(tp);
sent = tp->snd_nxt - next;
tp->snd_nxt = tp->snd_max;
tp->snd_cwnd = ownd +
(tp->t_dupacks - tp->snd_limited) * tp->t_maxseg;
+ tp->t_flags |= TF_XMITNOW;
tcp_output(tp);
if (SEQ_LT(oldsndnxt, oldsndmax)) {
flags &= ~TH_SYN;
off--, len++;
if (len > 0 && tp->t_state == TCPS_SYN_SENT) {
- tp->t_flags &= ~TF_ACKNOW;
+ tp->t_flags &= ~(TF_ACKNOW | TF_XMITNOW);
return 0;
}
}
goto send;
if (SEQ_LT(tp->snd_nxt, tp->snd_max)) /* retransmit case */
goto send;
+ if (tp->t_flags & TF_XMITNOW)
+ goto send;
}
/*
/*
* No reason to send a segment, just return.
*/
+ tp->t_flags &= ~TF_XMITNOW;
return (0);
send:
KASSERT(error != 0, ("no error, but th not set"));
}
if (error) {
- tp->t_flags &= ~TF_ACKNOW;
+ tp->t_flags &= ~(TF_ACKNOW | TF_XMITNOW);
/*
* We know that the packet was lost, so back out the
tp->t_flags &= ~TF_RXRESIZED;
}
tp->last_ack_sent = tp->rcv_nxt;
- tp->t_flags &= ~TF_ACKNOW;
+ tp->t_flags &= ~(TF_ACKNOW | TF_XMITNOW);
if (tcp_delack_enabled)
tcp_callout_stop(tp, tp->tt_delack);
if (sendalot)
#define TF_RXWIN0SENT 0x00080000 /* sent a receiver win 0 in response */
#define TF_FASTRECOVERY 0x00100000 /* in Fast Recovery */
#define TF_QUEDFIN 0x00200000 /* FIN has been received */
-#define TF_UNUSED007 0x00400000
+#define TF_XMITNOW 0x00400000 /* Temporarily override Nagle */
#define TF_UNUSED008 0x00800000
#define TF_UNUSED009 0x01000000
#define TF_FORCE 0x02000000 /* Set if forcing out a byte */