From: Frédéric Lécaille Date: Tue, 30 Aug 2022 13:25:47 +0000 (+0200) Subject: MINOR: quic: Move traces about RX/TX bytes from QUIC_EV_CONN_PRSAFRM event X-Git-Tag: v2.7-dev5~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a9b94495573b7c87fcc32864d748b0ba33d9f3d;p=thirdparty%2Fhaproxy.git MINOR: quic: Move traces about RX/TX bytes from QUIC_EV_CONN_PRSAFRM event Move these traces to QUIC_EV_CONN_SPPKTS trace event. They were displayed at a useless location. Make them displayed just after having sent a packet and when checking the anti-amplication limit. Useful to diagnose issues in relation with the recovery. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index bd2153e235..399b3e38f1 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -366,9 +366,6 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace chunk_appendf(&trace_buf, " pn=%llu",(ull)pkt->pn_node.key); list_for_each_entry(frm, &pkt->frms, list) chunk_frm_appendf(&trace_buf, frm); - chunk_appendf(&trace_buf, " rx.bytes=%llu tx.bytes=%llu", - (unsigned long long)qc->rx.bytes, - (unsigned long long)qc->tx.bytes); } if (room) { @@ -612,6 +609,9 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace pkt->pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL] ? "I" : pkt->pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT] ? "01RTT": "H", (unsigned long long)pkt->in_flight_len); + chunk_appendf(&trace_buf, " rx.bytes=%llu tx.bytes=%llu", + (unsigned long long)qc->rx.bytes, + (unsigned long long)qc->tx.bytes); } } @@ -2409,18 +2409,18 @@ static void qc_prep_fast_retrans(struct quic_conn *qc, */ if (!quic_peer_validated_addr(qc) && qc_is_listener(qc) && pkt->len + 4 > 3 * qc->rx.bytes - qc->tx.prep_bytes) { - TRACE_PROTO("anti-amplification limit would be reached", QUIC_EV_CONN_PRSAFRM, qc); + TRACE_PROTO("anti-amplification limit would be reached", QUIC_EV_CONN_SPPKTS, qc, pkt); goto leave; } - TRACE_DEVEL("duplicating packet", QUIC_EV_CONN_PRSAFRM, qc, NULL, &pkt->pn_node.key); + TRACE_DEVEL("duplicating packet", QUIC_EV_CONN_SPPKTS, qc, pkt); qc_dup_pkt_frms(qc, &pkt->frms, frms); if (frms == frms1 && frms2) { frms = frms2; goto start; } leave: - TRACE_LEAVE(QUIC_EV_CONN_PRSAFRM, qc); + TRACE_LEAVE(QUIC_EV_CONN_SPPKTS, qc); } /* Prepare a fast retransmission during a handshake after a client