tcp: frto should not set snd_cwnd to 0
authorEric Dumazet <edumazet@google.com>
Sun, 3 Feb 2013 09:13:05 +0000 (09:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Feb 2013 21:00:25 +0000 (16:00 -0500)
Commit 9dc274151a548 (tcp: fix ABC in tcp_slow_start())
uncovered a bug in FRTO code :
tcp_process_frto() is setting snd_cwnd to 0 if the number
of in flight packets is 0.

As Neal pointed out, if no packet is in flight we lost our
chance to disambiguate whether a loss timeout was spurious.

We should assume it was a proper loss.

Reported-by: Pasi Kärkkäinen <pasik@iki.fi>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c

index 8aca4ee..680c422 100644 (file)
@@ -3484,7 +3484,8 @@ static bool tcp_process_frto(struct sock *sk, int flag)
            ((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED)))
                tp->undo_marker = 0;
 
-       if (!before(tp->snd_una, tp->frto_highmark)) {
+       if (!before(tp->snd_una, tp->frto_highmark) ||
+           !tcp_packets_in_flight(tp)) {
                tcp_enter_frto_loss(sk, (tp->frto_counter == 1 ? 2 : 3), flag);
                return true;
        }