From 349954601f5d13351f0ed4a6bfbdd90de01717ab Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Tue, 29 Oct 2024 19:08:06 +0100 Subject: [PATCH] MINOR: quic: add "bbr" new "quic-cc-algo" option Add this new "bbr" option to the list of the congestion control algorithms which may be set by "quic-cc-algo" setting. This new algorithm is considered as experimental and may be enabled only if "expose-experimental-directive" is set. Also update the documentation for this new setting. --- doc/configuration.txt | 7 +++++-- src/cfgparse-quic.c | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index ba2f114be1..84f00ade67 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -17199,7 +17199,7 @@ proto instance, it is possible to force the http/2 on clear TCP by specifying "proto h2" on the bind line. -quic-cc-algo { cubic[-pacing] | newreno | nocc }[()] +quic-cc-algo { cubic[-pacing] | newreno | bbr | nocc }[()] This is a QUIC specific setting to select the congestion control algorithm for any connection attempts to the configured QUIC listeners. They are similar to those used by TCP. @@ -17212,7 +17212,10 @@ quic-cc-algo { cubic[-pacing] | newreno | nocc }[()] scenario, it can significantly improve network throughput. However, it can also increase CPU usage if haproxy is forced to wait too long between each emission. Pacing support is still experimental, as such it requires - "expose-experimental-directives". + "expose-experimental-directives". BBR congestion control algorithm depends on + the pacing support which is in this case implicitely activated by "bbr". + Note that BBR haproxy implementation is still considered as experimental and + cannot be enabled without "expose-experimental-directives". For further customization, a list of parameters can be specified after the algorithm token. It must be written between parenthesis, separated by a comma diff --git a/src/cfgparse-quic.c b/src/cfgparse-quic.c index 8992bfb3da..1b68386a5f 100644 --- a/src/cfgparse-quic.c +++ b/src/cfgparse-quic.c @@ -19,6 +19,7 @@ #define QUIC_CC_NEWRENO_STR "newreno" #define QUIC_CC_CUBIC_STR "cubic" +#define QUIC_CC_BBR_STR "bbr" #define QUIC_CC_NO_CC_STR "nocc" static int bind_parse_quic_force_retry(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err) @@ -141,6 +142,18 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px, arg += strlen(str_pacing); } } + else if (strncmp(arg, QUIC_CC_BBR_STR, strlen(QUIC_CC_BBR_STR)) == 0) { + if (!experimental_directives_allowed) { + ha_alert("'%s' algo is experimental, must be allowed via a global " + "'expose-experimental-directives'\n", arg); + goto fail; + } + + /* bbr */ + algo = QUIC_CC_BBR_STR; + cc_algo = &quic_cc_algo_bbr; + arg += strlen(QUIC_CC_BBR_STR); + } else if (strncmp(arg, QUIC_CC_NO_CC_STR, strlen(QUIC_CC_NO_CC_STR)) == 0) { /* nocc */ if (!experimental_directives_allowed) {