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 220483a..0bd2763 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -1149,6 +1149,7 @@
    - 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 @@
 
   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.
diff --git a/include/haproxy/global-t.h b/include/haproxy/global-t.h
index 9b56797..30308c7 100644
--- a/include/haproxy/global-t.h
+++ b/include/haproxy/global-t.h
@@ -170,6 +170,7 @@
 		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 21aaac2..35548d3 100644
--- a/src/cfgparse-quic.c
+++ b/src/cfgparse-quic.c
@@ -144,6 +144,8 @@
 		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 @@
 	{ 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 3c78285..e03b238 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -210,6 +210,7 @@
 		.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 783015d..9d167cc 100644
--- a/src/quic_conn.c
+++ b/src/quic_conn.c
@@ -1832,7 +1832,7 @@
 			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;