]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Wrong smoothed rtt initialization
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 14 Feb 2022 09:17:01 +0000 (10:17 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 15 Feb 2022 16:23:44 +0000 (17:23 +0100)
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
include/haproxy/quic_loss.h

index 5ca9b3a5e7c5a885a487bc17ee5f275510bdf77a..9230eec1f3ae12910f348eec8e3afa9f7f1302f8 100644 (file)
@@ -40,7 +40,7 @@
 struct quic_loss {
        /* The most recent RTT measurement. */
        unsigned int latest_rtt;
-       /* Smoothed RTT << 4*/
+       /* Smoothed RTT << */
        unsigned int srtt;
        /* RTT variation << 2 */
        unsigned int rtt_var;
index cc48f0df58b7ff1ce5b4f6e83e5fa3561f0dc621..0aea165ec33b0f78fa433a05a1b946b5f59e42ae 100644 (file)
@@ -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;