MINOR: quic: Remove pool_head_quic_be_cc_buf pool

This patch impacts the QUIC frontends. It reverts this patch

    MINOR: quic-be: add a "CC connection" backend TX buffer pool

which adds <pool_head_quic_be_cc_buf> new pool to allocate CC (connection closed state)
TX buffers with bigger object size than the one for <pool_head_quic_cc_buf>.
Indeed the QUIC backends must be able to send at least 1200 bytes Initial packets.

For now on, both the QUIC frontends and backend use the same pool with
MAX(QUIC_INITIAL_IPV6_MTU, QUIC_INITIAL_IPV4_MTU)(1252 bytes) as object size.
This commit is contained in:
Frederic Lecaille 2025-07-17 19:23:50 +02:00
parent 1cc0e023ce
commit 14d0f74052
3 changed files with 5 additions and 28 deletions

View File

@ -3,8 +3,7 @@
#define QUIC_MIN_CC_PKTSIZE 128 #define QUIC_MIN_CC_PKTSIZE 128
#define QUIC_DGRAM_HEADLEN (sizeof(uint16_t) + sizeof(void *)) #define QUIC_DGRAM_HEADLEN (sizeof(uint16_t) + sizeof(void *))
#define QUIC_MAX_CC_BUFSIZE (2 * (QUIC_MIN_CC_PKTSIZE + QUIC_DGRAM_HEADLEN)) #define QUIC_MAX_CC_BUFSIZE MAX(QUIC_INITIAL_IPV6_MTU, QUIC_INITIAL_IPV4_MTU)
#define QUIC_BE_MAX_CC_BUFSIZE MAX(QUIC_INITIAL_IPV6_MTU, QUIC_INITIAL_IPV4_MTU)
/* Sendmsg input buffer cannot be bigger than 65535 bytes. This comes from UDP /* Sendmsg input buffer cannot be bigger than 65535 bytes. This comes from UDP
* header which uses a 2-bytes length field. QUIC datagrams are limited to 1252 * header which uses a 2-bytes length field. QUIC datagrams are limited to 1252
@ -22,7 +21,6 @@
extern struct pool_head *pool_head_quic_tx_packet; extern struct pool_head *pool_head_quic_tx_packet;
extern struct pool_head *pool_head_quic_cc_buf; extern struct pool_head *pool_head_quic_cc_buf;
extern struct pool_head *pool_head_quic_be_cc_buf;
/* Flag a sent packet as being an ack-eliciting packet. */ /* Flag a sent packet as being an ack-eliciting packet. */
#define QUIC_FL_TX_PACKET_ACK_ELICITING (1UL << 0) #define QUIC_FL_TX_PACKET_ACK_ELICITING (1UL << 0)

View File

@ -651,12 +651,7 @@ static void quic_release_cc_conn(struct quic_conn_closed *cc_qc)
free_quic_conn_cids(qc); free_quic_conn_cids(qc);
pool_free(pool_head_quic_cids, cc_qc->cids); pool_free(pool_head_quic_cids, cc_qc->cids);
cc_qc->cids = NULL; cc_qc->cids = NULL;
if (objt_listener(cc_qc->target)) { pool_free(pool_head_quic_cc_buf, cc_qc->cc_buf_area);
pool_free(pool_head_quic_cc_buf, cc_qc->cc_buf_area);
}
else {
pool_free(pool_head_quic_be_cc_buf, cc_qc->cc_buf_area);
}
cc_qc->cc_buf_area = NULL; cc_qc->cc_buf_area = NULL;
/* free the SSL sock context */ /* free the SSL sock context */
pool_free(pool_head_quic_conn_closed, cc_qc); pool_free(pool_head_quic_conn_closed, cc_qc);
@ -1519,10 +1514,7 @@ int quic_conn_release(struct quic_conn *qc)
free_quic_conn_cids(qc); free_quic_conn_cids(qc);
pool_free(pool_head_quic_cids, qc->cids); pool_free(pool_head_quic_cids, qc->cids);
qc->cids = NULL; qc->cids = NULL;
if (objt_listener(qc->target)) pool_free(pool_head_quic_cc_buf, qc->tx.cc_buf_area);
pool_free(pool_head_quic_cc_buf, qc->tx.cc_buf_area);
else
pool_free(pool_head_quic_be_cc_buf, qc->tx.cc_buf_area);
qc->tx.cc_buf_area = NULL; qc->tx.cc_buf_area = NULL;
ret = 1; ret = 1;
} }

View File

@ -33,7 +33,6 @@
DECLARE_POOL(pool_head_quic_tx_packet, "quic_tx_packet", sizeof(struct quic_tx_packet)); DECLARE_POOL(pool_head_quic_tx_packet, "quic_tx_packet", sizeof(struct quic_tx_packet));
DECLARE_POOL(pool_head_quic_cc_buf, "quic_cc_buf", QUIC_MAX_CC_BUFSIZE); DECLARE_POOL(pool_head_quic_cc_buf, "quic_cc_buf", QUIC_MAX_CC_BUFSIZE);
DECLARE_POOL(pool_head_quic_be_cc_buf, "quic_be_cc_buf", QUIC_BE_MAX_CC_BUFSIZE);
static struct quic_tx_packet *qc_build_pkt(unsigned char **pos, const unsigned char *buf_end, static struct quic_tx_packet *qc_build_pkt(unsigned char **pos, const unsigned char *buf_end,
struct quic_enc_level *qel, struct quic_tls_ctx *ctx, struct quic_enc_level *qel, struct quic_tls_ctx *ctx,
@ -130,28 +129,16 @@ struct buffer *qc_get_txb(struct quic_conn *qc)
struct buffer *buf; struct buffer *buf;
if (qc->flags & QUIC_FL_CONN_IMMEDIATE_CLOSE) { if (qc->flags & QUIC_FL_CONN_IMMEDIATE_CLOSE) {
struct pool_head *ph;
size_t psz;
if (objt_listener(qc->target)) {
ph = pool_head_quic_cc_buf;
psz = QUIC_MAX_CC_BUFSIZE;
}
else {
ph = pool_head_quic_be_cc_buf;
psz = QUIC_BE_MAX_CC_BUFSIZE;
}
TRACE_PROTO("Immediate close required", QUIC_EV_CONN_PHPKTS, qc); TRACE_PROTO("Immediate close required", QUIC_EV_CONN_PHPKTS, qc);
buf = &qc->tx.cc_buf; buf = &qc->tx.cc_buf;
if (b_is_null(buf)) { if (b_is_null(buf)) {
qc->tx.cc_buf_area = pool_alloc(ph); qc->tx.cc_buf_area = pool_alloc(pool_head_quic_cc_buf);
if (!qc->tx.cc_buf_area) if (!qc->tx.cc_buf_area)
goto err; goto err;
} }
/* In every case, initialize ->tx.cc_buf */ /* In every case, initialize ->tx.cc_buf */
qc->tx.cc_buf = b_make(qc->tx.cc_buf_area, psz, 0, 0); qc->tx.cc_buf = b_make(qc->tx.cc_buf_area, QUIC_MAX_CC_BUFSIZE, 0, 0);
} }
else { else {
buf = qc_txb_alloc(qc); buf = qc_txb_alloc(qc);