From a79c724110af48ae43ca079101629c7785adb0c0 Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 23 Oct 2026 00:15:46 +0200 Subject: [PATCH] Grow BBR probe inflight bounds in MSS-sized byte increments --- src/transport_layer/etcp_bbr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/transport_layer/etcp_bbr.c b/src/transport_layer/etcp_bbr.c index f6908d82..5b486b4f 100644 --- a/src/transport_layer/etcp_bbr.c +++ b/src/transport_layer/etcp_bbr.c @@ -280,13 +280,13 @@ static void bbr_check_full_bw_reached(struct bbr* bbr, const struct bbr_rate_sam bbr->full_bw_reached |= bbr->full_bw_now; } -static void bbr_raise_inflight_hi_slope(struct bbr* bbr, uint32_t cwnd) +static void bbr_raise_inflight_hi_slope(struct bbr* bbr, uint32_t cwnd, uint32_t mss) { uint32_t growth_this_round = 1U << bbr->bw_probe_up_rounds; uint32_t cnt; bbr->bw_probe_up_rounds = (uint8_t)(bbr->bw_probe_up_rounds + 1 < 30 ? bbr->bw_probe_up_rounds + 1 : 30); - cnt = cwnd / growth_this_round; + cnt = (uint32_t)((uint64_t)cwnd / ((uint64_t)growth_this_round * mss)); cnt = (uint32_t)(cnt > 1U ? cnt : 1U); bbr->bw_probe_up_cnt = cnt; } @@ -308,7 +308,7 @@ static void bbr_start_bw_probe_refill(struct bbr* bbr, uint32_t bw_probe_up_roun bbr_set_cycle_idx(bbr, BBR_BW_PROBE_REFILL); } -static void bbr_start_bw_probe_up(struct bbr* bbr, uint32_t sample_bw, uint32_t cwnd) +static void bbr_start_bw_probe_up(struct bbr* bbr, uint32_t sample_bw, uint32_t cwnd, uint32_t mss) { bbr->ack_phase = BBR_ACKS_PROBE_STARTING; bbr->next_rtt_delivered = bbr->delivered; @@ -316,7 +316,7 @@ static void bbr_start_bw_probe_up(struct bbr* bbr, uint32_t sample_bw, uint32_t bbr_reset_full_bw(bbr); bbr->full_bw = sample_bw; bbr_set_cycle_idx(bbr, BBR_BW_PROBE_UP); - bbr_raise_inflight_hi_slope(bbr, cwnd); + bbr_raise_inflight_hi_slope(bbr, cwnd, mss); } static void bbr_save_cwnd(struct bbr* bbr, uint32_t cwnd) @@ -402,7 +402,7 @@ static void bbr_handle_inflight_too_high(struct bbr* bbr, const struct bbr_rate_ } static void bbr_probe_inflight_hi_upward(struct bbr* bbr, const struct bbr_rate_sample* rs, - int is_cwnd_limited, uint32_t cwnd) + int is_cwnd_limited, uint32_t cwnd, uint32_t mss) { uint32_t delta; if (!is_cwnd_limited || cwnd < bbr->inflight_hi) @@ -416,7 +416,7 @@ static void bbr_probe_inflight_hi_upward(struct bbr* bbr, const struct bbr_rate_ bbr->try_fast_path = 0; } if (bbr->round_start) - bbr_raise_inflight_hi_slope(bbr, cwnd); + bbr_raise_inflight_hi_slope(bbr, cwnd, mss); } static void bbr_adapt_upper_bounds(struct bbr* bbr, const struct bbr_rate_sample* rs, @@ -447,7 +447,7 @@ static void bbr_adapt_upper_bounds(struct bbr* bbr, const struct bbr_rate_sample if (rs->tx_in_flight > bbr->inflight_hi) bbr->inflight_hi = rs->tx_in_flight; if (bbr->mode == BBR_PROBE_BW && bbr->cycle_idx == BBR_BW_PROBE_UP) - bbr_probe_inflight_hi_upward(bbr, rs, is_cwnd_limited, cwnd); + bbr_probe_inflight_hi_upward(bbr, rs, is_cwnd_limited, cwnd, mss); } } @@ -507,7 +507,7 @@ static void bbr_update_cycle_phase(struct bbr* bbr, const struct bbr_rate_sample case BBR_BW_PROBE_REFILL: if (bbr->round_start) { bbr->bw_probe_samples = 1; - bbr_start_bw_probe_up(bbr, sample_bw, cwnd); + bbr_start_bw_probe_up(bbr, sample_bw, cwnd, mss); } break; case BBR_BW_PROBE_UP: