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

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

Issue 2569873002: relnote: Protected by --quic_fix_cubic_bytes_quantization. Fix CubicBytes Quantization. (Closed)
Patch Set: Created 4 years 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
Index: net/quic/core/congestion_control/cubic_bytes.cc
diff --git a/net/quic/core/congestion_control/cubic_bytes.cc b/net/quic/core/congestion_control/cubic_bytes.cc
index 7abe9209fe733b3d672cb83abf66df6ab7bdfcd0..388dd008b2c4365bd0690d31aa6f869281ec5360 100644
--- a/net/quic/core/congestion_control/cubic_bytes.cc
+++ b/net/quic/core/congestion_control/cubic_bytes.cc
@@ -41,7 +41,8 @@ CubicBytes::CubicBytes(const QuicClock* clock)
num_connections_(kDefaultNumConnections),
epoch_(QuicTime::Zero()),
last_update_time_(QuicTime::Zero()),
- fix_convex_mode_(false) {
+ fix_convex_mode_(false),
+ fix_cubic_quantization_(false) {
Reset();
}
@@ -76,12 +77,17 @@ void CubicBytes::Reset() {
time_to_origin_point_ = 0;
last_target_congestion_window_ = 0;
fix_convex_mode_ = false;
+ fix_cubic_quantization_ = false;
}
void CubicBytes::SetFixConvexMode(bool fix_convex_mode) {
fix_convex_mode_ = fix_convex_mode;
}
+void CubicBytes::SetFixCubicQuantization(bool fix_cubic_quantization) {
+ fix_cubic_quantization_ = fix_cubic_quantization;
+}
+
void CubicBytes::OnApplicationLimited() {
// When sender is not using the available congestion window, the window does
// not grow. But to be RTT-independent, Cubic assumes that the sender has been
@@ -158,8 +164,13 @@ QuicByteCount CubicBytes::CongestionWindowAfterAck(
offset = positive_offset;
}
QuicByteCount delta_congestion_window =
- ((kCubeCongestionWindowScale * offset * offset * offset) >> kCubeScale) *
- kDefaultTCPMSS;
+ fix_cubic_quantization_
+ ? (kCubeCongestionWindowScale * offset * offset * offset *
+ kDefaultTCPMSS) >>
+ kCubeScale
+ : ((kCubeCongestionWindowScale * offset * offset * offset) >>
+ kCubeScale) *
+ kDefaultTCPMSS;
const bool add_delta = elapsed_time > time_to_origin_point_;
DCHECK(add_delta ||
« no previous file with comments | « net/quic/core/congestion_control/cubic_bytes.h ('k') | net/quic/core/congestion_control/cubic_bytes_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698