[TCP]: Fix quick-ack decrementing with TSO.

On each packet output, we call tcp_dec_quickack_mode()
if the ACK flag is set.  It drops tp->ack.quick until
it hits zero, at which time we deflate the ATO value.

When doing TSO, we are emitting multiple packets with
ACK set, so we should decrement tp->ack.quick that many
segments.

Note that, unlike this case, tcp_enter_cwr() should not
take the tcp_skb_pcount(skb) into consideration.  That
function, one time, readjusts tp->snd_cwnd and moves
into TCP_CA_CWR state.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2005-07-05 15:17:45 -07:00
parent c65f7f00c5
commit fc6415bcb0
2 changed files with 12 additions and 7 deletions
+9 -4
View File
@@ -721,11 +721,16 @@ static inline int tcp_ack_scheduled(struct tcp_sock *tp)
return tp->ack.pending&TCP_ACK_SCHED;
}
static __inline__ void tcp_dec_quickack_mode(struct tcp_sock *tp)
static __inline__ void tcp_dec_quickack_mode(struct tcp_sock *tp, unsigned int pkts)
{
if (tp->ack.quick && --tp->ack.quick == 0) {
/* Leaving quickack mode we deflate ATO. */
tp->ack.ato = TCP_ATO_MIN;
if (tp->ack.quick) {
if (pkts >= tp->ack.quick) {
tp->ack.quick = 0;
/* Leaving quickack mode we deflate ATO. */
tp->ack.ato = TCP_ATO_MIN;
} else
tp->ack.quick -= pkts;
}
}