From a3772e1134177e5117d1494afe7a4f31ecb089da Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Tue, 21 Mar 2023 13:42:43 +0100 Subject: [PATCH] MINOR: quic: Add recovery related information to "show quic" Add ->srtt, ->rtt_var, ->rtt_min and ->pto_count values from ->path->loss struct to "show quic". Same thing for ->cwnd from ->path struct. Also take the opportunity of this patch to dump the packet number space information directly from ->pktns[] array in place of ->els[] array. Indeed, ->els[QUIC_TLS_ENC_LEVEL_EARLY_DATA] and ->els[QUIC_TLS_ENC_LEVEL_APP] have the same packet number space. Must be backported to 2.7 where "show quic" implementation has alredy been backported. --- src/quic_conn.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/quic_conn.c b/src/quic_conn.c index e512490..60c8f7c 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -8179,7 +8179,7 @@ static int cli_io_handler_dump_quic(struct appctx *appctx) struct show_quic_ctx *ctx = appctx->svcctx; struct stconn *sc = appctx_sc(appctx); struct quic_conn *qc; - struct quic_enc_level *qel; + struct quic_pktns *pktns; struct eb64_node *node; struct qc_stream_desc *stream; char bufaddr[INET6_ADDRSTRLEN], bufport[6]; @@ -8307,21 +8307,21 @@ static int cli_io_handler_dump_quic(struct appctx *appctx) chunk_appendf(&trash, "\n"); - /* Encryption levels */ - qel = &qc->els[QUIC_TLS_ENC_LEVEL_INITIAL]; + /* Packet number spaces information */ + pktns = &qc->pktns[QUIC_TLS_PKTNS_INITIAL]; chunk_appendf(&trash, " [initl] rx.ackrng=%-6zu tx.inflight=%-6zu", - qel->pktns->rx.arngs.sz, qel->pktns->tx.in_flight); - qel = &qc->els[QUIC_TLS_ENC_LEVEL_HANDSHAKE]; + pktns->rx.arngs.sz, pktns->tx.in_flight); + pktns = &qc->pktns[QUIC_TLS_PKTNS_HANDSHAKE]; chunk_appendf(&trash, " [hndshk] rx.ackrng=%-6zu tx.inflight=%-6zu\n", - qel->pktns->rx.arngs.sz, qel->pktns->tx.in_flight); - qel = &qc->els[QUIC_TLS_ENC_LEVEL_EARLY_DATA]; - chunk_appendf(&trash, " [0-rtt] rx.ackrng=%-6zu tx.inflight=%-6zu", - qel->pktns->rx.arngs.sz, qel->pktns->tx.in_flight); - qel = &qc->els[QUIC_TLS_ENC_LEVEL_APP]; - chunk_appendf(&trash, " [1-rtt] rx.ackrng=%-6zu tx.inflight=%-6zu", - qel->pktns->rx.arngs.sz, qel->pktns->tx.in_flight); + pktns->rx.arngs.sz, pktns->tx.in_flight); + pktns = &qc->pktns[QUIC_TLS_PKTNS_01RTT]; + chunk_appendf(&trash, " [01rtt] rx.ackrng=%-6zu tx.inflight=%-6zu\n", + pktns->rx.arngs.sz, pktns->tx.in_flight); + + chunk_appendf(&trash, " srtt=%-4u rttvar=%-4u rttmin=%-4u ptoc=%-4u cwnd=%-6zu\n", + qc->path->loss.srtt >> 3, qc->path->loss.rtt_var >> 2, + qc->path->loss.rtt_min, qc->path->loss.pto_count, qc->path->cwnd); - chunk_appendf(&trash, "\n"); /* Streams */ node = eb64_first(&qc->streams_by_id); -- 1.7.10.4