MINOR: quic: Add a counter for reordered packets
A packet is considered as reordered when it is detected as lost because its packet
number is above the largest acknowledeged packet number by at least the
packet reordering threshold value.
Add ->nb_reordered_pkt new quic_loss struct member at the same location that
the number of lost packets to count such packets.
Should be backported to 2.6.
(cherry picked from commit 167e38e0e0296e899aa894d2f3db5ba2a0c68cb5)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 3f8794d043c45e9ce624e8d9cf6c22c7bbbead1b)
[wt: quic cli is in quic_conn.c in 2.8]
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/src/quic_loss.c b/src/quic_loss.c
index 7681ec7..0169d32 100644
--- a/src/quic_loss.c
+++ b/src/quic_loss.c
@@ -195,6 +195,7 @@
struct quic_tx_packet *pkt;
int64_t largest_acked_pn;
unsigned int loss_time_limit, time_sent;
+ int reordered;
pkt = eb64_entry(&node->node, struct quic_tx_packet, pn_node);
largest_acked_pn = pktns->rx.largest_acked_pn;
@@ -204,8 +205,12 @@
time_sent = pkt->time_sent;
loss_time_limit = tick_add(time_sent, loss_delay);
- if (tick_is_le(loss_time_limit, now_ms) ||
- (int64_t)largest_acked_pn >= pkt->pn_node.key + pktthresh) {
+
+ reordered = (int64_t)largest_acked_pn >= pkt->pn_node.key + pktthresh;
+ if (reordered)
+ ql->nb_reordered_pkt++;
+
+ if (tick_is_le(loss_time_limit, now_ms) || reordered) {
eb64_delete(&pkt->pn_node);
LIST_APPEND(lost_pkts, &pkt->list);
ql->nb_lost_pkt++;