mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
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.
This commit is contained in:
parent
6c01b74ffa
commit
b823bb7f7f
@ -226,6 +226,7 @@ enum quic_pkt_type {
|
|||||||
#define QUIC_EV_CONN_FREED (1ULL << 39)
|
#define QUIC_EV_CONN_FREED (1ULL << 39)
|
||||||
#define QUIC_EV_CONN_CLOSE (1ULL << 40)
|
#define QUIC_EV_CONN_CLOSE (1ULL << 40)
|
||||||
#define QUIC_EV_CONN_ACKSTRM (1ULL << 41)
|
#define QUIC_EV_CONN_ACKSTRM (1ULL << 41)
|
||||||
|
#define QUIC_EV_CONN_FRMLIST (1ULL << 42)
|
||||||
|
|
||||||
/* Similar to kernel min()/max() definitions. */
|
/* Similar to kernel min()/max() definitions. */
|
||||||
#define QUIC_MIN(a, b) ({ \
|
#define QUIC_MIN(a, b) ({ \
|
||||||
|
@ -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_FREED, .name = "conn_freed", .desc = "releasing conn. memory" },
|
||||||
{ .mask = QUIC_EV_CONN_CLOSE, .name = "conn_close", .desc = "closing conn." },
|
{ .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_ACKSTRM, .name = "ack_strm", .desc = "STREAM ack."},
|
||||||
|
{ .mask = QUIC_EV_CONN_FRMLIST, .name = "frm_list", .desc = "frame list"},
|
||||||
{ /* end */ }
|
{ /* 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)) {
|
if (mask & (QUIC_EV_CONN_HPKT|QUIC_EV_CONN_PAPKT)) {
|
||||||
const struct quic_tx_packet *pkt = a2;
|
const struct quic_tx_packet *pkt = a2;
|
||||||
const struct quic_enc_level *qel = a3;
|
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)) {
|
if (!cc && !LIST_ISEMPTY(frms)) {
|
||||||
ssize_t room = end - pos;
|
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 <len>.
|
/* Initialize the length of the frames built below to <len>.
|
||||||
* If any frame could be successfully built by qc_build_frms(),
|
* If any frame could be successfully built by qc_build_frms(),
|
||||||
* we will have len_frms > len.
|
* 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;
|
pkt->len = pos - beg;
|
||||||
LIST_SPLICE(&pkt->frms, &frm_list);
|
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;
|
return 1;
|
||||||
|
|
||||||
no_room:
|
no_room:
|
||||||
/* Replace the pre-built frames which could not be add to this packet */
|
/* Replace the pre-built frames which could not be add to this packet */
|
||||||
LIST_SPLICE(frms, &frm_list);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user