]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: support pacing for newreno and nocc
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 21 Nov 2024 10:07:15 +0000 (11:07 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 21 Nov 2024 10:33:44 +0000 (11:33 +0100)
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.

include/haproxy/quic_cc-t.h
src/cfgparse-quic.c
src/quic_cc_cubic.c
src/quic_cc_newreno.c
src/quic_cc_nocc.c

index 173e0fb684e2d8254f4f944599125b78304c6d54..40ff8890995f1b9cfad4ea701884ce4219e2ef12 100644 (file)
@@ -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);
index 73e252e71f56a3339504bf83cadbadd3e1e7cea5..6c56be413235c91732d46815d2972d3767796456 100644 (file)
@@ -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);
                        }
index bc9410af9c5270a51a5dac91b97e87b56b1cb72b..a1768a151930d7eff7013753073ec61ba6dbcb5a 100644 (file)
@@ -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,
index 4d035b551132f33ca8a4c8bdcf732ea036e4bb4f..ec63bc3e8e680a9e4449514ebd532d5540564c97 100644 (file)
@@ -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,
index 6e5cff96b960022a405cfa48330a14123b81aef0..b4088521b969c7ce4b1b3f6d30030ef6c9e5fb36 100644 (file)
@@ -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,