All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] tcp_bbr: fix to zero idle_restart only upon S/ACKed data
@ 2018-05-02  1:45 Neal Cardwell
  2018-05-02 15:13 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Neal Cardwell @ 2018-05-02  1:45 UTC (permalink / raw)
  To: davem, netdev, ncardwell, ycheng, soheil, priyarjha, ysseung
  Cc: netdev, Neal Cardwell, Yuchung Cheng, Soheil Hassas Yeganeh,
	Priyaranjan Jha, Yousuk Seung

Previously the bbr->idle_restart tracking was zeroing out the
bbr->idle_restart bit upon ACKs that did not SACK or ACK anything,
e.g. receiving incoming data or receiver window updates. In such
situations BBR would forget that this was a restart-from-idle
situation, and if the min_rtt had expired it would unnecessarily enter
PROBE_RTT (even though we were actually restarting from idle but had
merely forgotten that fact).

The fix is simple: we need to remember we are restarting from idle
until we receive a S/ACK for some data (a S/ACK for the first flight
of data we send as we are restarting).

This commit is a stable candidate for kernels back as far as 4.9.

Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Priyaranjan Jha <priyarjha@google.com>
Signed-off-by: Yousuk Seung <ysseung@google.com>
---
 net/ipv4/tcp_bbr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c
index 158d105e76da1..58e2f479ffb4d 100644
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -806,7 +806,9 @@ static void bbr_update_min_rtt(struct sock *sk, const struct rate_sample *rs)
 			}
 		}
 	}
-	bbr->idle_restart = 0;
+	/* Restart after idle ends only once we process a new S/ACK for data */
+	if (rs->delivered > 0)
+		bbr->idle_restart = 0;
 }
 
 static void bbr_update_model(struct sock *sk, const struct rate_sample *rs)
-- 
2.17.0.441.gb46fe60e1d-goog

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] tcp_bbr: fix to zero idle_restart only upon S/ACKed data
  2018-05-02  1:45 [PATCH net] tcp_bbr: fix to zero idle_restart only upon S/ACKed data Neal Cardwell
@ 2018-05-02 15:13 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-05-02 15:13 UTC (permalink / raw)
  To: ncardwell; +Cc: netdev, ycheng, soheil, priyarjha, ysseung

From: Neal Cardwell <ncardwell@google.com>
Date: Tue,  1 May 2018 21:45:41 -0400

> Previously the bbr->idle_restart tracking was zeroing out the
> bbr->idle_restart bit upon ACKs that did not SACK or ACK anything,
> e.g. receiving incoming data or receiver window updates. In such
> situations BBR would forget that this was a restart-from-idle
> situation, and if the min_rtt had expired it would unnecessarily enter
> PROBE_RTT (even though we were actually restarting from idle but had
> merely forgotten that fact).
> 
> The fix is simple: we need to remember we are restarting from idle
> until we receive a S/ACK for some data (a S/ACK for the first flight
> of data we send as we are restarting).
> 
> This commit is a stable candidate for kernels back as far as 4.9.
> 
> Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
> Signed-off-by: Priyaranjan Jha <priyarjha@google.com>
> Signed-off-by: Yousuk Seung <ysseung@google.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-02 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02  1:45 [PATCH net] tcp_bbr: fix to zero idle_restart only upon S/ACKed data Neal Cardwell
2018-05-02 15:13 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.