From c40e19d7114c5d9cb69dc9d58732bd1ad41ae289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 29 Apr 2022 16:00:17 +0200 Subject: [PATCH] BUG/MINOR: quic: Missing time threshold multiplifier for loss delay computation 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 | 6 ++++++ src/quic_loss.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/haproxy/quic_loss-t.h b/include/haproxy/quic_loss-t.h index ff32ba20c..f91781f50 100644 --- a/include/haproxy/quic_loss-t.h +++ b/include/haproxy/quic_loss-t.h @@ -33,6 +33,12 @@ #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. */ diff --git a/src/quic_loss.c b/src/quic_loss.c index b7f607524..42eb5a251 100644 --- a/src/quic_loss.c +++ b/src/quic_loss.c @@ -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) {