]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quid: Add traces quic_close() and quic_conn_io_cb()
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 11 Jan 2022 13:43:50 +0000 (14:43 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 11 Jan 2022 15:56:04 +0000 (16:56 +0100)
This is to have an idea of possible remaining issues regarding the
connection terminations.

include/haproxy/xprt_quic-t.h
src/xprt_quic.c

index 878e8bcad05390b83d2f162ded74080f219f2d14..06c43fe59b9c637e406a80c8af8275e775318b77 100644 (file)
@@ -216,6 +216,8 @@ enum quic_pkt_type {
 #define           QUIC_EV_CONN_BCFRMS    (1ULL << 36)
 #define           QUIC_EV_CONN_XPRTSEND  (1ULL << 37)
 #define           QUIC_EV_CONN_XPRTRECV  (1ULL << 38)
+#define           QUIC_EV_CONN_FREED     (1ULL << 39)
+#define           QUIC_EV_CONN_CLOSE     (1ULL << 40)
 
 /* Similar to kernel min()/max() definitions. */
 #define QUIC_MIN(a, b) ({ \
index e21f3e4c59456db54f9b1f4a3bbecae52550794c..d413b4eb1984c1cb09a7e9da260db25c92b61c33 100644 (file)
@@ -116,6 +116,8 @@ static const struct trace_event quic_trace_events[] = {
        { .mask = QUIC_EV_CONN_BCFRMS,   .name = "bcfrms",           .desc = "build CRYPTO data frames" },
        { .mask = QUIC_EV_CONN_XPRTSEND, .name = "xprt_send",        .desc = "sending XRPT subscription" },
        { .mask = QUIC_EV_CONN_XPRTRECV, .name = "xprt_recv",        .desc = "receiving XRPT subscription" },
+       { .mask = QUIC_EV_CONN_FREED,    .name = "conn_freed",       .desc = "releasing conn. memory" },
+       { .mask = QUIC_EV_CONN_CLOSE,    .name = "conn_close",       .desc = "closing conn." },
        { /* end */ }
 };
 
@@ -3120,9 +3122,10 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state)
 
        ctx = context;
        qc = ctx->qc;
+       TRACE_ENTER(QUIC_EV_CONN_HDSHK, qc);
        qr = NULL;
        st = HA_ATOMIC_LOAD(&qc->state);
-       TRACE_ENTER(QUIC_EV_CONN_HDSHK, qc, &st);
+       TRACE_PROTO("state", QUIC_EV_CONN_HDSHK, qc, &st);
        if (HA_ATOMIC_LOAD(&qc->flags) & QUIC_FL_CONN_IO_CB_WAKEUP) {
                HA_ATOMIC_BTR(&qc->flags, QUIC_FL_CONN_IO_CB_WAKEUP_BIT);
                /* The I/O handler has been woken up by the dgram listener
@@ -3337,6 +3340,7 @@ static void quic_conn_drop(struct quic_conn *qc)
 
        pool_free(pool_head_quic_conn_rxbuf, qc->rx.buf.area);
        pool_free(pool_head_quic_conn, qc);
+       TRACE_PROTO("QUIC conn. freed", QUIC_EV_CONN_FREED, qc);
 }
 
 void quic_close(struct connection *conn, void *xprt_ctx)
@@ -3344,6 +3348,7 @@ void quic_close(struct connection *conn, void *xprt_ctx)
        struct ssl_sock_ctx *conn_ctx = xprt_ctx;
        struct quic_conn *qc = conn_ctx->conn->qc;
 
+       TRACE_ENTER(QUIC_EV_CONN_CLOSE, qc);
        /* This task must be deleted by the connection-pinned thread. */
        if (qc->timer_task) {
                task_destroy(qc->timer_task);
@@ -3351,6 +3356,7 @@ void quic_close(struct connection *conn, void *xprt_ctx)
        }
 
        quic_conn_drop(qc);
+       TRACE_LEAVE(QUIC_EV_CONN_CLOSE, qc);
 }
 
 /* Callback called upon loss detection and PTO timer expirations. */