]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux_quic: implement basic committed_extra_streams accounting
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 13 May 2026 06:08:11 +0000 (08:08 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 20 May 2026 07:52:50 +0000 (09:52 +0200)
Account QUIC frontend connections into committed_extra_streams when
stream elasticity setting is active. This is performed in QCC init and
release functions.

This patch has no impact on QUIC subsystem for now. Connections will
still allow a static number of concurrent streams based on
tune.quic.fe.stream.max-concurrent. However, this has a direct
repercussion on H2 subsystem, as a higher count of QUIC connections will
reduce the concurrent streams allowed there.

src/mux_quic.c

index f9766509a4ccb73c0a926a52030cb26054ce935f..50a478bd03353bc2581728d424e98b132ef976f2 100644 (file)
@@ -3586,6 +3586,12 @@ 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) {
+               _HA_ATOMIC_SUB(&tg_ctx->committed_extra_streams,
+                              qcc->lfctl.ms_bidi_init - 1);
+       }
+
        if (conn && !conn_is_quic(conn)) {
                b_free(&qcc->rx.qmux_buf);
                b_free(&qcc->tx.qmux_buf);
@@ -3928,6 +3934,11 @@ static int qcm_init(struct connection *conn, struct proxy *prx,
                qcc->next_bidi_l    = 0x01;
                qcc->largest_uni_r  = 0x02;
                qcc->next_uni_l     = 0x03;
+
+               if (global.tune.streams_elasticity && qcc->lfctl.ms_bidi_init > 1) {
+                       _HA_ATOMIC_ADD(&tg_ctx->committed_extra_streams,
+                                      qcc->lfctl.ms_bidi_init - 1);
+               }
        }
 
        qcc->wait_event.tasklet = tasklet_new();