From 7aef5f4c3f339c66dfc6f640eb031d7593076ca0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 25 Apr 2022 10:33:12 +0200 Subject: [PATCH] MEDIUM: quic: Enable the new datagram probing process Make the two I/O handlers quic_conn_io_cb() and quic_conn_app_io_cb() call qc_dgrams_retransmit() after probing retransmissions need was detected by the timer task (qc_process_timer()). We must modify qc_prep_pkts() to support QUIC_TLS_ENC_LEVEL_NONE as parameter when called from qc_dgrams_retransmit(). --- src/xprt_quic.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 57f9942..66ee198 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -3146,7 +3146,7 @@ static int qc_prep_pkts(struct quic_conn *qc, struct qring *qr, * select the next level. */ if ((tel == QUIC_TLS_ENC_LEVEL_INITIAL || tel == QUIC_TLS_ENC_LEVEL_HANDSHAKE) && - (LIST_ISEMPTY(frms) && !qel->pktns->tx.pto_probe)) { + next_tel != QUIC_TLS_ENC_LEVEL_NONE && (LIST_ISEMPTY(frms) && !qel->pktns->tx.pto_probe)) { /* If QUIC_TLS_ENC_LEVEL_HANDSHAKE was already reached let's try QUIC_TLS_ENC_LEVEL_APP */ if (tel == QUIC_TLS_ENC_LEVEL_HANDSHAKE && next_tel == tel) next_tel = QUIC_TLS_ENC_LEVEL_APP; @@ -3904,6 +3904,13 @@ static struct task *quic_conn_app_io_cb(struct task *t, void *context, unsigned TRACE_PROTO("state", QUIC_EV_CONN_IO_CB, qc, &qc->state); + /* Retranmissions */ + if (qc->flags & QUIC_FL_CONN_RETRANS_NEEDED) { + TRACE_PROTO("retransmission needed", QUIC_EV_CONN_IO_CB, qc); + qc->flags &= ~QUIC_FL_CONN_RETRANS_NEEDED; + qc_dgrams_retransmit(qc); + } + if (!MT_LIST_ISEMPTY(&qel->rx.pqpkts) && qc_qel_may_rm_hp(qc, qel)) qc_rm_hp_pkts(qc, qel); @@ -3942,6 +3949,14 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state) qr = NULL; st = qc->state; TRACE_PROTO("state", QUIC_EV_CONN_IO_CB, qc, &st); + + /* Retranmissions */ + if (qc->flags & QUIC_FL_CONN_RETRANS_NEEDED) { + TRACE_PROTO("retransmission needed", QUIC_EV_CONN_PHPKTS, qc); + qc->flags &= ~QUIC_FL_CONN_RETRANS_NEEDED; + qc_dgrams_retransmit(qc); + } + if (qc->flags & QUIC_FL_CONN_IO_CB_WAKEUP) { qc->flags &= ~QUIC_FL_CONN_IO_CB_WAKEUP; /* The I/O handler has been woken up by the dgram listener -- 1.7.10.4