From 67535428b467ee67beb1626d6b467a9144bcd31a Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Tue, 22 May 2018 12:25:45 +0200 Subject: [PATCH] Ensures that BBR always reports updated state. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The BBR controller did not properly report updates to congestion windows. This was due to a check to avoid the overhead of callbacks. In the current design without callbacks in the controller, the check can be removed. If helpful for performance, it should live outside of the controller. Bug: webrtc:8415 Change-Id: Idf6d6e76fe6d0450841e706019110307e559c11d Reviewed-on: https://webrtc-review.googlesource.com/78181 Commit-Queue: Sebastian Jansson Reviewed-by: Björn Terelius Cr-Commit-Position: refs/heads/master@{#23363} --- .../bbr/bbr_network_controller.cc | 25 ------------------- .../bbr/bbr_network_controller.h | 14 ----------- 2 files changed, 39 deletions(-) diff --git a/modules/congestion_controller/bbr/bbr_network_controller.cc b/modules/congestion_controller/bbr/bbr_network_controller.cc index 33ba015584..bfb35cfbf4 100644 --- a/modules/congestion_controller/bbr/bbr_network_controller.cc +++ b/modules/congestion_controller/bbr/bbr_network_controller.cc @@ -84,11 +84,6 @@ constexpr int64_t kDefaultMaxCongestionWindowBytes = (kMaxRttMs * kMaxBandwidthKbps) / 8; } // namespace -BbrNetworkController::UpdateState::UpdateState() = default; -BbrNetworkController::UpdateState::UpdateState( - const BbrNetworkController::UpdateState&) = default; -BbrNetworkController::UpdateState::~UpdateState() = default; - BbrNetworkController::BbrControllerConfig BbrNetworkController::BbrControllerConfig::DefaultConfig() { BbrControllerConfig config; @@ -196,12 +191,6 @@ void BbrNetworkController::Reset() { round_trip_count_ = 0; rounds_without_bandwidth_gain_ = 0; is_at_full_bandwidth_ = false; - last_update_state_.mode = Mode::STARTUP; - last_update_state_.bandwidth.reset(); - last_update_state_.rtt.reset(); - last_update_state_.pacing_rate.reset(); - last_update_state_.target_rate.reset(); - last_update_state_.probing_for_bandwidth = false; EnterStartupMode(); } @@ -224,20 +213,6 @@ NetworkControlUpdate BbrNetworkController::CreateRateUpdate(Timestamp at_time) { if (constraints_->min_data_rate) target_rate = std::max(target_rate, *constraints_->min_data_rate); } - bool probing_for_bandwidth = IsProbingForMoreBandwidth(); - if (last_update_state_.mode == mode_ && - last_update_state_.bandwidth == bandwidth && - last_update_state_.rtt == rtt && - last_update_state_.pacing_rate == pacing_rate && - last_update_state_.target_rate == target_rate && - last_update_state_.probing_for_bandwidth == probing_for_bandwidth) - return NetworkControlUpdate(); - last_update_state_.mode = mode_; - last_update_state_.bandwidth = bandwidth; - last_update_state_.rtt = rtt; - last_update_state_.pacing_rate = pacing_rate; - last_update_state_.target_rate = target_rate; - last_update_state_.probing_for_bandwidth = probing_for_bandwidth; NetworkControlUpdate update; diff --git a/modules/congestion_controller/bbr/bbr_network_controller.h b/modules/congestion_controller/bbr/bbr_network_controller.h index 34d76bbf30..2f842defab 100644 --- a/modules/congestion_controller/bbr/bbr_network_controller.h +++ b/modules/congestion_controller/bbr/bbr_network_controller.h @@ -157,19 +157,6 @@ class BbrNetworkController : public NetworkControllerInterface { // recently app limited. bool probe_rtt_disabled_if_app_limited; }; - // Containing values that when changed should trigger an update. - struct UpdateState { - UpdateState(); - UpdateState(const UpdateState&); - ~UpdateState(); - Mode mode = Mode::STARTUP; - rtc::Optional bandwidth; - rtc::Optional rtt; - rtc::Optional pacing_rate; - rtc::Optional target_rate; - bool probing_for_bandwidth = false; - }; - void Reset(); NetworkControlUpdate CreateRateUpdate(Timestamp at_time); @@ -390,7 +377,6 @@ class BbrNetworkController : public NetworkControllerInterface { bool app_limited_since_last_probe_rtt_ = false; TimeDelta min_rtt_since_last_probe_rtt_ = TimeDelta::PlusInfinity(); - UpdateState last_update_state_; RTC_DISALLOW_COPY_AND_ASSIGN(BbrNetworkController); };