git: 47ef696a7696 - main - tcp bbr: improve retransmit timout calculation
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 15 Nov 2026 18:55:10 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=47ef696a769644e7ca1f2a3129818f39640b30a9
commit 47ef696a769644e7ca1f2a3129818f39640b30a9
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-11-15 08:38:45 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-11-15 18:53:59 +0000
tcp bbr: improve retransmit timout calculation
The retransmission timeout should the srtt + 4 * rttvar.
The srtt is using 5 bits of fractions and rttvar is using 4 bits of
fractions, some specific shifting is required.
Reviewed by: Peter Lei
MFC after: 3 days
MFC to: stable/15
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D61586
---
sys/netinet/tcp_stacks/bbr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c
index 38b2d1665d4e..8b293208c282 100644
--- a/sys/netinet/tcp_stacks/bbr.c
+++ b/sys/netinet/tcp_stacks/bbr.c
@@ -594,8 +594,7 @@ activate_rxt:
if (tp->t_srtt == 0)
tov = BBR_INITIAL_RTO;
else
- tov = ((uint64_t)(TICKS_2_USEC(tp->t_srtt) +
- ((uint64_t)TICKS_2_USEC(tp->t_rttvar) * (uint64_t)4)) >> TCP_RTT_SHIFT);
+ tov = TICKS_2_USEC(tp->t_srtt + (tp->t_rttvar << (TCP_RTT_SHIFT - TCP_DELTA_SHIFT))) >> TCP_RTT_SHIFT;
if (tp->t_rxtshift)
tov *= tcp_backoff[tp->t_rxtshift];
if (tov > time_since_sent)