Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tcp: add one more quick ack after after ECN events

Larry Brakmo proposal ( https://patchwork.ozlabs.org/patch/935233/
tcp: force cwnd at least 2 in tcp_cwnd_reduction) made us rethink
about our recent patch removing ~16 quick acks after ECN events.

tcp_enter_quickack_mode(sk, 1) makes sure one immediate ack is sent,
but in the case the sender cwnd was lowered to 1, we do not want
to have a delayed ack for the next packet we will receive.

Fixes: 522040ea5fdd ("tcp: do not aggressively quick ack after ECN events")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Neal Cardwell <ncardwell@google.com>
Cc: Lawrence Brakmo <brakmo@fb.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
15ecbe94 8e75887d

+2 -2
+2 -2
net/ipv4/tcp_input.c
··· 265 265 * it is probably a retransmit. 266 266 */ 267 267 if (tp->ecn_flags & TCP_ECN_SEEN) 268 - tcp_enter_quickack_mode(sk, 1); 268 + tcp_enter_quickack_mode(sk, 2); 269 269 break; 270 270 case INET_ECN_CE: 271 271 if (tcp_ca_needs_ecn(sk)) ··· 273 273 274 274 if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) { 275 275 /* Better not delay acks, sender can have a very low cwnd */ 276 - tcp_enter_quickack_mode(sk, 1); 276 + tcp_enter_quickack_mode(sk, 2); 277 277 tp->ecn_flags |= TCP_ECN_DEMAND_CWR; 278 278 } 279 279 tp->ecn_flags |= TCP_ECN_SEEN;