]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Move traces about RX/TX bytes from QUIC_EV_CONN_PRSAFRM event
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 30 Aug 2022 13:25:47 +0000 (15:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 31 Aug 2022 13:20:24 +0000 (15:20 +0200)
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.

src/xprt_quic.c

index bd2153e235b636071ae58c699dbc3110301f79ea..399b3e38f14c935a034e2aa724da51e7beb54b88 100644 (file)
@@ -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