Skip to content

Commit

Permalink
Add a new option to control bbr2 exiting startup on loss
Browse files Browse the repository at this point in the history
Summary: As title.

Reviewed By: ritengupta, mjoras

Differential Revision: D68546411

fbshipit-source-id: ae45727fb8443a98e4ac69778d5d85e2512f7a7b
  • Loading branch information
jbeshay authored and facebook-github-bot committed Jan 24, 2025
1 parent 2f794bd commit c527fd1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion quic/congestion_control/Bbr2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ void Bbr2CongestionController::checkStartupHighLoss() {
the same.
*/
if (fullBwReached_ || !roundStart_ || isAppLimited() ||
conn_.transportSettings.ccaConfig.ignoreLoss) {
!conn_.transportSettings.ccaConfig.exitStartupOnLoss) {
// TODO: the appLimited condition means we could tolerate losses in startup
// if we haven't found the full bandwidth. This may need to be revisited.

Expand Down
4 changes: 4 additions & 0 deletions quic/state/TransportSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ struct CongestionControlConfig {
// Whether BBR2 should ignore packet loss (i.e. act more like BBR1)
bool ignoreLoss{false};

// Used by: BBR2
// Whether BBR2 should check packet loss to exit startup
bool exitStartupOnLoss{true};

// Used by: BBR2
// Whether BBR2 should enable reno coexistence.
bool enableRenoCoexistence{false};
Expand Down
3 changes: 2 additions & 1 deletion quic/state/TransportSettingsFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ quic::CongestionControlConfig parseCongestionControlConfig(
quic::CongestionControlConfig ccaConfig;

// Parse known boolean fields
const std::array<std::pair<std::string_view, bool&>, 12> boolFields = {
const std::array<std::pair<std::string_view, bool&>, 13> boolFields = {
{{"conservativeRecovery", ccaConfig.conservativeRecovery},
{"largeProbeRttCwnd", ccaConfig.largeProbeRttCwnd},
{"enableAckAggregationInStartup",
Expand All @@ -76,6 +76,7 @@ quic::CongestionControlConfig parseCongestionControlConfig(
{"leaveHeadroomForCwndLimited", ccaConfig.leaveHeadroomForCwndLimited},
{"ignoreInflightHi", ccaConfig.ignoreInflightHi},
{"ignoreLoss", ccaConfig.ignoreLoss},
{"exitStartupOnLoss", ccaConfig.exitStartupOnLoss},
{"enableRenoCoexistence", ccaConfig.enableRenoCoexistence},
{"paceInitCwnd", ccaConfig.paceInitCwnd}}};

Expand Down
3 changes: 3 additions & 0 deletions quic/state/test/TransportSettingsFunctionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ TEST_F(TransportSettingsFunctionsTest, FullConfig) {
"},"
"\"ignoreInflightHi\": true, "
"\"ignoreLoss\": true, "
"\"exitStartupOnLoss\": false, "
"\"enableRenoCoexistence\": true, "
"\"paceInitCwnd\": false, "
"\"overrideCruisePacingGain\": 7.9, "
Expand All @@ -83,6 +84,7 @@ TEST_F(TransportSettingsFunctionsTest, FullConfig) {
EXPECT_EQ(config.leaveHeadroomForCwndLimited, true);
EXPECT_EQ(config.ignoreInflightHi, true);
EXPECT_EQ(config.ignoreLoss, true);
EXPECT_EQ(config.exitStartupOnLoss, false);
EXPECT_EQ(config.enableRenoCoexistence, true);
EXPECT_EQ(config.paceInitCwnd, false);
EXPECT_EQ(config.overrideCruisePacingGain, 7.9f);
Expand Down Expand Up @@ -112,6 +114,7 @@ TEST_F(TransportSettingsFunctionsTest, UnspecifiedFieldsAreDefaulted) {
EXPECT_EQ(config.drainToTarget, false);
EXPECT_EQ(config.ignoreInflightHi, false);
EXPECT_EQ(config.ignoreLoss, false);
EXPECT_EQ(config.exitStartupOnLoss, true);
EXPECT_EQ(config.enableRenoCoexistence, false);
EXPECT_EQ(config.overrideCruisePacingGain, -1.0f);
EXPECT_EQ(config.overrideCruiseCwndGain, -1.0f);
Expand Down

0 comments on commit c527fd1

Please sign in to comment.