Skip to content

Commit d9fefc3

Browse files
committed
MINOR: quic: add counters of sent bytes with and without GSO
Add a sent bytes counter for each quic_conn instance. A secondary field which only account bytes sent via GSO which is useful to ensure if this is activated. For the moment, these counters are reported on "show quic" but not aggregated on proxy quic module stats.
1 parent ed09399 commit d9fefc3

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

include/haproxy/quic_conn-t.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ struct quic_conn_cntrs {
262262
long long socket_full; /* total number of EAGAIN errors on sendto() calls */
263263
long long sendto_err; /* total number of errors on sendto() calls, EAGAIN excepted */
264264
long long sendto_err_unknown; /* total number of errors on sendto() calls which are currently not supported */
265+
long long sent_bytes; /* total number of sent bytes, with or without GSO */
266+
long long sent_bytes_gso; /* total number of sent bytes using GSO */
265267
long long sent_pkt; /* total number of sent packets */
266268
long long lost_pkt; /* total number of lost packets */
267269
long long conn_migration_done; /* total number of connection migration handled */

src/quic_cli.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,14 @@ static void dump_quic_full(struct show_quic_ctx *ctx, struct quic_conn *qc)
300300
}
301301

302302
if (ctx->fields & QUIC_DUMP_FLD_CC) {
303-
chunk_appendf(&trash, " srtt=%-4u rttvar=%-4u rttmin=%-4u ptoc=%-4u cwnd=%-6llu"
304-
" mcwnd=%-6llu sentpkts=%-6llu lostpkts=%-6llu reorderedpkts=%-6llu\n",
303+
chunk_appendf(&trash, " srtt=%-4u rttvar=%-4u rttmin=%-4u ptoc=%-4u\n"
304+
" cwnd=%-6llu mcwnd=%-6llu\n"
305+
" sentbytes=%-12llu sentbytesgso=%-12llu sentpkts=%-6llu\n"
306+
" lostpkts=%-6llu reorderedpkts=%-6llu\n",
305307
qc->path->loss.srtt, qc->path->loss.rtt_var,
306308
qc->path->loss.rtt_min, qc->path->loss.pto_count, (ullong)qc->path->cwnd,
307-
(ullong)qc->path->mcwnd, (ullong)qc->cntrs.sent_pkt, (ullong)qc->path->loss.nb_lost_pkt, (ullong)qc->path->loss.nb_reordered_pkt);
309+
(ullong)qc->path->mcwnd, (ullong)qc->cntrs.sent_bytes, (ullong)qc->cntrs.sent_bytes_gso,
310+
(ullong)qc->cntrs.sent_pkt, (ullong)qc->path->loss.nb_lost_pkt, (ullong)qc->path->loss.nb_reordered_pkt);
308311
}
309312

310313
if (qc->cntrs.dropped_pkt) {

src/quic_tx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,11 @@ static int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx)
339339
skip_sendto = 1;
340340
TRACE_ERROR("sendto error, simulate sending for the rest of data", QUIC_EV_CONN_SPPKTS, qc);
341341
}
342+
else {
343+
qc->cntrs.sent_bytes += ret;
344+
if (gso && ret > gso)
345+
qc->cntrs.sent_bytes_gso += ret;
346+
}
342347
}
343348

344349
b_del(buf, dglen + QUIC_DGRAM_HEADLEN);

0 commit comments

Comments
 (0)