From 6404b7a18a518e04bf934c1635e8a0b34628149a Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Wed, 4 Dec 2024 18:47:15 +0100 Subject: [PATCH] BUG/MINOR: quic: fix bbr_inflight() calls with wrong gain value This patch fixes two wrong calls to bbr_inflight(). bbr_target_inflight() aim is to compute the number of bytes BBR has to put on the network as bytes in flight (sent but not acked bytes). It must call bbr_inflight() with the current window gain value (in place of a wrong fixed 100 gain value here, in percents). bbr_is_time_to_cruise() also called bbr_inflight() with a wrong gain value as parameter due to a confusion between the value mentioned by the RFC (1 meaning 100% of the current window) and our implementation which needs value in percents (so 100 in place of 1 here). Note that bbr_is_time_to_cruise() aim is to make BBR the decision to leave the probing_bw down state. The bug had as side effect to make BBR stay in this state during too long periods of time during which the bottleneck bandwidth is decreasing, leading to big oscillations between the mininum and maximum bottleneck bandwidth estimations. This patch must be backported to 3.1 where BBR was first implemented. --- src/quic_cc_bbr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quic_cc_bbr.c b/src/quic_cc_bbr.c index 8f6e039e29..39fd673df4 100644 --- a/src/quic_cc_bbr.c +++ b/src/quic_cc_bbr.c @@ -850,7 +850,7 @@ static void bbr_advance_max_bw_filter(struct bbr *bbr) static uint64_t bbr_target_inflight(struct bbr *bbr, struct quic_cc_path *p) { - uint64_t bdp = bbr_inflight(bbr, p, bbr->bw, 100); + uint64_t bdp = bbr_inflight(bbr, p, bbr->bw, bbr->cwnd_gain); return MIN(bdp, p->cwnd); } @@ -982,7 +982,7 @@ static int bbr_is_time_to_cruise(struct bbr *bbr, struct quic_cc_path *p) if (p->in_flight > bbr_inflight_with_headroom(bbr, p)) return 0; /* not enough headroom */ - if (p->in_flight <= bbr_inflight(bbr, p, bbr->max_bw, 1)) + if (p->in_flight <= bbr_inflight(bbr, p, bbr->max_bw, 100)) return 1; /* inflight <= estimated BDP */ return 0; -- 2.39.5