]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Tunable "initial_max_streams_bidi" transport parameter
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 23 May 2022 15:28:01 +0000 (17:28 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 30 May 2022 07:59:26 +0000 (09:59 +0200)
Add tunable "tune.quic.frontend.max_streams_bidi" setting for QUIC frontends
to set the "initial_max_streams_bidi" transport parameter.
Add some documentation for this new setting.

doc/configuration.txt
include/haproxy/global-t.h
include/haproxy/quic_tp-t.h
src/cfgparse-quic.c
src/haproxy.c
src/quic_tp.c

index d95b0f348d117ef55110d4a93a61a1e9a62fd8fb..9846e8bfeb3f76e898943a3292c575166a521321 100644 (file)
@@ -1120,6 +1120,7 @@ The following keywords are supported in the "global" section :
    - tune.pool-low-fd-ratio
    - tune.quic.conn-buf-limit
    - tune.quic.frontend.max-idle-timeout
+   - tune.quic.frontend.max-streams-bidi
    - tune.quic.retry-threshold
    - tune.rcvbuf.client
    - tune.rcvbuf.server
@@ -2954,6 +2955,17 @@ tune.quic.frontend.max-idle-timeout <timeout>
 
   The default value is 30000.
 
+tune.quic.frontend.max-streams-bidi <number>
+  Warning: QUIC support in HAProxy is currently experimental. Configuration may
+  change without deprecation in the future.
+
+  Sets the QUIC initial_max_streams_bidi transport parameter for frontends.
+  This is the initial maximum number of bidirectional streams the remote peer
+  will be authorized to open. This determines the number of concurrent client
+  requests.
+
+  The default value is 100.
+
 tune.quic.retry-threshold <number>
   Warning: QUIC support in HAProxy is currently experimental. Configuration may
   change without deprecation in the future.
index b32950a7e3f58db7ae3802f6d56adc9839752b18..dc18fa987509417472cc5f1bff4e81bd7e02e27c 100644 (file)
@@ -160,6 +160,7 @@ struct global {
 #ifdef USE_QUIC
                unsigned int quic_backend_max_idle_timeout;
                unsigned int quic_frontend_max_idle_timeout;
+               unsigned int quic_frontend_max_streams_bidi;
                unsigned int quic_retry_threshold;
                unsigned int quic_streams_buf;
 #endif /* USE_QUIC */
index 6648c6cf92bd5edb2604f7ad9f07d446aeb33360..1c5fc54cbce6a4a6c4aeeecd2306fa5c03dce709 100644 (file)
@@ -31,6 +31,7 @@ struct tp_preferred_address {
 #define QUIC_DFLT_ACK_DELAY_COMPONENT        3 /* milliseconds */
 #define QUIC_DFLT_MAX_ACK_DELAY             25 /* milliseconds */
 #define QUIC_DFLT_FRONT_MAX_IDLE_TIMEOUT 30000 /* milliseconds */
+#define QUIC_DFLT_FRONT_MAX_STREAMS_BIDI   100
 #define QUIC_DFLT_BACK_MAX_IDLE_TIMEOUT  30000 /* milliseconds */
 #define QUIC_ACTIVE_CONNECTION_ID_LIMIT      2 /* number of connections */
 
index f4ded90d5a3387586f01951c2b88bb28fff8cd91..e89b5a2e6fe800ebb90c2b808e2bd8cea43d2e7c 100644 (file)
@@ -76,6 +76,7 @@ static int cfg_parse_quic_tune_setting(char **args, int section_type,
 {
        unsigned int arg = 0;
        int prefix_len = strlen("tune.quic.");
+       const char *suffix;
 
        if (too_many_args(1, args, err, NULL))
                return -1;
@@ -88,9 +89,12 @@ static int cfg_parse_quic_tune_setting(char **args, int section_type,
                return -1;
        }
 
-       if (strcmp(args[0] + prefix_len, "conn-buf-limit") == 0)
+       suffix = args[0] + prefix_len;
+       if (strcmp(suffix, "conn-buf-limit") == 0)
                global.tune.quic_streams_buf = arg;
-       else if (strcmp(args[0] + prefix_len, "retry-threshold") == 0)
+       else if (strcmp(suffix, "frontend.max-streams-bidi") == 0)
+               global.tune.quic_frontend_max_streams_bidi = arg;
+       else if (strcmp(suffix, "retry-threshold") == 0)
                global.tune.quic_retry_threshold = arg;
        else {
                memprintf(err, "'%s' keyword not unhandled (please report this bug).", args[0]);
@@ -103,6 +107,7 @@ static int cfg_parse_quic_tune_setting(char **args, int section_type,
 static struct cfg_kw_list cfg_kws = {ILH, {
        { CFG_GLOBAL, "tune.quic.backend.max-idle-timeou", cfg_parse_quic_time },
        { CFG_GLOBAL, "tune.quic.conn-buf-limit", cfg_parse_quic_tune_setting },
+       { CFG_GLOBAL, "tune.quic.frontend.max-streams-bidi", cfg_parse_quic_tune_setting },
        { CFG_GLOBAL, "tune.quic.frontend.max-idle-timeout", cfg_parse_quic_time },
        { CFG_GLOBAL, "tune.quic.retry-threshold", cfg_parse_quic_tune_setting },
        { 0, NULL, NULL }
index a112c233a4435df44c2d9d465ec72280c5f77648..e2a7d729d0441740bfb3606cf64b5580d4a5e6be 100644 (file)
@@ -208,6 +208,7 @@ struct global global = {
 #ifdef USE_QUIC
                .quic_backend_max_idle_timeout = QUIC_DFLT_BACK_MAX_IDLE_TIMEOUT,
                .quic_frontend_max_idle_timeout = QUIC_DFLT_FRONT_MAX_IDLE_TIMEOUT,
+               .quic_frontend_max_streams_bidi = QUIC_DFLT_FRONT_MAX_STREAMS_BIDI,
                .quic_retry_threshold = QUIC_DFLT_RETRY_THRESHOLD,
                .quic_streams_buf = 30,
 #endif /* USE_QUIC */
index c1e8437f7fc3794a9621cf541328cec8287b0cb1..e97c3a4df67eac08074c783fa3f69c9f83442e6b 100644 (file)
@@ -45,7 +45,7 @@ static void quic_dflt_transport_params_cpy(struct quic_transport_params *dst)
 void quic_transport_params_init(struct quic_transport_params *p, int server)
 {
        const uint64_t ncb_size = global.tune.bufsize - NCB_RESERVED_SZ;
-       const int max_streams_bidi = 100;
+       const int max_streams_bidi = global.tune.quic_frontend_max_streams_bidi;
        const int max_streams_uni = 3;
 
        /* Set RFC default values for unspecified parameters. */