From 8afe4b88c40559435a3a7f9a1d846dc891f936b9 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 21 Mar 2023 11:39:24 +0100 Subject: [PATCH] BUG/MINOR: quic: ignore congestion window on probing for MUX wakeup qc_notify_send() is used to wake up the MUX layer for sending. This function first ensures that all sending condition are met to avoid to wake up the MUX for unnecessarily. One of this condition is to check if there is room in the congestion window. However, when probe packets must be sent due to a PTO expiration, RFC 9002 explicitely mentions that the congestion window must be ignored which was not the case prior to this patch. This commit fixes this by first setting of 01RTT packet space before invoking qc_notify_send(). This ensures that congestion window won't be checked anymore to wake up the MUX layer until probing packets are sent. This commit replaces the following one which was not sufficient : commit e25fce03ebe3307bc104d1f81356108e271d2bc3 BUG/MINOR: quic: Dysfunctional 01RTT packet number space probing This should be backported up to 2.7. --- src/quic_conn.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/quic_conn.c b/src/quic_conn.c index 529e99777..f4a36f0e4 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -5188,6 +5188,7 @@ struct task *qc_process_timer(struct task *task, void *ctx, unsigned int state) } } else if (pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT]) { + pktns->tx.pto_probe = QUIC_MAX_NB_PTO_DGRAMS; /* Wake up upper layer if waiting to send new data. */ if (!qc_notify_send(qc)) { TRACE_STATE("needs to probe 01RTT packet number space", QUIC_EV_CONN_TXPKT, qc); @@ -8107,14 +8108,22 @@ void qc_notify_close(struct quic_conn *qc) TRACE_LEAVE(QUIC_EV_CONN_CLOSE, qc); } -/* Wake-up upper layer if waiting for send to be ready. +/* Wake-up upper layer for sending if all conditions are met : + * - room in congestion window or probe packet to sent + * - socket FD ready to sent or listener socket used * * Returns 1 if upper layer has been woken up else 0. */ int qc_notify_send(struct quic_conn *qc) { + const struct quic_pktns *pktns = &qc->pktns[QUIC_TLS_PKTNS_01RTT]; + if (qc->subs && qc->subs->events & SUB_RETRY_SEND) { - if (quic_path_prep_data(qc->path) && + /* RFC 9002 7.5. Probe Timeout + * + * Probe packets MUST NOT be blocked by the congestion controller. + */ + if ((quic_path_prep_data(qc->path) || pktns->tx.pto_probe) && (!qc_test_fd(qc) || !fd_send_active(qc->fd))) { tasklet_wakeup(qc->subs->tasklet); qc->subs->events &= ~SUB_RETRY_SEND;