| Index: net/quic/congestion_control/tcp_cubic_sender_packets.cc
|
| diff --git a/net/quic/congestion_control/tcp_cubic_sender_packets.cc b/net/quic/congestion_control/tcp_cubic_sender_packets.cc
|
| index aee29ba1064cdc3efa7774fc6f6c5794cd111c01..0467963c487f528dd7cc3380b09dcb36eb83a67e 100644
|
| --- a/net/quic/congestion_control/tcp_cubic_sender_packets.cc
|
| +++ b/net/quic/congestion_control/tcp_cubic_sender_packets.cc
|
| @@ -41,18 +41,24 @@ TcpCubicSenderPackets::TcpCubicSenderPackets(
|
| slowstart_threshold_(max_tcp_congestion_window),
|
| max_tcp_congestion_window_(max_tcp_congestion_window),
|
| initial_tcp_congestion_window_(initial_tcp_congestion_window),
|
| - initial_max_tcp_congestion_window_(max_tcp_congestion_window) {}
|
| + initial_max_tcp_congestion_window_(max_tcp_congestion_window),
|
| + min_slow_start_exit_window_(min_congestion_window_) {}
|
|
|
| TcpCubicSenderPackets::~TcpCubicSenderPackets() {}
|
|
|
| void TcpCubicSenderPackets::SetCongestionWindowFromBandwidthAndRtt(
|
| QuicBandwidth bandwidth,
|
| QuicTime::Delta rtt) {
|
| - // Make sure CWND is in appropriate range (in case of bad data).
|
| QuicPacketCount new_congestion_window =
|
| bandwidth.ToBytesPerPeriod(rtt) / kDefaultTCPMSS;
|
| - congestion_window_ = max(min(new_congestion_window, kMaxCongestionWindow),
|
| - kMinCongestionWindowForBandwidthResumption);
|
| + if (FLAGS_quic_no_lower_bw_resumption_limit) {
|
| + // Limit new CWND to be in the range [1, kMaxCongestionWindow].
|
| + congestion_window_ = max(min_congestion_window_,
|
| + min(new_congestion_window, kMaxCongestionWindow));
|
| + } else {
|
| + congestion_window_ = max(min(new_congestion_window, kMaxCongestionWindow),
|
| + kMinCongestionWindowForBandwidthResumption);
|
| + }
|
| }
|
|
|
| void TcpCubicSenderPackets::SetCongestionWindowInPackets(
|
| @@ -94,7 +100,7 @@ void TcpCubicSenderPackets::OnPacketLost(QuicPacketNumber packet_number,
|
| (stats_->slowstart_bytes_lost - lost_bytes) / kDefaultTCPMSS) {
|
| // Reduce congestion window by 1 for every mss of bytes lost.
|
| congestion_window_ =
|
| - max(congestion_window_ - 1, min_congestion_window_);
|
| + max(congestion_window_ - 1, min_slow_start_exit_window_);
|
| }
|
| slowstart_threshold_ = congestion_window_;
|
| }
|
| @@ -114,6 +120,10 @@ void TcpCubicSenderPackets::OnPacketLost(QuicPacketNumber packet_number,
|
| // TODO(jri): Separate out all of slow start into a separate class.
|
| if (slow_start_large_reduction_ && InSlowStart()) {
|
| DCHECK_LT(1u, congestion_window_);
|
| + if (FLAGS_quic_sslr_limit_reduction &&
|
| + congestion_window_ >= 2 * initial_tcp_congestion_window_) {
|
| + min_slow_start_exit_window_ = congestion_window_ / 2;
|
| + }
|
| congestion_window_ = congestion_window_ - 1;
|
| } else if (reno_) {
|
| congestion_window_ = congestion_window_ * RenoBeta();
|
|
|