]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux_quic: define ms_bidi_rel QCC member
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 15 May 2026 14:55:32 +0000 (16:55 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 20 May 2026 07:52:50 +0000 (09:52 +0200)
Add a new QCC member <ms_bidi_rel>. This represents the number of
concurrent streams advertised similarly to ms_bidi, but as a relative
value.

This patch does not introduce any functional change. For now,
<ms_bidi_rel> will be equal to <ms_bidi_init>. However, with the
implementation of stream elasticity and dynamic adjustment for
concurrent max-streams-bidi, the former will be required to keep the
last advertised value.

include/haproxy/mux_quic-t.h
src/mux_quic.c

index 5be71cfbbd0ebedc5d80d3af51c26bc88013def9..93b756c9c323de48abc2986eedc6faf4a5fafdc6 100644 (file)
@@ -53,6 +53,7 @@ struct qcc {
                struct list frms; /* prepared frames related to flow-control  */
 
                uint64_t ms_bidi_init; /* max initial sub-ID of bidi stream allowed for the peer */
+               uint64_t ms_bidi_rel; /* max relative sub-ID of bidi stream allowed for the peer */
                uint64_t ms_bidi; /* max sub-ID of bidi stream allowed for the peer */
                uint64_t cl_bidi_r; /* total count of closed remote bidi stream since last MAX_STREAMS emission */
 
index 50a478bd03353bc2581728d424e98b132ef976f2..0504b9a4b241e705781f9182d62a26fd1608eeb5 100644 (file)
@@ -2483,7 +2483,7 @@ static int qcc_release_remote_stream(struct qcc *qcc, uint64_t id)
                /* MAX_STREAMS needed if closed streams value more than twice
                 * the initial window or reaching the stream ID limit.
                 */
-               if (qcc->lfctl.cl_bidi_r > qcc->lfctl.ms_bidi_init / 2 ||
+               if (qcc->lfctl.cl_bidi_r > qcc->lfctl.ms_bidi_rel / 2 ||
                    qcc->lfctl.cl_bidi_r + qcc->lfctl.ms_bidi == max) {
                        TRACE_DATA("increase max stream limit with MAX_STREAMS_BIDI", QMUX_EV_QCC_SEND, qcc->conn);
                        frm = qc_frm_alloc(QUIC_FT_MAX_STREAMS_BIDI);
@@ -3587,9 +3587,9 @@ static void qcc_release(struct qcc *qcc)
        TRACE_PROTO("application layer released", QMUX_EV_QCC_END, conn);
 
        if (!(qcc->flags & QC_CF_IS_BACK) && global.tune.streams_elasticity &&
-           qcc->lfctl.ms_bidi_init > 1) {
+           qcc->lfctl.ms_bidi_rel > 1) {
                _HA_ATOMIC_SUB(&tg_ctx->committed_extra_streams,
-                              qcc->lfctl.ms_bidi_init - 1);
+                              qcc->lfctl.ms_bidi_rel - 1);
        }
 
        if (conn && !conn_is_quic(conn)) {
@@ -3855,7 +3855,7 @@ static int qcm_init(struct connection *conn, struct proxy *prx,
                /* Server parameters, params used for RX flow control. */
                lparams = &conn->handle.qc->rx.params;
 
-               qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi;
+               qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = qcc->lfctl.ms_bidi_rel = lparams->initial_max_streams_bidi;
                qcc->lfctl.ms_uni = lparams->initial_max_streams_uni;
                qcc->lfctl.msd_bidi_l = lparams->initial_max_stream_data_bidi_local;
                qcc->lfctl.msd_bidi_r = lparams->initial_max_stream_data_bidi_remote;
@@ -3884,7 +3884,7 @@ static int qcm_init(struct connection *conn, struct proxy *prx,
                qcc->rfctl.msd_uni_l = rparams->initial_max_stream_data_uni;
 
                lparams = xprt_qmux_lparams(conn->xprt_ctx);
-               qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi;
+               qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = qcc->lfctl.ms_bidi_rel= lparams->initial_max_streams_bidi;
                qcc->lfctl.ms_uni = lparams->initial_max_streams_uni;
                qcc->lfctl.msd_bidi_l = lparams->initial_max_stream_data_bidi_local;
                qcc->lfctl.msd_bidi_r = lparams->initial_max_stream_data_bidi_remote;
@@ -4648,7 +4648,7 @@ static int qcm_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *out
                return qcc->nb_hreq;
 
        case MUX_CTL_GET_MAXSTRM:
-               return qcc->lfctl.ms_bidi_init;
+               return qcc->lfctl.ms_bidi_rel;
 
        case MUX_CTL_TEVTS:
                return qcc->term_evts_log;