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.
This commit is contained in:
Frédéric Lécaille 2022-07-26 09:17:19 +02:00 committed by Amaury Denoyelle
parent 843399fd45
commit dc07751ed7
1 changed files with 12 additions and 9 deletions

View 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;