From 9d8589f0dee050352ae874be6a4fdeecbb428992 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Fri, 10 Jan 2025 17:20:55 +0100 Subject: [PATCH] MINOR: mux-quic: increment pacing retry counter on expired A field from quic_pacer structure is used to report the number of occurences where emission has been interrupted due to pacing. However, it was not incremented when QUIC MUX had to pause immediately emission as pacing was still not yet expired. Fix this by incrementing in qcc_io_send() prior to emission if pacing is expired. Note that incrementation is only done once if the tasklet is then repeatdely woken up until the timer is expired. This should be backported up to 3.1. --- src/mux_quic.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mux_quic.c b/src/mux_quic.c index dc0cdb484..f0766343a 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2474,7 +2474,7 @@ static int qcc_build_frms(struct qcc *qcc, struct list *qcs_failed) * * Returns the total of bytes sent to the transport layer. */ -static int qcc_io_send(struct qcc *qcc) +static int qcc_io_send(struct qcc *qcc, int after_pacing) { struct list *frms = &qcc->tx.frms; /* Temporary list for QCS on error. */ @@ -2535,6 +2535,8 @@ static int qcc_io_send(struct qcc *qcc) if (qcc_is_pacing_active(qcc->conn)) { if (!LIST_ISEMPTY(frms) && !quic_pacing_expired(&qcc->tx.pacer)) { + if (!after_pacing) + ++qcc->tx.paced_sent_ctr; tasklet_wakeup(qcc->wait_event.tasklet, TASK_F_UEVT1); total = 0; goto out; @@ -2706,7 +2708,7 @@ static void qcc_shutdown(struct qcc *qcc) TRACE_STATE("perform graceful shutdown", QMUX_EV_QCC_END, qcc->conn); if (qcc->app_ops && qcc->app_ops->shutdown) { qcc->app_ops->shutdown(qcc->ctx); - qcc_io_send(qcc); + qcc_io_send(qcc, 0); } else { qcc->err = quic_err_transport(QC_ERR_NO_ERROR); @@ -2778,7 +2780,7 @@ static int qcc_io_process(struct qcc *qcc) if (!qc_test_fd(qcc->conn->handle.qc)) { TRACE_DEVEL("proxy disabled with listener socket, closing connection", QMUX_EV_QCC_WAKE, qcc->conn); qcc->conn->flags |= (CO_FL_SOCK_RD_SH|CO_FL_SOCK_WR_SH); - qcc_io_send(qcc); + qcc_io_send(qcc, 0); goto out; } @@ -2901,7 +2903,7 @@ struct task *qcc_io_cb(struct task *t, void *ctx, unsigned int status) TRACE_ENTER(QMUX_EV_QCC_WAKE, qcc->conn); if (!(qcc->wait_event.events & SUB_RETRY_SEND)) - qcc_io_send(qcc); + qcc_io_send(qcc, status & TASK_F_UEVT1); qcc_io_recv(qcc); -- 2.47.2