]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Implement cubic state trace callback
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 24 Mar 2023 13:09:55 +0000 (14:09 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Fri, 31 Mar 2023 07:54:59 +0000 (09:54 +0200)
This callback was left as not implemented. It should at least display
the algorithm state, the control congestion window the slow start threshold
and the time of the current recovery period. Should be helpful to debug.

Must be backported to 2.7.

src/quic_cc_cubic.c

index 225bc1a17c715bafe7330fd551a07ad043239145..0654e42cec318bab673db1555fd78d7a11070585 100644 (file)
@@ -288,6 +288,16 @@ static void quic_cc_cubic_event(struct quic_cc *cc, struct quic_cc_event *ev)
 
 static void quic_cc_cubic_state_trace(struct buffer *buf, const struct quic_cc *cc)
 {
+       struct quic_path *path;
+       struct cubic *c = quic_cc_priv(cc);
+
+       path = container_of(cc, struct quic_path, cc);
+       chunk_appendf(buf, " state=%s cwnd=%llu ssthresh=%d rpst=%dms",
+                     quic_cc_state_str(cc->algo->state),
+                     (unsigned long long)path->cwnd,
+                     (int)c->ssthresh,
+                     !tick_isset(c->recovery_start_time) ? -1 :
+                     TICKS_TO_MS(tick_remain(c->recovery_start_time, now_ms)));
 }
 
 struct quic_cc_algo quic_cc_algo_cubic = {