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

View File

@ -3678,16 +3678,19 @@ int qc_send_app_pkts(struct quic_conn *qc, int old_data, struct list *frms)
/* Never happens */ /* Never happens */
return 1; return 1;
if (old_data) /* Prepare and send packets until we could not further prepare packets. */
qc->flags |= QUIC_FL_CONN_RETRANS_OLD_DATA; while (1) {
ret = qc_prep_app_pkts(qc, qr, frms); if (old_data)
if (ret == -1) qc->flags |= QUIC_FL_CONN_RETRANS_OLD_DATA;
goto err; ret = qc_prep_app_pkts(qc, qr, frms);
else if (ret == 0) if (ret == -1)
goto out; goto err;
else if (ret == 0)
goto out;
if (!qc_send_ppkts(qr, qc->xprt_ctx)) if (!qc_send_ppkts(qr, qc->xprt_ctx))
goto err; goto err;
}
out: out:
qc->flags &= ~QUIC_FL_CONN_RETRANS_OLD_DATA; qc->flags &= ~QUIC_FL_CONN_RETRANS_OLD_DATA;