From 0adff0253d00d37b52ca034784a8033150e7760c Mon Sep 17 00:00:00 2001 From: Evgeny Date: Mon, 1 Jun 2026 18:13:07 +0300 Subject: [PATCH] =?UTF-8?q?bbr:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=8B=D1=80=D1=8B=D1=85=20BW-?= =?UTF-8?q?=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D0=B9=20(bw=5Flatest?= =?UTF-8?q?/bw=5Flo/bw=5Fhi)=20=D1=81=20/125=20=D0=BD=D0=B0=20/2097?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BW_RAW_TO_KBPS = bw_raw * 8000 / BW_UNIT = bw_raw / 2097.152 pacing_rate / 125 остаётся без изменений (уже в bytes/sec после bbr_rate_bytes_per_sec) --- tests/bbr_integration/test_bbr_integration.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/bbr_integration/test_bbr_integration.c b/tests/bbr_integration/test_bbr_integration.c index 36327fd7..f9cc5ebb 100644 --- a/tests/bbr_integration/test_bbr_integration.c +++ b/tests/bbr_integration/test_bbr_integration.c @@ -52,6 +52,9 @@ #define EMU_LOSS_PERM 50 /* 5% */ #define EMU_QUEUE_PKTS 65 /* ~100KB at MTU 1400-1600 */ +/* Convert raw BBR bandwidth (BW_UNIT * bytes / usec) to kbps */ +#define BW_RAW_TO_KBPS(bw) ((double)(bw) / 2097.152) + /* ===== BBR name helpers ===== */ static const char* bbr_mode_name(uint8_t m) { switch (m) { @@ -237,8 +240,8 @@ static void print_metrics(struct test_ctx* ctx) { inlo_kb = (double)b->inflight_lo / 1024.0; pace_kbps = (double)l->bbr_pacing_rate / 125.0; rtt_ms = (double)b->min_rtt_us / 1000.0; - bw_latest_k = (double)b->bw_latest / 125.0; - bw_lo_k = (double)b->bw_lo / 125.0; + bw_latest_k = BW_RAW_TO_KBPS(b->bw_latest); + bw_lo_k = BW_RAW_TO_KBPS(b->bw_lo); round_start = b->round_start; deliv_k = (double)b->delivered / 1024.0; full_bw = b->full_bw_reached; @@ -455,7 +458,7 @@ int main(void) { " minrtt=%.1fms bw_hi=%.0fK bw_lo=%.0fK pace=%.0fK infl_hi=%.1fK infl_lo=%.1fK\n", l->bbr->mode, l->bbr->cycle_idx, l->bbr->full_bw_reached, l->bbr->loss_in_round, (double)l->bbr->min_rtt_us / 1000.0, - (double)l->bbr->bw_hi[0] / 125.0, (double)l->bbr->bw_lo / 125.0, + (double)l->bbr->bw_hi[0] / 2097.152, (double)l->bbr->bw_lo / 2097.152, (double)l->bbr_pacing_rate / 125.0, (double)l->bbr->inflight_hi / 1024.0, (double)l->bbr->inflight_lo / 1024.0); l = l->next;