From 999e3f9c00fc02de885a7a30680fbab01371b22f Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 23 Jan 2025 10:28:57 +0100 Subject: [PATCH] MINOR: quic: rename pacing_rate cb to pacing_inter Rename one of the congestion algorithms pacing callback from pacing_rate to pacing_inter. This better reflects that this function returns a delay (in nanoseconds) which should be applied between each packet emission to fill the congestion window with a perfectly smoothed emission. This should be backported up to 3.1. (cherry picked from commit 7c0820892f47642cfa27e49aa1218dfaf640e3b2) Signed-off-by: Christopher Faulet --- include/haproxy/quic_cc-t.h | 2 +- include/haproxy/quic_cc.h | 2 +- src/cfgparse-quic.c | 2 +- src/mux_quic.c | 2 +- src/quic_cc.c | 4 ++-- src/quic_cc_bbr.c | 4 ++-- src/quic_pacing.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/haproxy/quic_cc-t.h b/include/haproxy/quic_cc-t.h index 670c4f5..d653150 100644 --- a/include/haproxy/quic_cc-t.h +++ b/include/haproxy/quic_cc-t.h @@ -140,7 +140,7 @@ struct quic_cc_algo { void (*hystart_start_round)(struct quic_cc *cc, uint64_t pn); /* Defined only if pacing is used. */ - uint (*pacing_rate)(const struct quic_cc *cc); + uint (*pacing_inter)(const struct quic_cc *cc); uint (*pacing_burst)(const struct quic_cc *cc); struct quic_cc_drs *(*get_drs)(struct quic_cc *cc); diff --git a/include/haproxy/quic_cc.h b/include/haproxy/quic_cc.h index c07bb73..b16996d 100644 --- a/include/haproxy/quic_cc.h +++ b/include/haproxy/quic_cc.h @@ -38,7 +38,7 @@ void quic_cc_event(struct quic_cc *cc, struct quic_cc_event *ev); void quic_cc_state_trace(struct buffer *buf, const struct quic_cc *cc); /* Pacing callbacks */ -uint quic_cc_default_pacing_rate(const struct quic_cc *cc); +uint quic_cc_default_pacing_inter(const struct quic_cc *cc); uint quic_cc_default_pacing_burst(const struct quic_cc *cc); static inline const char *quic_cc_state_str(enum quic_cc_algo_state_type state) diff --git a/src/cfgparse-quic.c b/src/cfgparse-quic.c index 054854d..cbc1ae8 100644 --- a/src/cfgparse-quic.c +++ b/src/cfgparse-quic.c @@ -203,7 +203,7 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px, } conf->quic_pacing_burst = burst; - cc_algo->pacing_rate = quic_cc_default_pacing_rate; + cc_algo->pacing_inter = quic_cc_default_pacing_inter; cc_algo->pacing_burst = quic_cc_default_pacing_burst; } diff --git a/src/mux_quic.c b/src/mux_quic.c index 088e071..81f29be 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -41,7 +41,7 @@ static void qmux_ctrl_room(struct qc_stream_desc *, uint64_t room); static int qcc_is_pacing_active(const struct connection *conn) { const struct quic_conn *qc = conn->handle.qc; - return !!(qc->path->cc.algo->pacing_rate); + return !!(qc->path->cc.algo->pacing_inter); } static void qcs_free_ncbuf(struct qcs *qcs, struct ncbuf *ncbuf) diff --git a/src/quic_cc.c b/src/quic_cc.c index f3f86e3..603914c 100644 --- a/src/quic_cc.c +++ b/src/quic_cc.c @@ -50,8 +50,8 @@ void quic_cc_state_trace(struct buffer *buf, const struct quic_cc *cc) cc->algo->state_trace(buf, cc); } -/* Return rate in nanoseconds between each datagram emission for a smooth pacing. */ -uint quic_cc_default_pacing_rate(const struct quic_cc *cc) +/* Return interval in nanoseconds between each datagram emission for a smooth pacing. */ +uint quic_cc_default_pacing_inter(const struct quic_cc *cc) { struct quic_cc_path *path = container_of(cc, struct quic_cc_path, cc); return path->loss.srtt * 1000000 / (path->cwnd / path->mtu + 1); diff --git a/src/quic_cc_bbr.c b/src/quic_cc_bbr.c index 9887792..f1e4262 100644 --- a/src/quic_cc_bbr.c +++ b/src/quic_cc_bbr.c @@ -1457,7 +1457,7 @@ struct quic_cc_drs *bbr_get_drs(struct quic_cc *cc) } /* Return the pacing delay between bursts of packets in nanoseconds. */ -uint bbr_pacing_rate(const struct quic_cc *cc) +uint bbr_pacing_inter(const struct quic_cc *cc) { struct bbr *bbr = quic_cc_priv(cc); struct quic_cc_path *p = container_of(cc, struct quic_cc_path, cc); @@ -1526,7 +1526,7 @@ static void bbr_state_cli(struct buffer *buf, const struct quic_cc_path *p) struct quic_cc_algo quic_cc_algo_bbr = { .type = QUIC_CC_ALGO_TP_BBR, .init = bbr_init, - .pacing_rate = bbr_pacing_rate, + .pacing_inter = bbr_pacing_inter, .pacing_burst = bbr_pacing_burst, .get_drs = bbr_get_drs, .on_transmit = bbr_on_transmit, diff --git a/src/quic_pacing.c b/src/quic_pacing.c index 9dfa352..1921685 100644 --- a/src/quic_pacing.c +++ b/src/quic_pacing.c @@ -12,6 +12,6 @@ int quic_pacing_expired(const struct quic_pacer *pacer) /* Notify about an emission of count of datagrams. */ void quic_pacing_sent_done(struct quic_pacer *pacer, int sent) { - pacer->next = task_mono_time() + pacer->cc->algo->pacing_rate(pacer->cc) * sent; + pacer->next = task_mono_time() + pacer->cc->algo->pacing_inter(pacer->cc) * sent; pacer->last_sent = sent; } -- 1.7.10.4