From: Frédéric Lécaille Date: Tue, 11 Jan 2022 13:43:50 +0000 (+0100) Subject: MINOR: quid: Add traces quic_close() and quic_conn_io_cb() X-Git-Tag: v2.6-dev1~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba85acdc70116bfa5cc7046b8f7fe572ccffffc8;p=thirdparty%2Fhaproxy.git MINOR: quid: Add traces quic_close() and quic_conn_io_cb() This is to have an idea of possible remaining issues regarding the connection terminations. --- diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h index 878e8bcad0..06c43fe59b 100644 --- a/include/haproxy/xprt_quic-t.h +++ b/include/haproxy/xprt_quic-t.h @@ -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) ({ \ diff --git a/src/xprt_quic.c b/src/xprt_quic.c index e21f3e4c59..d413b4eb19 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -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. */