From: Frédéric Lécaille Date: Thu, 31 Mar 2022 18:26:18 +0000 (+0200) Subject: MINOR: quic: Add traces about list of frames X-Git-Tag: v2.6-dev5~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b823bb7f7fe42b9080e35ba7f859a807a626a9b1;p=thirdparty%2Fhaproxy.git MINOR: quic: Add traces about list of frames This should be useful to have an idea of the list of frames which could be built towards the list of available frames when building packets. Same thing about the frames which could not be built because of a lack of room in the TX buffer. --- diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h index 9cb163ae9c..e72ad6a74e 100644 --- a/include/haproxy/xprt_quic-t.h +++ b/include/haproxy/xprt_quic-t.h @@ -226,6 +226,7 @@ enum quic_pkt_type { #define QUIC_EV_CONN_FREED (1ULL << 39) #define QUIC_EV_CONN_CLOSE (1ULL << 40) #define QUIC_EV_CONN_ACKSTRM (1ULL << 41) +#define QUIC_EV_CONN_FRMLIST (1ULL << 42) /* Similar to kernel min()/max() definitions. */ #define QUIC_MIN(a, b) ({ \ diff --git a/src/xprt_quic.c b/src/xprt_quic.c index bc96b3c573..37d6d15f86 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -121,6 +121,7 @@ static const struct trace_event quic_trace_events[] = { { .mask = QUIC_EV_CONN_FREED, .name = "conn_freed", .desc = "releasing conn. memory" }, { .mask = QUIC_EV_CONN_CLOSE, .name = "conn_close", .desc = "closing conn." }, { .mask = QUIC_EV_CONN_ACKSTRM, .name = "ack_strm", .desc = "STREAM ack."}, + { .mask = QUIC_EV_CONN_FRMLIST, .name = "frm_list", .desc = "frame list"}, { /* end */ } }; @@ -286,6 +287,16 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace } + if (mask & QUIC_EV_CONN_FRMLIST) { + const struct list *l = a2; + + if (l) { + const struct quic_frame *frm; + list_for_each_entry(frm, l, list) + chunk_frm_appendf(&trace_buf, frm); + } + } + if (mask & (QUIC_EV_CONN_HPKT|QUIC_EV_CONN_PAPKT)) { const struct quic_tx_packet *pkt = a2; const struct quic_enc_level *qel = a3; @@ -5293,6 +5304,7 @@ static int qc_do_build_pkt(unsigned char *pos, const unsigned char *end, if (!cc && !LIST_ISEMPTY(frms)) { ssize_t room = end - pos; + TRACE_PROTO("Avail. ack eliciting frames", QUIC_EV_CONN_FRMLIST, qc, frms); /* Initialize the length of the frames built below to . * If any frame could be successfully built by qc_build_frms(), * we will have len_frms > len. @@ -5419,14 +5431,15 @@ static int qc_do_build_pkt(unsigned char *pos, const unsigned char *end, pkt->len = pos - beg; LIST_SPLICE(&pkt->frms, &frm_list); - TRACE_PROTO("Ack eliciting frame", QUIC_EV_CONN_HPKT, qc, pkt); + TRACE_PROTO("Packet ack-eliciting frames", QUIC_EV_CONN_HPKT, qc, pkt); return 1; no_room: /* Replace the pre-built frames which could not be add to this packet */ LIST_SPLICE(frms, &frm_list); - TRACE_PROTO("Not enough room", QUIC_EV_CONN_HPKT, qc); + TRACE_PROTO("Remaining ack-eliciting frames", QUIC_EV_CONN_HPKT, qc, pkt); + return 0; }