git: 2f98793a13fe - main - tcp bbr: improve retransmit timout calculation
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 15 Nov 2026 19:08:56 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=2f98793a13fe3e69cf6b698fa469550b4ba0fea1
commit 2f98793a13fe3e69cf6b698fa469550b4ba0fea1
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-11-15 19:04:33 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-11-15 19:04:33 +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/D61581
---
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 7e3023c02179..49b5902f5ee4 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)