From: Amaury Denoyelle Date: Thu, 21 Nov 2024 10:07:15 +0000 (+0100) Subject: MINOR: quic: support pacing for newreno and nocc X-Git-Tag: v3.1-dev14~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95d3edd68fb3681a5b1d48d023b4e55e3ac56390;p=thirdparty%2Fhaproxy.git MINOR: quic: support pacing for newreno and nocc Extend extra pacing support for newreno and nocc congestion algorithms, as with cubic. For better extensibility of cc algo definition, define a new flags field in quic_cc_algo structure. For now, the only value is QUIC_CC_ALGO_FL_OPT_PACING which is set if pacing support can be optionally activated. Both cubic, newreno and nocc now supports this. This new flag is then reused by QUIC config parser. If set, extra quic-cc-algo burst parameter is taken into account. If positive, this will activate pacing support on top of the congestion algorithm. As with cubic previously, pacing is only supported if running under experimental mode. Only BBR is not flagged with this new value as pacing is directly builtin in the algorithm and cannot be turn off. Furthermore, BBR calculates automatically its value for maximum burst. As such, any quic-cc-algo burst argument used with BBR is still ignored with a warning. --- diff --git a/include/haproxy/quic_cc-t.h b/include/haproxy/quic_cc-t.h index 173e0fb684..40ff889099 100644 --- a/include/haproxy/quic_cc-t.h +++ b/include/haproxy/quic_cc-t.h @@ -125,8 +125,13 @@ struct quic_cc_path { uint32_t recovery_start_ts; }; +/* pacing can be optionnaly activated on top of the algorithm */ +#define QUIC_CC_ALGO_FL_OPT_PACING 0x01 + struct quic_cc_algo { enum quic_cc_algo_type type; + int flags; /* QUIC_CC_ALGO_FL_* */ + int (*init)(struct quic_cc *cc); void (*event)(struct quic_cc *cc, struct quic_cc_event *ev); void (*slow_start)(struct quic_cc *cc); diff --git a/src/cfgparse-quic.c b/src/cfgparse-quic.c index 73e252e71f..6c56be4132 100644 --- a/src/cfgparse-quic.c +++ b/src/cfgparse-quic.c @@ -188,7 +188,7 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px, if (burst < 0) goto fail; - if (cc_algo->type != QUIC_CC_ALGO_TP_CUBIC) { + if (!(cc_algo->flags & QUIC_CC_ALGO_FL_OPT_PACING)) { ha_warning("'%s' : burst parameter ignored for '%s' congestion algorithm\n", args[cur_arg], algo); } diff --git a/src/quic_cc_cubic.c b/src/quic_cc_cubic.c index bc9410af9c..a1768a1519 100644 --- a/src/quic_cc_cubic.c +++ b/src/quic_cc_cubic.c @@ -674,6 +674,7 @@ static void quic_cc_cubic_state_cli(struct buffer *buf, const struct quic_cc_pat struct quic_cc_algo quic_cc_algo_cubic = { .type = QUIC_CC_ALGO_TP_CUBIC, + .flags = QUIC_CC_ALGO_FL_OPT_PACING, .init = quic_cc_cubic_init, .event = quic_cc_cubic_event, .slow_start = quic_cc_cubic_slow_start, diff --git a/src/quic_cc_newreno.c b/src/quic_cc_newreno.c index 4d035b5511..ec63bc3e8e 100644 --- a/src/quic_cc_newreno.c +++ b/src/quic_cc_newreno.c @@ -216,6 +216,7 @@ static void quic_cc_nr_event(struct quic_cc *cc, struct quic_cc_event *ev) struct quic_cc_algo quic_cc_algo_nr = { .type = QUIC_CC_ALGO_TP_NEWRENO, + .flags = QUIC_CC_ALGO_FL_OPT_PACING, .init = quic_cc_nr_init, .event = quic_cc_nr_event, .slow_start = quic_cc_nr_slow_start, diff --git a/src/quic_cc_nocc.c b/src/quic_cc_nocc.c index 6e5cff96b9..b4088521b9 100644 --- a/src/quic_cc_nocc.c +++ b/src/quic_cc_nocc.c @@ -68,6 +68,7 @@ static void quic_cc_nocc_event(struct quic_cc *cc, struct quic_cc_event *ev) struct quic_cc_algo quic_cc_algo_nocc = { .type = QUIC_CC_ALGO_TP_NOCC, + .flags = QUIC_CC_ALGO_FL_OPT_PACING, .init = quic_cc_nocc_init, .event = quic_cc_nocc_event, .slow_start = quic_cc_nocc_slow_start,