mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 17:17:06 +02:00
MINOR: quic: Add new stats counter to diagnose RX buffer overrun
Remove the call to qc_list_all_rx_pkts() which print messages on stderr during RX buffer overruns and add a new counter for the number of dropped packets because of such events. Must be backported to 2.6
This commit is contained in:
parent
95a8dfb4c7
commit
45a16295e3
@ -10,6 +10,7 @@ extern struct stats_module quic_stats_module;
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
QUIC_ST_DROPPED_PACKET,
|
QUIC_ST_DROPPED_PACKET,
|
||||||
|
QUIC_ST_DROPPED_PACKET_BUFOVERRUN,
|
||||||
QUIC_ST_DROPPED_PARSING,
|
QUIC_ST_DROPPED_PARSING,
|
||||||
QUIC_ST_LOST_PACKET,
|
QUIC_ST_LOST_PACKET,
|
||||||
QUIC_ST_TOO_SHORT_INITIAL_DGRAM,
|
QUIC_ST_TOO_SHORT_INITIAL_DGRAM,
|
||||||
@ -49,6 +50,7 @@ enum {
|
|||||||
|
|
||||||
struct quic_counters {
|
struct quic_counters {
|
||||||
long long dropped_pkt; /* total number of dropped packets */
|
long long dropped_pkt; /* total number of dropped packets */
|
||||||
|
long long dropped_pkt_bufoverrun;/* total number of dropped packets because of buffer overrun */
|
||||||
long long dropped_parsing; /* total number of dropped packets upon parsing errors */
|
long long dropped_parsing; /* total number of dropped packets upon parsing errors */
|
||||||
long long lost_pkt; /* total number of lost packets */
|
long long lost_pkt; /* total number of lost packets */
|
||||||
long long too_short_initial_dgram; /* total number of too short datagrams with Initial packets */
|
long long too_short_initial_dgram; /* total number of too short datagrams with Initial packets */
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
static struct name_desc quic_stats[] = {
|
static struct name_desc quic_stats[] = {
|
||||||
[QUIC_ST_DROPPED_PACKET] = { .name = "quic_dropped_pkt",
|
[QUIC_ST_DROPPED_PACKET] = { .name = "quic_dropped_pkt",
|
||||||
.desc = "Total number of dropped packets" },
|
.desc = "Total number of dropped packets" },
|
||||||
|
[QUIC_ST_DROPPED_PACKET_BUFOVERRUN] = { .name = "quic_dropped_pkt_bufoverrun",
|
||||||
|
.desc = "Total number of dropped packets because of buffer overrun" },
|
||||||
[QUIC_ST_DROPPED_PARSING] = { .name = "quic_dropped_parsing_pkt",
|
[QUIC_ST_DROPPED_PARSING] = { .name = "quic_dropped_parsing_pkt",
|
||||||
.desc = "Total number of dropped packets upon parsing error" },
|
.desc = "Total number of dropped packets upon parsing error" },
|
||||||
[QUIC_ST_LOST_PACKET] = { .name = "quic_lost_pkt",
|
[QUIC_ST_LOST_PACKET] = { .name = "quic_lost_pkt",
|
||||||
@ -79,6 +81,7 @@ static void quic_fill_stats(void *data, struct field *stats)
|
|||||||
struct quic_counters *counters = data;
|
struct quic_counters *counters = data;
|
||||||
|
|
||||||
stats[QUIC_ST_DROPPED_PACKET] = mkf_u64(FN_COUNTER, counters->dropped_pkt);
|
stats[QUIC_ST_DROPPED_PACKET] = mkf_u64(FN_COUNTER, counters->dropped_pkt);
|
||||||
|
stats[QUIC_ST_DROPPED_PACKET_BUFOVERRUN] = mkf_u64(FN_COUNTER, counters->dropped_pkt_bufoverrun);
|
||||||
stats[QUIC_ST_DROPPED_PARSING] = mkf_u64(FN_COUNTER, counters->dropped_parsing);
|
stats[QUIC_ST_DROPPED_PARSING] = mkf_u64(FN_COUNTER, counters->dropped_parsing);
|
||||||
stats[QUIC_ST_LOST_PACKET] = mkf_u64(FN_COUNTER, counters->lost_pkt);
|
stats[QUIC_ST_LOST_PACKET] = mkf_u64(FN_COUNTER, counters->lost_pkt);
|
||||||
stats[QUIC_ST_TOO_SHORT_INITIAL_DGRAM] = mkf_u64(FN_COUNTER, counters->too_short_initial_dgram);
|
stats[QUIC_ST_TOO_SHORT_INITIAL_DGRAM] = mkf_u64(FN_COUNTER, counters->too_short_initial_dgram);
|
||||||
|
@ -5575,7 +5575,8 @@ static void qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end,
|
|||||||
if (b_tail(&qc->rx.buf) + b_cspace < b_wrap(&qc->rx.buf)) {
|
if (b_tail(&qc->rx.buf) + b_cspace < b_wrap(&qc->rx.buf)) {
|
||||||
TRACE_PROTO("Packet dropped",
|
TRACE_PROTO("Packet dropped",
|
||||||
QUIC_EV_CONN_LPKT, qc, NULL, NULL, qv);
|
QUIC_EV_CONN_LPKT, qc, NULL, NULL, qv);
|
||||||
goto drop;
|
HA_ATOMIC_INC(&prx_counters->dropped_pkt_bufoverrun);
|
||||||
|
goto drop_no_conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Let us consume the remaining contiguous space. */
|
/* Let us consume the remaining contiguous space. */
|
||||||
@ -5587,8 +5588,8 @@ static void qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end,
|
|||||||
if (b_contig_space(&qc->rx.buf) < pkt->len) {
|
if (b_contig_space(&qc->rx.buf) < pkt->len) {
|
||||||
TRACE_PROTO("Too big packet",
|
TRACE_PROTO("Too big packet",
|
||||||
QUIC_EV_CONN_LPKT, qc, pkt, &pkt->len, qv);
|
QUIC_EV_CONN_LPKT, qc, pkt, &pkt->len, qv);
|
||||||
qc_list_all_rx_pkts(qc);
|
HA_ATOMIC_INC(&prx_counters->dropped_pkt_bufoverrun);
|
||||||
goto drop;
|
goto drop_no_conn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user