MINOR: xprt_qmux: use qmux instead of qstrm naming

This is a follow-up on the QUIC MUX renaming process.

The current patch performs renaming in xprt_qmux layer. Older "qstrm"
identifier is replaced by the new name "qmux". Every remaining functions
and structures in xprt_qmux are changed. Outside effects are only
present in QUIC MUX which directly uses some of these functions.
This commit is contained in:
Amaury Denoyelle 2026-05-11 10:52:49 +02:00
parent 1bb879cb3f
commit 19a3c29d3c
3 changed files with 43 additions and 43 deletions

View File

@ -6,9 +6,9 @@
struct buffer;
struct quic_transport_params;
const struct quic_transport_params *xprt_qstrm_lparams(const void *context);
const struct quic_transport_params *xprt_qstrm_rparams(const void *context);
const struct quic_transport_params *xprt_qmux_lparams(const void *context);
const struct quic_transport_params *xprt_qmux_rparams(const void *context);
size_t xprt_qstrm_xfer_rxbuf(void *context, struct buffer *out);
size_t xprt_qmux_xfer_rxbuf(void *context, struct buffer *out);
#endif /* _HAPROXY_XPRT_QMUX_H */

View File

@ -3868,7 +3868,7 @@ static int qcm_init(struct connection *conn, struct proxy *prx,
qcc->rfctl.msd_uni_l = rparams->initial_max_stream_data_uni;
}
else {
rparams = xprt_qstrm_rparams(conn->xprt_ctx);
rparams = xprt_qmux_rparams(conn->xprt_ctx);
qfctl_init(&qcc->tx.fc, rparams->initial_max_data);
qcc->rfctl.ms_uni = rparams->initial_max_streams_uni;
@ -3877,7 +3877,7 @@ static int qcm_init(struct connection *conn, struct proxy *prx,
qcc->rfctl.msd_bidi_r = rparams->initial_max_stream_data_bidi_remote;
qcc->rfctl.msd_uni_l = rparams->initial_max_stream_data_uni;
lparams = xprt_qstrm_lparams(conn->xprt_ctx);
lparams = xprt_qmux_lparams(conn->xprt_ctx);
qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = 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;
@ -3912,7 +3912,7 @@ static int qcm_init(struct connection *conn, struct proxy *prx,
qcc->rx.qmux_buf = BUF_NULL;
/* Rx buffer is transferred from xprt layer - necessary if too many data were read */
qcc->rx.rlen = xprt_qstrm_xfer_rxbuf(conn->xprt_ctx, &qcc->rx.qmux_buf);
qcc->rx.rlen = xprt_qmux_xfer_rxbuf(conn->xprt_ctx, &qcc->rx.qmux_buf);
/* Cannot have a non empty record with an empty buffer. */
BUG_ON(qcc->rx.rlen && !b_data(&qcc->rx.qmux_buf));
}

View File

@ -12,7 +12,7 @@
#include <haproxy/quic_frame.h>
#include <haproxy/quic_tp-t.h>
struct xprt_qstrm_ctx {
struct xprt_qmux_ctx {
struct connection *conn;
struct wait_event wait_event;
@ -27,24 +27,24 @@ struct xprt_qstrm_ctx {
size_t rxrlen;
};
DECLARE_STATIC_TYPED_POOL(xprt_qstrm_ctx_pool, "xprt_qstrm_ctx", struct xprt_qstrm_ctx);
DECLARE_STATIC_TYPED_POOL(xprt_qmux_ctx_pool, "xprt_qmux_ctx", struct xprt_qmux_ctx);
const struct quic_transport_params *xprt_qstrm_lparams(const void *context)
const struct quic_transport_params *xprt_qmux_lparams(const void *context)
{
const struct xprt_qstrm_ctx *ctx = context;
const struct xprt_qmux_ctx *ctx = context;
return &ctx->lparams;
}
const struct quic_transport_params *xprt_qstrm_rparams(const void *context)
const struct quic_transport_params *xprt_qmux_rparams(const void *context)
{
const struct xprt_qstrm_ctx *ctx = context;
const struct xprt_qmux_ctx *ctx = context;
return &ctx->rparams;
}
/* Transfer Rx buffer into <out>. */
size_t xprt_qstrm_xfer_rxbuf(void *context, struct buffer *out)
size_t xprt_qmux_xfer_rxbuf(void *context, struct buffer *out)
{
struct xprt_qstrm_ctx *ctx = context;
struct xprt_qmux_ctx *ctx = context;
if (b_data(&ctx->rxbuf)) {
*out = ctx->rxbuf;
@ -54,7 +54,7 @@ size_t xprt_qstrm_xfer_rxbuf(void *context, struct buffer *out)
return ctx->rxrlen;
}
int conn_recv_qstrm(struct connection *conn, struct xprt_qstrm_ctx *ctx, int flag)
int conn_recv_qmux(struct connection *conn, struct xprt_qmux_ctx *ctx, int flag)
{
struct quic_frame frm;
struct buffer *buf = &ctx->rxbuf;
@ -126,7 +126,7 @@ int conn_recv_qstrm(struct connection *conn, struct xprt_qstrm_ctx *ctx, int fla
return 0;
}
int conn_send_qstrm(struct connection *conn, struct xprt_qstrm_ctx *ctx, int flag)
int conn_send_qmux(struct connection *conn, struct xprt_qmux_ctx *ctx, int flag)
{
struct quic_frame frm;
struct buffer *buf = &ctx->txbuf;
@ -179,14 +179,14 @@ int conn_send_qstrm(struct connection *conn, struct xprt_qstrm_ctx *ctx, int fla
return 0;
}
struct task *xprt_qstrm_io_cb(struct task *t, void *context, unsigned int state)
struct task *xprt_qmux_io_cb(struct task *t, void *context, unsigned int state)
{
struct xprt_qstrm_ctx *ctx = context;
struct xprt_qmux_ctx *ctx = context;
struct connection *conn = ctx->conn;
int free = 0, ret;
if (conn->flags & CO_FL_QMUX_SEND) {
if (!conn_send_qstrm(conn, ctx, CO_FL_QMUX_SEND)) {
if (!conn_send_qmux(conn, ctx, CO_FL_QMUX_SEND)) {
if (!(conn->flags & CO_FL_ERROR)) {
ctx->ops_lower->subscribe(conn, ctx->ctx_lower,
SUB_RETRY_SEND, &ctx->wait_event);
@ -196,7 +196,7 @@ struct task *xprt_qstrm_io_cb(struct task *t, void *context, unsigned int state)
}
if (conn->flags & CO_FL_QMUX_RECV) {
if (!conn_recv_qstrm(conn, ctx, CO_FL_QMUX_RECV)) {
if (!conn_recv_qmux(conn, ctx, CO_FL_QMUX_RECV)) {
if (!(conn->flags & CO_FL_ERROR)) {
ctx->ops_lower->subscribe(conn, ctx->ctx_lower,
SUB_RETRY_RECV, &ctx->wait_event);
@ -231,7 +231,7 @@ struct task *xprt_qstrm_io_cb(struct task *t, void *context, unsigned int state)
b_free(&ctx->txbuf);
tasklet_free(ctx->wait_event.tasklet);
pool_free(xprt_qstrm_ctx_pool, ctx);
pool_free(xprt_qmux_ctx_pool, ctx);
t = NULL;
if (ret == 0) {
@ -246,11 +246,11 @@ struct task *xprt_qstrm_io_cb(struct task *t, void *context, unsigned int state)
return t;
}
static int xprt_qstrm_add_xprt(struct connection *conn, void *xprt_ctx,
static int xprt_qmux_add_xprt(struct connection *conn, void *xprt_ctx,
void *ctx_lower, const struct xprt_ops *ops_lower,
void **ctx_older, const struct xprt_ops **ops_older)
{
struct xprt_qstrm_ctx *ctx = xprt_ctx;
struct xprt_qmux_ctx *ctx = xprt_ctx;
BUG_ON(ctx_older || ops_older);
ctx->ctx_lower = ctx_lower;
@ -259,12 +259,12 @@ static int xprt_qstrm_add_xprt(struct connection *conn, void *xprt_ctx,
return 0;
}
static int xprt_qstrm_init(struct connection *conn, void **xprt_ctx)
static int xprt_qmux_init(struct connection *conn, void **xprt_ctx)
{
struct xprt_qstrm_ctx *ctx;
struct xprt_qmux_ctx *ctx;
BUG_ON(*xprt_ctx);
ctx = pool_alloc(xprt_qstrm_ctx_pool);
ctx = pool_alloc(xprt_qmux_ctx_pool);
if (!ctx) {
conn->err_code = CO_ER_SSL_NO_MEM;
return -1;
@ -274,10 +274,10 @@ static int xprt_qstrm_init(struct connection *conn, void **xprt_ctx)
ctx->wait_event.tasklet = tasklet_new();
if (!ctx->wait_event.tasklet) {
conn->err_code = CO_ER_SSL_NO_MEM;
pool_free(xprt_qstrm_ctx_pool, ctx);
pool_free(xprt_qmux_ctx_pool, ctx);
return -1;
}
ctx->wait_event.tasklet->process = xprt_qstrm_io_cb;
ctx->wait_event.tasklet->process = xprt_qmux_io_cb;
ctx->wait_event.tasklet->context = ctx;
ctx->wait_event.events = 0;
@ -305,16 +305,16 @@ static int xprt_qstrm_init(struct connection *conn, void **xprt_ctx)
return 0;
}
static int xprt_qstrm_start(struct connection *conn, void *xprt_ctx)
static int xprt_qmux_start(struct connection *conn, void *xprt_ctx)
{
struct xprt_qstrm_ctx *ctx = xprt_ctx;
struct xprt_qmux_ctx *ctx = xprt_ctx;
tasklet_wakeup(ctx->wait_event.tasklet);
return 0;
}
static void xprt_qstrm_close(struct connection *conn, void *xprt_ctx)
static void xprt_qmux_close(struct connection *conn, void *xprt_ctx)
{
struct xprt_qstrm_ctx *ctx = xprt_ctx;
struct xprt_qmux_ctx *ctx = xprt_ctx;
if (!ctx)
return;
@ -334,27 +334,27 @@ static void xprt_qstrm_close(struct connection *conn, void *xprt_ctx)
conn->xprt = ctx->ops_lower;
tasklet_free(ctx->wait_event.tasklet);
pool_free(xprt_qstrm_ctx_pool, ctx);
pool_free(xprt_qmux_ctx_pool, ctx);
}
static int xprt_qstrm_get_alpn(const struct connection *conn, void *xprt_ctx,
const char **str, int *len)
static int xprt_qmux_get_alpn(const struct connection *conn, void *xprt_ctx,
const char **str, int *len)
{
struct xprt_qstrm_ctx *ctx = xprt_ctx;
struct xprt_qmux_ctx *ctx = xprt_ctx;
return ctx->ops_lower->get_alpn(conn, ctx->ctx_lower, str, len);
}
struct xprt_ops xprt_qmux = {
.add_xprt = xprt_qstrm_add_xprt,
.init = xprt_qstrm_init,
.start = xprt_qstrm_start,
.close = xprt_qstrm_close,
.get_alpn = xprt_qstrm_get_alpn,
.add_xprt = xprt_qmux_add_xprt,
.init = xprt_qmux_init,
.start = xprt_qmux_start,
.close = xprt_qmux_close,
.get_alpn = xprt_qmux_get_alpn,
.name = "qmux",
};
static void __xprt_qstrm_init(void)
static void __xprt_qmux_init(void)
{
xprt_register(XPRT_QMUX, &xprt_qmux);
}
INITCALL0(STG_REGISTER, __xprt_qstrm_init);
INITCALL0(STG_REGISTER, __xprt_qmux_init);