Skip to content

Commit 5a29fd6

Browse files
committed
MINOR: mux_quic/pacing: display pacing info on show quic
To improve debugging, extend "show quic" output to report if pacing is activated on a connection. Two values will be displayed for pacing : * a new counter paced_sent_ctr is defined in QCC structure. It will be incremented each time an emission is interrupted due to pacing. * pacing engine now saves the number of datagrams sent in the last paced emission. This will be helpful to ensure burst parameter is valid.
1 parent 24cea66 commit 5a29fd6

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

include/haproxy/mux_quic-t.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ struct qcc {
7171
uint64_t buf_in_flight; /* sum of currently allocated Tx buffer sizes */
7272
struct list frms; /* list of STREAM frames ready for sent */
7373
struct quic_pacer pacer; /* engine used to pace emission */
74+
int paced_sent_ctr; /* counter for when emission is interrupted due to pacing */
7475
} tx;
7576

7677
uint64_t largest_bidi_r; /* largest remote bidi stream ID opened. */

include/haproxy/quic_pacing-t.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
struct quic_pacer {
88
const struct quic_cc *cc; /* Congestion controler algo used for this connection */
99
ullong next; /* Nanosecond timestamp at which the next emission should be conducted */
10+
11+
int last_sent; /* Number of datagrams sent during last paced emission */
1012
};
1113

1214
#endif /* _HAPROXY_QUIC_PACING_T_H */

src/mux_quic.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,6 +2443,7 @@ static int qcc_io_send(struct qcc *qcc)
24432443
/* qcc_send_frames cannot return 1 if pacing not used. */
24442444
BUG_ON(!qcc_is_pacing_active(qcc->conn));
24452445
qcc_wakeup_pacing(qcc);
2446+
++qcc->tx.paced_sent_ctr;
24462447
}
24472448
else if (!LIST_ISEMPTY(&qcc->tx.frms)) {
24482449
/* Deallocate frames that the transport layer has rejected. */
@@ -2799,17 +2800,22 @@ static void qcc_purge_sending(struct qcc *qcc)
27992800
struct quic_pacer *pacer = &qcc->tx.pacer;
28002801
struct list *frms = &qcc->tx.frms;
28012802
enum quic_tx_err ret = QUIC_TX_ERR_PACING;
2803+
int sent = 0;
28022804

28032805
/* This function is reserved for pacing usage. */
28042806
BUG_ON(!qcc_is_pacing_active(qcc->conn));
28052807

28062808
/* Only restart emission if pacing delay is reached. */
2807-
if (quic_pacing_expired(pacer))
2809+
if (quic_pacing_expired(pacer)) {
28082810
ret = qc_send_mux(qcc->conn->handle.qc, frms, pacer);
2811+
sent = 1;
2812+
}
28092813

28102814
if (ret == QUIC_TX_ERR_PACING) {
28112815
BUG_ON(LIST_ISEMPTY(frms));
28122816
qcc_wakeup_pacing(qcc);
2817+
if (sent)
2818+
++qcc->tx.paced_sent_ctr;
28132819
}
28142820
else if (ret == QUIC_TX_ERR_FATAL) {
28152821
TRACE_DEVEL("error on sending", QMUX_EV_QCC_SEND, qcc->conn);
@@ -2960,8 +2966,10 @@ static int qmux_init(struct connection *conn, struct proxy *prx,
29602966

29612967
qcc->tx.buf_in_flight = 0;
29622968

2963-
if (qcc_is_pacing_active(conn))
2969+
if (qcc_is_pacing_active(conn)) {
29642970
quic_pacing_init(&qcc->tx.pacer, &conn->handle.qc->path->cc);
2971+
qcc->tx.paced_sent_ctr = 0;
2972+
}
29652973

29662974
if (conn_is_back(conn)) {
29672975
qcc->next_bidi_l = 0x00;
@@ -3594,6 +3602,12 @@ void qcc_show_quic(struct qcc *qcc)
35943602
qcc, qcc->flags, (ullong)qcc->nb_sc, (ullong)qcc->nb_hreq,
35953603
(ullong)qcc->tx.buf_in_flight, (ullong)qc->path->cwnd);
35963604

3605+
if (qcc_is_pacing_active(qcc->conn)) {
3606+
chunk_appendf(&trash, " pacing int_sent=%d last_sent=%d\n",
3607+
qcc->tx.paced_sent_ctr,
3608+
qcc->tx.pacer.last_sent);
3609+
}
3610+
35973611
node = eb64_first(&qcc->streams_by_id);
35983612
while (node) {
35993613
struct qcs *qcs = eb64_entry(node, struct qcs, by_id);

src/quic_pacing.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ int quic_pacing_expired(const struct quic_pacer *pacer)
1212
void quic_pacing_sent_done(struct quic_pacer *pacer, int sent)
1313
{
1414
pacer->next = now_mono_time() + pacer->cc->algo->pacing_rate(pacer->cc) * sent;
15+
pacer->last_sent = sent;
1516
}

0 commit comments

Comments
 (0)