]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: store the lost packets counter in the quic_cc_event element
authorWilly Tarreau <w@1wt.eu>
Thu, 25 Jul 2024 12:32:20 +0000 (14:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Aug 2024 06:02:44 +0000 (08:02 +0200)
Upon loss detection, qc_release_lost_pkts() notifies congestion
controllers about the event and its final time. However it does not
pass the number of lost packets, that can provide useful hints for
some controllers. Let's just pass this option.

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

index d6fa46d654d94d940eb2c03f2f3ecf909f85d5d2..92115d2fd7099e1f5e14d198f4fc6ef6a765db8b 100644 (file)
@@ -73,6 +73,7 @@ struct quic_cc_event {
                } ack;
                struct loss {
                        unsigned int time_sent;
+                       unsigned int count; // #pkt lost for this event
                } loss;
        };
 };
index fd9568a50a535a95efe22c061508db4ed341d278..e80757102c3c3bd829bf14655465024e40d91f4c 100644 (file)
@@ -242,6 +242,7 @@ int qc_release_lost_pkts(struct quic_conn *qc, struct quic_pktns *pktns,
                          struct list *pkts, uint64_t now_us)
 {
        struct quic_tx_packet *pkt, *tmp, *oldest_lost, *newest_lost;
+       uint tot_lost = 0;
        int close = 0;
 
        TRACE_ENTER(QUIC_EV_CONN_PRSAFRM, qc);
@@ -270,6 +271,7 @@ int qc_release_lost_pkts(struct quic_conn *qc, struct quic_pktns *pktns,
                                quic_tx_packet_refdec(newest_lost);
                        newest_lost = pkt;
                }
+               tot_lost++;
        }
 
        if (!close) {
@@ -279,6 +281,7 @@ int qc_release_lost_pkts(struct quic_conn *qc, struct quic_pktns *pktns,
 
                        ev.type = QUIC_CC_EVT_LOSS;
                        ev.loss.time_sent = newest_lost->time_sent;
+                       ev.loss.count = tot_lost;
 
                        quic_cc_event(&qc->path->cc, &ev);
                }