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.
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 @@
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 @@
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, "\n");
+ 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);
+
/* Streams */
node = eb64_first(&qc->streams_by_id);