From: Frederic Lecaille Date: Thu, 25 Jan 2024 06:55:33 +0000 (+0100) Subject: MINOR: quic: Stop hardcoding a scale shifting value (CUBIC_BETA_SCALE_FACTOR_SHIFT) X-Git-Tag: v3.0-dev2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96385f40b508a395fcd802a9dff13e968c12433d;p=thirdparty%2Fhaproxy.git MINOR: quic: Stop hardcoding a scale shifting value (CUBIC_BETA_SCALE_FACTOR_SHIFT) Very minor modification to replace a statement with an hardcoded value by a macro. Should be backported as far as 2.6 to ease any further modification to come. --- diff --git a/src/quic_cc_cubic.c b/src/quic_cc_cubic.c index 791987c979..0ed4a325e9 100644 --- a/src/quic_cc_cubic.c +++ b/src/quic_cc_cubic.c @@ -138,7 +138,7 @@ static inline void quic_cubic_update(struct quic_cc *cc, uint32_t acked) goto leave; } - delta = path->mtu * ((CUBIC_C * diff * diff * diff) >> (10 + 3 * TIME_SCALE_FACTOR_SHIFT)); + delta = path->mtu * ((CUBIC_C * diff * diff * diff) >> (CUBIC_BETA_SCALE_SHIFT + 3 * TIME_SCALE_FACTOR_SHIFT)); if (t < c->K) target = c->origin_point - delta; else