]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Send packets as much as possible from qc_send_app_pkts()
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 26 Jul 2022 07:17:19 +0000 (09:17 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 29 Jul 2022 15:32:05 +0000 (17:32 +0200)
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

index 4a77db16a6b5c067cfbbd14ed555fa5eb48dbfd4..67ab817df574d68d2c12c194a871b19c712a436b 100644 (file)
@@ -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;