From dc07751ed7ebad10f49081d28a9a5ae785f53d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Tue, 26 Jul 2022 09:17:19 +0200 Subject: [PATCH] MINOR: quic: Send packets as much as possible from qc_send_app_pkts() Add a loop into this function to send more packets from this function which is called by the mux. It is broken when we could not prepare packet with qc_prep_app_pkts() due to missing available room in the buffer used to send packets. This improves the throughput. Must be backported to 2.6. --- src/xprt_quic.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 4a77db16a6..67ab817df5 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -3678,16 +3678,19 @@ int qc_send_app_pkts(struct quic_conn *qc, int old_data, struct list *frms) /* Never happens */ return 1; - if (old_data) - qc->flags |= QUIC_FL_CONN_RETRANS_OLD_DATA; - ret = qc_prep_app_pkts(qc, qr, frms); - if (ret == -1) - goto err; - else if (ret == 0) - goto out; + /* Prepare and send packets until we could not further prepare packets. */ + while (1) { + if (old_data) + qc->flags |= QUIC_FL_CONN_RETRANS_OLD_DATA; + ret = qc_prep_app_pkts(qc, qr, frms); + if (ret == -1) + goto err; + else if (ret == 0) + goto out; - if (!qc_send_ppkts(qr, qc->xprt_ctx)) - goto err; + if (!qc_send_ppkts(qr, qc->xprt_ctx)) + goto err; + } out: qc->flags &= ~QUIC_FL_CONN_RETRANS_OLD_DATA;