Skip to content

Commit 34bc100

Browse files
haproxyFreda-denoyelle
authored andcommitted
MINOR: quic: Add traces to debug frames handling during retransmissions
This is really boring to not know why some retransmissions could not be done from qc_prep_hpkts() which allocates frames, prepare packets and send them. Especially to not know about if frames are not remaining allocated and attached to list on the stack. This patch already helped in diagnosing such an issue during "-dMfail" tests.
1 parent 8f9e94e commit 34bc100

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/quic_tx.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,14 @@ static inline void qc_free_frm_list(struct quic_conn *qc, struct list *l)
545545
{
546546
struct quic_frame *frm, *frmbak;
547547

548+
TRACE_ENTER(QUIC_EV_CONN_TXPKT, qc);
549+
548550
list_for_each_entry_safe(frm, frmbak, l, list) {
549551
LIST_DEL_INIT(&frm->ref);
550552
qc_frm_free(qc, &frm);
551553
}
554+
555+
TRACE_LEAVE(QUIC_EV_CONN_TXPKT, qc);
552556
}
553557

554558
/* Free <pkt> TX packet and all the packets coalesced to it. */
@@ -557,11 +561,15 @@ static inline void qc_free_tx_coalesced_pkts(struct quic_conn *qc,
557561
{
558562
struct quic_tx_packet *pkt, *nxt_pkt;
559563

564+
TRACE_ENTER(QUIC_EV_CONN_TXPKT, qc);
565+
560566
for (pkt = p; pkt; pkt = nxt_pkt) {
561567
qc_free_frm_list(qc, &pkt->frms);
562568
nxt_pkt = pkt->next;
563569
pool_free(pool_head_quic_tx_packet, pkt);
564570
}
571+
572+
TRACE_LEAVE(QUIC_EV_CONN_TXPKT, qc);
565573
}
566574

567575
/* Purge <buf> TX buffer from its prepare packets. */
@@ -1232,8 +1240,10 @@ int qc_send_hdshk_pkts(struct quic_conn *qc, int old_data,
12321240
goto leave;
12331241
}
12341242

1235-
if (b_data(buf) && !qc_purge_txbuf(qc, buf))
1243+
if (b_data(buf) && !qc_purge_txbuf(qc, buf)) {
1244+
TRACE_ERROR("Could not purge TX buffer", QUIC_EV_CONN_TXPKT, qc);
12361245
goto out;
1246+
}
12371247

12381248
/* Currently buf cannot be non-empty at this stage. Even if a previous
12391249
* sendto() has failed it is emptied to simulate packet emission and
@@ -1260,12 +1270,14 @@ int qc_send_hdshk_pkts(struct quic_conn *qc, int old_data,
12601270
ret = qc_prep_hpkts(qc, buf, &qels);
12611271
if (ret == -1) {
12621272
qc_txb_release(qc);
1273+
TRACE_ERROR("Could not build some packets", QUIC_EV_CONN_TXPKT, qc);
12631274
goto out;
12641275
}
12651276

12661277
if (ret && !qc_send_ppkts(buf, qc->xprt_ctx)) {
12671278
if (qc->flags & QUIC_FL_CONN_TO_KILL)
12681279
qc_txb_release(qc);
1280+
TRACE_ERROR("Could not send some packets", QUIC_EV_CONN_TXPKT, qc);
12691281
goto out;
12701282
}
12711283

0 commit comments

Comments
 (0)