From 92110ad713cef156179762392731276462aeb306 Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Thu, 31 Oct 2024 10:10:56 +0100 Subject: [PATCH] WIP: quic: Pacing minor modifications (NOT SURE TO BE KEPT) --- include/haproxy/quic_pacing.h | 2 +- src/quic_pacing.c | 2 +- src/quic_tx.c | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/haproxy/quic_pacing.h b/include/haproxy/quic_pacing.h index ee536fb2e..26c4cca9c 100644 --- a/include/haproxy/quic_pacing.h +++ b/include/haproxy/quic_pacing.h @@ -39,6 +39,6 @@ int quic_pacing_expired(const struct quic_pacer *pacer); enum quic_tx_err quic_pacing_send(struct quic_pacer *pacer, struct quic_conn *qc); -void quic_pacing_sent_done(struct quic_pacer *pacer, int sent); +void quic_pacing_sent_done(struct quic_pacer *pacer, int sent, ullong ns_pkts); #endif /* _HAPROXY_QUIC_PACING_H */ diff --git a/src/quic_pacing.c b/src/quic_pacing.c index 8a1e33f23..97dc41f67 100644 --- a/src/quic_pacing.c +++ b/src/quic_pacing.c @@ -23,7 +23,7 @@ enum quic_tx_err quic_pacing_send(struct quic_pacer *pacer, struct quic_conn *qc return ret; } -void quic_pacing_sent_done(struct quic_pacer *pacer, int sent) +void quic_pacing_sent_done(struct quic_pacer *pacer, int sent, ullong ns_pkts) { pacer->next = now_mono_time() + quic_pacing_ns_pkt(pacer) * sent; } diff --git a/src/quic_tx.c b/src/quic_tx.c index c2883c312..68f5c8cd2 100644 --- a/src/quic_tx.c +++ b/src/quic_tx.c @@ -480,6 +480,7 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms, struct list send_list = LIST_HEAD_INIT(send_list); enum quic_tx_err ret = QUIC_TX_ERR_NONE; int max_dgram = 0, sent; + ullong ns_pkts; TRACE_ENTER(QUIC_EV_CONN_TXPKT, qc); BUG_ON(qc->mux_state != QC_MUX_READY); /* Only MUX can uses this function so it must be ready. */ @@ -500,7 +501,8 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms, if (pacer) { struct quic_cc *cc = &qc->path->cc; - const ullong ns_pkts = cc->algo->pacing_delay_ns(cc); + + ns_pkts = cc->algo->pacing_delay_ns(cc); max_dgram = global.tune.quic_frontend_max_tx_burst * 1000000 / (ns_pkts + 1) + 1; } @@ -513,7 +515,7 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms, else if (pacer) { if (max_dgram && max_dgram == sent && !LIST_ISEMPTY(frms)) ret = QUIC_TX_ERR_AGAIN; - quic_pacing_sent_done(pacer, sent); + quic_pacing_sent_done(pacer, sent, ns_pkts); } TRACE_LEAVE(QUIC_EV_CONN_TXPKT, qc);