MINOR: quic: Add missing traces in cubic algorithm implementation
May be useful to debug.
Must be backported to 2.7 and 2.6.
diff --git a/src/quic_cc_cubic.c b/src/quic_cc_cubic.c
index e91b766..e04cd3e 100644
--- a/src/quic_cc_cubic.c
+++ b/src/quic_cc_cubic.c
@@ -38,6 +38,7 @@
{
struct cubic *c = quic_cc_priv(cc);
+ TRACE_ENTER(QUIC_EV_CONN_CC, cc->qc);
cc->algo->state = QUIC_CC_ST_SS;
c->ssthresh = QUIC_CC_INFINITE_SSTHESH;
@@ -49,6 +50,7 @@
c->last_w_max = 0;
c->tcp_wnd = 0;
c->recovery_start_time = 0;
+ TRACE_LEAVE(QUIC_EV_CONN_CC, cc->qc);
}
static int quic_cc_cubic_init(struct quic_cc *cc)
@@ -100,6 +102,7 @@
uint32_t t, target, inc, inc_diff;
uint64_t delta, diff;
+ TRACE_ENTER(QUIC_EV_CONN_CC, cc->qc);
if (!c->epoch_start) {
c->epoch_start = now_ms;
if (c->last_w_max <= path->cwnd) {
@@ -133,7 +136,7 @@
* control algorithm reset.
*/
quic_cc_cubic_reset(cc);
- return;
+ goto leave;
}
delta = path->mtu * ((CUBIC_C * diff * diff * diff) >> (10 + 3 * TIME_SCALE_FACTOR_SHIFT));
@@ -165,11 +168,15 @@
}
path->cwnd += inc;
+ leave:
+ TRACE_LEAVE(QUIC_EV_CONN_CC, cc->qc);
}
static void quic_cc_cubic_slow_start(struct quic_cc *cc)
{
+ TRACE_ENTER(QUIC_EV_CONN_CC, cc->qc);
quic_cc_cubic_reset(cc);
+ TRACE_LEAVE(QUIC_EV_CONN_CC, cc->qc);
}
static void quic_enter_recovery(struct quic_cc *cc)
@@ -178,6 +185,7 @@
struct cubic *c = quic_cc_priv(cc);
/* Current cwnd as number of packets */
+ TRACE_ENTER(QUIC_EV_CONN_CC, cc->qc);
c->epoch_start = 0;
c->recovery_start_time = now_ms;
/* Fast convergence */
@@ -191,6 +199,7 @@
path->cwnd = (CUBIC_BETA * path->cwnd) >> CUBIC_BETA_SCALE_SHIFT;
c->ssthresh = QUIC_MAX(path->cwnd, path->min_cwnd);
cc->algo->state = QUIC_CC_ST_RP;
+ TRACE_LEAVE(QUIC_EV_CONN_CC, cc->qc, NULL, cc);
}
/* Congestion slow-start callback. */
@@ -252,7 +261,7 @@
struct cubic *c = quic_cc_priv(cc);
TRACE_ENTER(QUIC_EV_CONN_CC, cc->qc, ev);
- TRACE_PROTO("CC cubic", QUIC_EV_CONN_CC, cc->qc, ev);
+ TRACE_PROTO("CC cubic", QUIC_EV_CONN_CC, cc->qc, ev, cc);
BUG_ON(!tick_isset(c->recovery_start_time));