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 3f3714ef14c8ace3d0a3af5d543f2d4f6a202c51..3fd27fd420308aaaf1b461344f9c49caca07f796 100644 |
--- a/net/quic/core/congestion_control/bbr_sender.cc |
+++ b/net/quic/core/congestion_control/bbr_sender.cc |
@@ -89,6 +89,7 @@ BbrSender::BbrSender(const RttStats* rtt_stats, |
max_ack_height_(kBandwidthWindowSize, 0, 0), |
aggregation_epoch_start_time_(QuicTime::Zero()), |
aggregation_epoch_bytes_(0), |
+ bytes_acked_since_queue_drained_(0), |
min_rtt_(QuicTime::Delta::Zero()), |
min_rtt_timestamp_(QuicTime::Zero()), |
congestion_window_(initial_tcp_congestion_window * kDefaultTCPMSS), |
@@ -276,18 +277,29 @@ void BbrSender::OnCongestionEvent(bool /*rtt_updated*/, |
UpdateRecoveryState(last_acked_packet, !lost_packets.empty(), |
is_round_start); |
+ const QuicByteCount bytes_acked = |
+ sampler_.total_bytes_acked() - total_bytes_acked_before; |
if (FLAGS_quic_reloadable_flag_quic_bbr_slow_recent_delivery) { |
QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_slow_recent_delivery, 1, |
2); |
- UpdateRecentlyAcked( |
- event_time, sampler_.total_bytes_acked() - total_bytes_acked_before); |
+ UpdateRecentlyAcked(event_time, bytes_acked); |
} |
if (FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes) { |
QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_ack_aggregation_bytes, 1, |
2); |
- UpdateAckAggregationBytes( |
- event_time, sampler_.total_bytes_acked() - total_bytes_acked_before); |
+ UpdateAckAggregationBytes(event_time, bytes_acked); |
+ } |
+ if (FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2) { |
+ QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2, 1, |
+ 2); |
+ UpdateAckAggregationBytes(event_time, bytes_acked); |
+ if (unacked_packets_->bytes_in_flight() <= |
+ 1.25 * GetTargetCongestionWindow(pacing_gain_)) { |
+ bytes_acked_since_queue_drained_ = 0; |
+ } else { |
+ bytes_acked_since_queue_drained_ += bytes_acked; |
+ } |
} |
} |
@@ -652,6 +664,14 @@ void BbrSender::CalculateCongestionWindow(QuicByteCount bytes_acked) { |
QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_ack_aggregation_bytes, 2, |
2); |
target_window += max_ack_height_.GetBest(); |
+ } else if (FLAGS_quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2 && |
+ is_at_full_bandwidth_) { |
+ QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_bbr_ack_aggregation_bytes2, 2, |
+ 2); |
+ if (2 * max_ack_height_.GetBest() > bytes_acked_since_queue_drained_) { |
+ target_window += |
+ 2 * max_ack_height_.GetBest() - bytes_acked_since_queue_drained_; |
+ } |
} |
if (FLAGS_quic_reloadable_flag_quic_bbr_add_tso_cwnd) { |
// QUIC doesn't have TSO, but it does have similarly quantized pacing, so |