Patchwork tcp: tcp_process_frto() should not set snd_cwnd to 0

login
register
mail settings
Submitter Eric Dumazet
Date Feb. 2, 2013, 3:14 p.m.
Message ID <1359818075.30177.78.camel@edumazet-glaptop>
Download mbox | patch
Permalink /patch/217674/
State Superseded
Delegated to: David Miller
Headers show

Comments

Eric Dumazet - Feb. 2, 2013, 3:14 p.m.
From: Eric Dumazet <edumazet@google.com>

snd_cwnd minimal value is 1, not 0, or tcp_slow_start()
is broken : infinite loop since commit 9dc274151a548
(tcp: fix ABC in tcp_slow_start())

A separate patch will make tcp_slow_start() more robust.

Reported-by: Pasi Kärkkäinen <pasik@iki.fi>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
---
 net/ipv4/tcp_input.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 8aca4ee..37760df 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3506,7 +3506,7 @@  static bool tcp_process_frto(struct sock *sk, int flag)
 		if (!(flag & FLAG_DATA_ACKED) && (tp->frto_counter == 1)) {
 			/* Prevent sending of new data. */
 			tp->snd_cwnd = min(tp->snd_cwnd,
-					   tcp_packets_in_flight(tp));
+					   max(tcp_packets_in_flight(tp), 1U));
 			return true;
 		}