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 <next_tel>
parameter when called from qc_dgrams_retransmit().
This commit is contained in:
Frédéric Lécaille 2022-04-25 10:33:12 +02:00 committed by Amaury Denoyelle
parent da342556c3
commit 7aef5f4c3f

View File

@ -3146,7 +3146,7 @@ static int qc_prep_pkts(struct quic_conn *qc, struct qring *qr,
* select the next level. * select the next level.
*/ */
if ((tel == QUIC_TLS_ENC_LEVEL_INITIAL || tel == QUIC_TLS_ENC_LEVEL_HANDSHAKE) && 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 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) if (tel == QUIC_TLS_ENC_LEVEL_HANDSHAKE && next_tel == tel)
next_tel = QUIC_TLS_ENC_LEVEL_APP; 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); 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)) if (!MT_LIST_ISEMPTY(&qel->rx.pqpkts) && qc_qel_may_rm_hp(qc, qel))
qc_rm_hp_pkts(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; qr = NULL;
st = qc->state; st = qc->state;
TRACE_PROTO("state", QUIC_EV_CONN_IO_CB, qc, &st); 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) { if (qc->flags & QUIC_FL_CONN_IO_CB_WAKEUP) {
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 /* The I/O handler has been woken up by the dgram listener