From 01314b8b5367a08454a86262afe1311dbdb59706 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 24 Mar 2023 14:09:55 +0100 Subject: [PATCH] MINOR: quic: Implement cubic state trace callback 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/quic_cc_cubic.c b/src/quic_cc_cubic.c index 225bc1a..0654e42 100644 --- a/src/quic_cc_cubic.c +++ b/src/quic_cc_cubic.c @@ -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 = { -- 1.7.10.4