Skip to contentSkip to conversation

tcp_bbr: fix to zero idle_restart only upon S/ACKed data

PATCH In review Neal Cardwell 2 participants 2 messages May 2, 2018

Subsystems (3)
lore
Share & tools
lore

Neal Cardwell

author maintainer
#0 lore raw

PATCH 1/1 tcp_bbr: fix to zero idle_restart only upon S/ACKed data

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")
---
 net/ipv4/tcp_bbr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv4/tcp_bbr.c +3 -1
index 158d105e76da1..58e2f479ffb4d 100644
@@ -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)
Signature · 1 line
2.17.0.441.gb46fe60e1d-goog
maintainer
#1 lore raw

From: Neal Cardwell <[email protected]>
Date: Tue, 1 May 2018 21:45:41 -0400

Quoted 12 lines

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

Quoted 8 lines

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

Fixes 0f8782ea1497 ("tcp_bbr: add BBR congestion control")

Applied and queued up for -stable.