From: Amaury Denoyelle Date: Tue, 31 Jan 2023 10:44:50 +0000 (+0100) Subject: MINOR: quic: add config for retransmit limit X-Git-Tag: v2.8-dev3~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24d5b72ca9c2a0ca7a469de208b793e8a69aa0b6;p=thirdparty%2Fhaproxy.git MINOR: quic: add config for retransmit limit 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. --- diff --git a/doc/configuration.txt b/doc/configuration.txt index 220483ad90..0bd276376e 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -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 The default value is 100. +tune.quic.max-frame-loss + 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 Warning: QUIC support in HAProxy is currently experimental. Configuration may change without deprecation in the future. diff --git a/include/haproxy/global-t.h b/include/haproxy/global-t.h index 9b567974af..30308c772b 100644 --- a/include/haproxy/global-t.h +++ b/include/haproxy/global-t.h @@ -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 { diff --git a/src/cfgparse-quic.c b/src/cfgparse-quic.c index 21aaac2e2d..35548d36bd 100644 --- a/src/cfgparse-quic.c +++ b/src/cfgparse-quic.c @@ -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 } }}; diff --git a/src/haproxy.c b/src/haproxy.c index 3c7828535b..e03b2388e9 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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 */ }, diff --git a/src/quic_conn.c b/src/quic_conn.c index 783015d91e..9d167cc8a0 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -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;