From: Amaury Denoyelle Date: Thu, 4 Aug 2022 08:11:12 +0000 (+0200) Subject: CLEANUP: mux-quic: remove loop on sending frames X-Git-Tag: v2.7-dev4~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56c6154dba95c74659f0b2d72073e80d63b92c4b;p=thirdparty%2Fhaproxy.git CLEANUP: mux-quic: remove loop on sending frames qc_send_app_pkts() has now a while loop implemented which allows to send all possible frames even if the send buffer is full between packet prepare and send. This is present since commit : dc07751ed7ebad10f49081d28a9a5ae785f53d76 MINOR: quic: Send packets as much as possible from qc_send_app_pkts() This means we can remove code from the MUX which implement this at the upper layer. This is useful to simplify qc_send_frames() function. As mentionned commit is subject to backport, this commit should be backported as well to 2.6. --- diff --git a/src/mux_quic.c b/src/mux_quic.c index dd9e9f4a4e..96a2b6b450 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -1349,22 +1349,6 @@ void qcc_streams_sent_done(struct qcs *qcs, uint64_t data, uint64_t offset) */ static int qc_send_frames(struct qcc *qcc, struct list *frms) { - /* TODO implement an opportunistic retry mechanism. This is needed - * because qc_send_app_pkts is not completed. It will only prepare data - * up to its Tx buffer. The frames left are not send even if the Tx - * buffer is emptied by the sendto call. - * - * To overcome this, we call repeatedly qc_send_app_pkts until we - * detect that the transport layer has send nothing. This could happen - * on congestion or sendto syscall error. - * - * When qc_send_app_pkts is improved to handle retry by itself, we can - * remove the looping from the MUX. - */ - struct quic_frame *first_frm; - uint64_t first_offset = 0; - char first_stream_frame_type; - TRACE_ENTER(QMUX_EV_QCC_SEND, qcc->conn); if (LIST_ISEMPTY(frms)) { @@ -1374,34 +1358,7 @@ static int qc_send_frames(struct qcc *qcc, struct list *frms) LIST_INIT(&qcc->send_retry_list); - retry_send: - first_frm = LIST_ELEM(frms->n, struct quic_frame *, list); - if ((first_frm->type & QUIC_FT_STREAM_8) == QUIC_FT_STREAM_8) { - first_offset = first_frm->stream.offset.key; - first_stream_frame_type = 1; - } - else { - first_stream_frame_type = 0; - } - - if (!LIST_ISEMPTY(frms)) - qc_send_app_pkts(qcc->conn->handle.qc, 0, frms); - - /* If there is frames left, check if the transport layer has send some - * data or is blocked. - */ - if (!LIST_ISEMPTY(frms)) { - if (first_frm != LIST_ELEM(frms->n, struct quic_frame *, list)) - goto retry_send; - - /* If the first frame is STREAM, check if its offset has - * changed. - */ - if (first_stream_frame_type && - first_offset != LIST_ELEM(frms->n, struct quic_frame *, list)->stream.offset.key) { - goto retry_send; - } - } + qc_send_app_pkts(qcc->conn->handle.qc, 0, frms); /* If there is frames left at this stage, transport layer is blocked. * Subscribe on it to retry later.