From eca47d9a8aa2675578d743f7fb4dd93a0ef489d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 14 Feb 2022 10:17:01 +0100 Subject: [PATCH] MINOR: quic: Wrong smoothed rtt initialization In ->srtt we store 8*srtt to ease the srtt computations with this formula: srtt = 7/8 * srtt + 1/8 * adjusted_rtt But its initialization was wrong. --- include/haproxy/quic_loss-t.h | 2 +- include/haproxy/quic_loss.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/haproxy/quic_loss-t.h b/include/haproxy/quic_loss-t.h index 5ca9b3a5e..9230eec1f 100644 --- a/include/haproxy/quic_loss-t.h +++ b/include/haproxy/quic_loss-t.h @@ -40,7 +40,7 @@ struct quic_loss { /* The most recent RTT measurement. */ unsigned int latest_rtt; - /* Smoothed RTT << 4*/ + /* Smoothed RTT << 3 */ unsigned int srtt; /* RTT variation << 2 */ unsigned int rtt_var; diff --git a/include/haproxy/quic_loss.h b/include/haproxy/quic_loss.h index cc48f0df5..0aea165ec 100644 --- a/include/haproxy/quic_loss.h +++ b/include/haproxy/quic_loss.h @@ -35,7 +35,7 @@ static inline void quic_loss_init(struct quic_loss *ql) { - ql->srtt = QUIC_LOSS_INITIAL_RTT << 4; + ql->srtt = QUIC_LOSS_INITIAL_RTT << 3; ql->rtt_var = (QUIC_LOSS_INITIAL_RTT >> 1) << 2; ql->rtt_min = 0; ql->pto_count = 0;