]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: add config for retransmit limit
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 31 Jan 2023 10:44:50 +0000 (11:44 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 3 Feb 2023 10:56:46 +0000 (11:56 +0100)
Define a new configuration option "tune.quic.max-frame-loss". This is
used to specify the limit for which a single frame instance can be
detected as lost. If exceeded, the connection is closed.

This should be backported up to 2.7.

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

index 220483ad9001ecabff5929612be39134f7e40b05..0bd276376e974d23d6e954ffdb5f816bebbbf122 100644 (file)
@@ -1149,6 +1149,7 @@ The following keywords are supported in the "global" section :
    - tune.quic.frontend.conn-tx-buffers.limit
    - tune.quic.frontend.max-idle-timeout
    - tune.quic.frontend.max-streams-bidi
+   - tune.quic.max-frame-loss
    - tune.quic.retry-threshold
    - tune.quic.socket-owner
    - tune.rcvbuf.client
@@ -3110,6 +3111,15 @@ tune.quic.frontend.max-streams-bidi <number>
 
   The default value is 100.
 
+tune.quic.max-frame-loss <number>
+  Warning: QUIC support in HAProxy is currently experimental. Configuration may
+  change without deprecation in the future.
+
+  Sets the limit for which a single QUIC frame can be marked as lost. If
+  exceeded, the connection is considered as failing and is closed immediately.
+
+  The default value is 10.
+
 tune.quic.retry-threshold <number>
   Warning: QUIC support in HAProxy is currently experimental. Configuration may
   change without deprecation in the future.
index 9b567974af0757d57efb44c355a91604196c9ccd..30308c772b20e6ee8087508270cad4866d9723f7 100644 (file)
@@ -170,6 +170,7 @@ struct global {
                unsigned int quic_frontend_max_streams_bidi;
                unsigned int quic_retry_threshold;
                unsigned int quic_streams_buf;
+               unsigned int quic_max_frame_loss;
 #endif /* USE_QUIC */
        } tune;
        struct {
index 21aaac2e2d5d016d366a1e94b8351e407e061300..35548d36bd968fa0d46f68bde120cfc0f3a9c6ce 100644 (file)
@@ -144,6 +144,8 @@ static int cfg_parse_quic_tune_setting(char **args, int section_type,
                global.tune.quic_streams_buf = arg;
        else if (strcmp(suffix, "frontend.max-streams-bidi") == 0)
                global.tune.quic_frontend_max_streams_bidi = arg;
+       else if (strcmp(suffix, "max-frame-loss") == 0)
+               global.tune.quic_max_frame_loss = arg;
        else if (strcmp(suffix, "retry-threshold") == 0)
                global.tune.quic_retry_threshold = arg;
        else {
@@ -160,6 +162,7 @@ static struct cfg_kw_list cfg_kws = {ILH, {
        { CFG_GLOBAL, "tune.quic.frontend.conn-tx-buffers.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.max-frame-loss", cfg_parse_quic_tune_setting },
        { CFG_GLOBAL, "tune.quic.retry-threshold", cfg_parse_quic_tune_setting },
        { 0, NULL, NULL }
 }};
index 3c7828535babec9248aaf5390ec261e29ddc2030..e03b2388e9ff24ed3bef51217470e5d017590eef 100644 (file)
@@ -210,6 +210,7 @@ struct global global = {
                .quic_frontend_max_idle_timeout = QUIC_TP_DFLT_FRONT_MAX_IDLE_TIMEOUT,
                .quic_frontend_max_streams_bidi = QUIC_TP_DFLT_FRONT_MAX_STREAMS_BIDI,
                .quic_retry_threshold = QUIC_DFLT_RETRY_THRESHOLD,
+               .quic_max_frame_loss = QUIC_DFLT_MAX_FRAME_LOSS,
                .quic_streams_buf = 30,
 #endif /* USE_QUIC */
        },
index 783015d91ef4cd1625b648542d5cf588311d7e93..9d167cc8a0450ccc6c9d1fb0dd5e676f8356535e 100644 (file)
@@ -1832,7 +1832,7 @@ static inline int qc_requeue_nacked_pkt_tx_frms(struct quic_conn *qc,
                        qc_frm_free(&frm);
                }
                else {
-                       if (++frm->loss_count >= QUIC_DFLT_MAX_FRAME_LOSS) {
+                       if (++frm->loss_count >= global.tune.quic_max_frame_loss) {
                                TRACE_ERROR("retransmission limit reached, closing the connection", QUIC_EV_CONN_PRSAFRM, qc);
                                quic_set_connection_close(qc, quic_err_transport(QC_ERR_INTERNAL_ERROR));
                                close = 1;