Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: net/quic/core/congestion_control/bbr_sender.cc

Issue 2848633002: Fix packet conservation logic in QUIC BBR. Protected by FLAGS_quic_reloadable_flag_quic_bbr_fix_co… (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/core/congestion_control/bbr_sender_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/congestion_control/bbr_sender.cc
diff --git a/net/quic/core/congestion_control/bbr_sender.cc b/net/quic/core/congestion_control/bbr_sender.cc
index cd7e59c3186dbc7a4957af99d6abc6368709ecde..123a766aebdc44aa03f92c00de927be179f397b3 100644
--- a/net/quic/core/congestion_control/bbr_sender.cc
+++ b/net/quic/core/congestion_control/bbr_sender.cc
@@ -553,6 +553,13 @@ void BbrSender::UpdateRecoveryState(QuicPacketNumber last_acked_packet,
// Enter conservation on the first loss.
if (has_losses) {
recovery_state_ = CONSERVATION;
+ if (FLAGS_quic_reloadable_flag_quic_bbr_fix_conservation) {
+ // This will cause the |recovery_window_| to be set to the correct
+ // value in CalculateRecoveryWindow().
+ recovery_window_ = 0;
+ QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_fix_conservation, 1,
+ 3);
+ }
// Since the conservation phase is meant to be lasting for a whole
// round, extend the current round as if it were started right now.
current_round_trip_end_ = last_sent_packet_;
@@ -712,10 +719,25 @@ void BbrSender::CalculateCongestionWindow(QuicByteCount bytes_acked) {
void BbrSender::CalculateRecoveryWindow(QuicByteCount bytes_acked) {
switch (recovery_state_) {
case CONSERVATION:
- recovery_window_ = unacked_packets_->bytes_in_flight() + bytes_acked;
+ if (FLAGS_quic_reloadable_flag_quic_bbr_fix_conservation) {
+ QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_fix_conservation, 2, 3);
+ recovery_window_ =
+ std::max(unacked_packets_->bytes_in_flight() + bytes_acked,
+ recovery_window_);
+ } else {
+ recovery_window_ = unacked_packets_->bytes_in_flight() + bytes_acked;
+ }
break;
case GROWTH:
- recovery_window_ = unacked_packets_->bytes_in_flight() + 2 * bytes_acked;
+ if (FLAGS_quic_reloadable_flag_quic_bbr_fix_conservation) {
+ QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_fix_conservation, 3, 3);
+ recovery_window_ =
+ std::max(unacked_packets_->bytes_in_flight() + 2 * bytes_acked,
+ recovery_window_ + bytes_acked);
+ } else {
+ recovery_window_ =
+ unacked_packets_->bytes_in_flight() + 2 * bytes_acked;
+ }
break;
default:
break;
« no previous file with comments | « no previous file | net/quic/core/congestion_control/bbr_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698