tcp: Do not underestimate rwnd_limited
authorEric Dumazet <edumazet@google.com>
Wed, 5 Dec 2018 22:24:31 +0000 (14:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Dec 2018 00:31:59 +0000 (16:31 -0800)
If available rwnd is too small, tcp_tso_should_defer()
can decide it is worth waiting before splitting a TSO packet.

This really means we are rwnd limited.

Fixes: 5615f88614a4 ("tcp: instrument how long TCP is limited by receive window")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Reviewed-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c

index 68b5326f73212ffe7111dd0f91e0a1246fb0ae25..3186902347584090256467d8679320666aa0257e 100644 (file)
@@ -2356,8 +2356,11 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
                } else {
                        if (!push_one &&
                            tcp_tso_should_defer(sk, skb, &is_cwnd_limited,
-                                                max_segs))
+                                                max_segs)) {
+                               if (!is_cwnd_limited)
+                                       is_rwnd_limited = true;
                                break;
+                       }
                }
 
                limit = mss_now;