]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Add a pool for TX ring buffer internal buffer
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 4 Aug 2021 13:27:37 +0000 (15:27 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
We want to allocate the internal buffer of TX ring buffer from a pool.
This patch add "quic_tx_ring_pool" to do so.

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

index 15b3bb87f290a3e0befa0473603b00dc6de97d08..1e19c38f6147d6b159b63b6882e0d3894c81d7c1 100644 (file)
@@ -225,7 +225,11 @@ enum quic_pkt_type {
     (void) (&_a == &_b);  \
     _a > _b ? _a : _b; })
 
+/* Size of the internal buffer of QUIC TX ring buffers (must be a power of 2) */
+#define QUIC_TX_RING_BUFSZ  (1UL << 12)
+
 extern struct trace_source trace_quic;
+extern struct pool_head *pool_head_quic_tx_ring;
 extern struct pool_head *pool_head_quic_rx_packet;
 extern struct pool_head *pool_head_quic_tx_packet;
 extern struct pool_head *pool_head_quic_frame;
index ddffd10de1ce508da415e718d5138cdce9769ddf..cfd8a687703094dad7d2043e44100ea80eef5f09 100644 (file)
@@ -130,6 +130,7 @@ INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
 
 static BIO_METHOD *ha_quic_meth;
 
+DECLARE_POOL(pool_head_quic_tx_ring, "quic_tx_ring_pool", QUIC_TX_RING_BUFSZ);
 DECLARE_STATIC_POOL(pool_head_quic_conn_ctx,
                     "quic_conn_ctx_pool", sizeof(struct ssl_sock_ctx));
 DECLARE_STATIC_POOL(pool_head_quic_conn, "quic_conn", sizeof(struct quic_conn));