]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: display infos about various encryption level on "show quic"
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 1 Feb 2023 16:05:10 +0000 (17:05 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 9 Feb 2023 17:14:40 +0000 (18:14 +0100)
Complete "show quic" handler by displaying various information related
to each encryption level and packet number space. Most notably, ack
ranges and bytes in flight are present to help debug retransmission
issues.

This should be backported up to 2.7.

src/quic_conn.c

index 5e383979c9e19a69267e1995a4ed2dde920dde1a..94a7cfaff1a8c44b0525b38fb78e69e7769e904f 100644 (file)
@@ -7646,6 +7646,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;
        char bufaddr[INET6_ADDRSTRLEN], bufport[6];
        int expire;
        unsigned char cid_len;
@@ -7748,6 +7749,22 @@ static int cli_io_handler_dump_quic(struct appctx *appctx)
 
                chunk_appendf(&trash, "\n");
 
+               /* Encryption levels */
+               qel = &qc->els[QUIC_TLS_ENC_LEVEL_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];
+               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);
+
+               chunk_appendf(&trash, "\n");
+
                if (applet_putchk(appctx, &trash) == -1) {
                        /* Register show_quic_ctx to quic_conn instance. */
                        LIST_APPEND(&qc->back_refs, &ctx->bref.users);