Skip to contentSkip to conversation

tcp: Do not underestimate rwnd_limited

PATCH In review Eric Dumazet 4 participants 4 messages Dec 5, 2018 – Dec 6, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: Do not underestimate rwnd_limited

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")
---
 net/ipv4/tcp_output.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/ipv4/tcp_output.c +4 -1
index 68b5326f73212ffe7111dd0f91e0a1246fb0ae25..3186902347584090256467d8679320666aa0257e 100644
@@ -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;
Signature · 1 line
2.20.0.rc2.403.gdbc3b29805-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Eric Dumazet

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")

Excellent catch! Thank you for the fix, Eric!

Quoted 24 lines
---
 net/ipv4/tcp_output.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/ipv4/tcp_output.c +4 -2
index 68b5326f73212ffe7111dd0f91e0a1246fb0ae25..3186902347584090256467d8679320666aa0257e 100644
@@ -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;
--

2.20.0.rc2.403.gdbc3b29805-goog

Reviewed-by
#2 lore raw
Quoted 6 lines · Soheil Hassas Yeganeh
Quoted 4 lines · Eric Dumazet

If available rwnd is too small, tcp_tso_should_defer() can decide it is worth waiting before splitting a TSO packet.

Quoted 6 lines
Quoted 4 lines

This really means we are rwnd limited.

Fixes 5615f88614a4 ("tcp: instrument how long TCP is limited by receive window")
Quoted 27 lines

Excellent catch! Thank you for the fix, Eric!

Quoted 24 lines
---
 net/ipv4/tcp_output.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/ipv4/tcp_output.c +4 -2
index 68b5326f73212ffe7111dd0f91e0a1246fb0ae25..3186902347584090256467d8679320666aa0257e 100644
@@ -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;
--

2.20.0.rc2.403.gdbc3b29805-goog

maintainer
#3 lore raw
In reply to Eric Dumazet

From: Eric Dumazet <[email protected]>
Date: Wed, 5 Dec 2018 14:24:31 -0800

Quoted 7 lines

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")

Applied and queued up for -stable, thanks Eric.