|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
#include "etcp_bbr.h" |
|
|
|
|
#include "../lib/u_async.h" |
|
|
|
|
#include "../lib/debug_config.h" |
|
|
|
|
#include <stdlib.h> |
|
|
|
|
|
|
|
|
|
static uint64_t bbr_now(const struct bbr* bbr) { return bbr->now_tb ? bbr->now_tb : get_time_tb(); } |
|
|
|
|
@ -327,10 +328,14 @@ static void bbr_exit_probe_rtt(struct bbr* bbr)
|
|
|
|
|
{ |
|
|
|
|
bbr_reset_lower_bounds(bbr); |
|
|
|
|
if (bbr->full_bw_reached) { |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_BBR, "[L%u] mode %d→%d exit probe_rtt → PROBE_BW", |
|
|
|
|
bbr->link_id, bbr->mode, BBR_PROBE_BW); |
|
|
|
|
bbr->mode = BBR_PROBE_BW; |
|
|
|
|
bbr_start_bw_probe_down(bbr); |
|
|
|
|
bbr_start_bw_probe_cruise(bbr); |
|
|
|
|
} else { |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_BBR, "[L%u] mode %d→%d exit probe_rtt → STARTUP", |
|
|
|
|
bbr->link_id, bbr->mode, BBR_STARTUP); |
|
|
|
|
bbr->mode = BBR_STARTUP; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -536,11 +541,13 @@ static void bbr_check_drain(struct bbr* bbr, const struct bbr_rate_sample* rs,
|
|
|
|
|
{ |
|
|
|
|
(void)rs; (void)sample_bw; |
|
|
|
|
if (bbr->mode == BBR_STARTUP && bbr->full_bw_reached) { |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_BBR, "[L%u] mode %d→%d STARTUP→DRAIN", bbr->link_id, bbr->mode, BBR_DRAIN); |
|
|
|
|
bbr->mode = BBR_DRAIN; |
|
|
|
|
bbr_reset_congestion_signals(bbr); |
|
|
|
|
} |
|
|
|
|
if (bbr->mode == BBR_DRAIN && |
|
|
|
|
inflight_packets <= bbr_inflight(bbr, bbr_max_bw(bbr), BBR_UNIT, mss)) { |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_BBR, "[L%u] mode %d→%d DRAIN→PROBE_BW infl_pkt=%u", bbr->link_id, bbr->mode, BBR_PROBE_BW, inflight_packets); |
|
|
|
|
bbr->mode = BBR_PROBE_BW; |
|
|
|
|
bbr_start_bw_probe_down(bbr); |
|
|
|
|
} |
|
|
|
|
@ -584,6 +591,8 @@ static void bbr_update_min_rtt(struct bbr* bbr, const struct bbr_rate_sample* rs
|
|
|
|
|
|
|
|
|
|
if (BBR_PROBE_RTT_MS > 0 && probe_rtt_expired && |
|
|
|
|
!bbr->idle_restart && bbr->mode != BBR_PROBE_RTT) { |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_BBR, "[L%u] mode %d→%d →PROBE_RTT cwnd=%u infl_pkt=%u", |
|
|
|
|
bbr->link_id, bbr->mode, BBR_PROBE_RTT, *cwnd, inflight_packets); |
|
|
|
|
bbr->mode = BBR_PROBE_RTT; |
|
|
|
|
bbr_save_cwnd(bbr, *cwnd); |
|
|
|
|
bbr->probe_rtt_done_stamp_tb = 0; |
|
|
|
|
@ -610,6 +619,7 @@ static void bbr_update_min_rtt(struct bbr* bbr, const struct bbr_rate_sample* rs
|
|
|
|
|
|
|
|
|
|
static void bbr_reset_startup_mode(struct bbr* bbr) |
|
|
|
|
{ |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_BBR, "[L%u] mode %d→%d →STARTUP (reset)", bbr->link_id, bbr->mode, BBR_STARTUP); |
|
|
|
|
bbr->mode = BBR_STARTUP; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|