]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Missing time threshold multiplifier for loss delay computation
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 29 Apr 2022 14:00:17 +0000 (16:00 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 29 Apr 2022 14:46:56 +0000 (16:46 +0200)
It seems this multiplier ended up in oblivion. Indeed a multiplier must be
applied to the loss delay expressed as an RTT multiplier: 9/8.

So, some packets were detected as lost too soon, leading to be retransmitted too
early!

include/haproxy/quic_loss-t.h
src/quic_loss.c

index ff32ba20c3c84a58123538b2b1a9b3f3b7ec2265..f91781f50352e1de04e9ef2d144d107e7677e0ad 100644 (file)
 #define QUIC_TIMER_GRANULARITY            1U /* 1ms   */
 #define QUIC_LOSS_INITIAL_RTT           333U /* 333ms */
 
+/* QUIC loss time threshold expressed an RTT multiplier
+ * (QUIC_LOSS_TIME_THRESHOLD_MULTIPLICAND / QUIC_LOSS_TIME_THRESHOLD_DIVISOR)
+ */
+#define QUIC_LOSS_TIME_THRESHOLD_MULTIPLICAND 9
+#define QUIC_LOSS_TIME_THRESHOLD_DIVISOR      8
+
 /* Note that all the unit of variables for QUIC LOSS dectections
  * is the tick.
  */
index b7f6075249d3b1fa0518a08853b9d002aea9bdeb..42eb5a2515a7061175f0e38ae711abcb84d0f0c5 100644 (file)
@@ -154,7 +154,8 @@ void qc_packet_loss_lookup(struct quic_pktns *pktns, struct quic_conn *qc,
 
        ql = &qc->path->loss;
        loss_delay = QUIC_MAX(ql->latest_rtt, ql->srtt >> 3);
-       loss_delay = QUIC_MAX(loss_delay, MS_TO_TICKS(QUIC_TIMER_GRANULARITY));
+       loss_delay = QUIC_MAX(loss_delay, MS_TO_TICKS(QUIC_TIMER_GRANULARITY)) *
+               QUIC_LOSS_TIME_THRESHOLD_MULTIPLICAND / QUIC_LOSS_TIME_THRESHOLD_DIVISOR;
 
        node = eb64_first(pkts);
        while (node) {