From 203211f4cb5e35fb509835f8034ec84652da3011 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 18 Oct 2023 12:18:10 +0200 Subject: [PATCH] REORG: stconn/muxes: Rename init step in fast-forwarding Instead of speaking of an initialisation stage for each data fast-forwarding, we now use the negociate term. Thus init_ff/init_fastfwd functions were renamed nego_ff/nego_fastfwd. --- include/haproxy/connection-t.h | 2 +- include/haproxy/stconn.h | 6 +++--- src/mux_h1.c | 8 ++++---- src/mux_h2.c | 4 ++-- src/mux_pt.c | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/haproxy/connection-t.h b/include/haproxy/connection-t.h index f6edc30df..cf1a4cb6a 100644 --- a/include/haproxy/connection-t.h +++ b/include/haproxy/connection-t.h @@ -423,7 +423,7 @@ struct mux_ops { int (*wake)(struct connection *conn); /* mux-layer callback to report activity, mandatory */ size_t (*rcv_buf)(struct stconn *sc, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to get data */ size_t (*snd_buf)(struct stconn *sc, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to send data */ - size_t (*init_fastfwd)(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice); /* Callback to fill the SD iobuf */ + size_t (*nego_fastfwd)(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice); /* Callback to fill the SD iobuf */ void (*done_fastfwd)(struct stconn *sc); /* Callback to terminate fast data forwarding */ int (*fastfwd)(struct stconn *sc, unsigned int count, unsigned int flags); /* Callback to init fast data forwarding */ int (*resume_fastfwd)(struct stconn *sc, unsigned int flags); /* Callback to resume fast data forwarding */ diff --git a/include/haproxy/stconn.h b/include/haproxy/stconn.h index 71338ada1..71751f697 100644 --- a/include/haproxy/stconn.h +++ b/include/haproxy/stconn.h @@ -132,7 +132,7 @@ static inline size_t se_ff_data(struct sedesc *se) return (se->iobuf.data + (se->iobuf.pipe ? se->iobuf.pipe->data : 0)); } -static inline size_t se_init_ff(struct sedesc *se, struct buffer *input, size_t count, unsigned int may_splice) +static inline size_t se_nego_ff(struct sedesc *se, struct buffer *input, size_t count, unsigned int may_splice) { size_t ret = 0; @@ -140,8 +140,8 @@ static inline size_t se_init_ff(struct sedesc *se, struct buffer *input, size_t const struct mux_ops *mux = se->conn->mux; se->iobuf.flags &= ~IOBUF_FL_FF_BLOCKED; - if (mux->init_fastfwd && mux->done_fastfwd) { - ret = mux->init_fastfwd(se->sc, input, count, may_splice); + if (mux->nego_fastfwd && mux->done_fastfwd) { + ret = mux->nego_fastfwd(se->sc, input, count, may_splice); if ((se->iobuf.flags & IOBUF_FL_FF_BLOCKED) && !(se->sc->wait_event.events & SUB_RETRY_SEND)) { /* The SC must be subs for send to be notify when some * space is made diff --git a/src/mux_h1.c b/src/mux_h1.c index 87bc0e481..7dc424edb 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -4390,7 +4390,7 @@ static inline struct sedesc *h1s_opposite_sd(struct h1s *h1s) return sdo; } -static size_t h1_init_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice) +static size_t h1_nego_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice) { struct h1s *h1s = __sc_mux_strm(sc); struct h1c *h1c = h1s->h1c; @@ -4584,7 +4584,7 @@ static int h1_fastfwd(struct stconn *sc, unsigned int count, unsigned int flags) if (h1m->state == H1_MSG_DATA && (h1m->flags & (H1_MF_CHNK|H1_MF_CLEN)) && count > h1m->curr_len) count = h1m->curr_len; - try = se_init_ff(sdo, &h1c->ibuf, count, !!(flags & CO_RFL_MAY_SPLICE) && !(sdo->iobuf.flags & IOBUF_FL_NO_SPLICING)); + try = se_nego_ff(sdo, &h1c->ibuf, count, !!(flags & CO_RFL_MAY_SPLICE) && !(sdo->iobuf.flags & IOBUF_FL_NO_SPLICING)); if (b_room(&h1c->ibuf) && (h1c->flags & H1C_F_IN_FULL)) { h1c->flags &= ~H1C_F_IN_FULL; TRACE_STATE("h1c ibuf not full anymore", H1_EV_STRM_RECV|H1_EV_H1C_BLK); @@ -5185,7 +5185,7 @@ static const struct mux_ops mux_http_ops = { .used_streams = h1_used_streams, .rcv_buf = h1_rcv_buf, .snd_buf = h1_snd_buf, - .init_fastfwd = h1_init_ff, + .nego_fastfwd = h1_nego_ff, .done_fastfwd = h1_done_ff, .fastfwd = h1_fastfwd, .resume_fastfwd = h1_resume_fastfwd, @@ -5212,7 +5212,7 @@ static const struct mux_ops mux_h1_ops = { .used_streams = h1_used_streams, .rcv_buf = h1_rcv_buf, .snd_buf = h1_snd_buf, - .init_fastfwd = h1_init_ff, + .nego_fastfwd = h1_nego_ff, .done_fastfwd = h1_done_ff, .fastfwd = h1_fastfwd, .resume_fastfwd = h1_resume_fastfwd, diff --git a/src/mux_h2.c b/src/mux_h2.c index 35b440e9f..9acca4550 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -6872,7 +6872,7 @@ static size_t h2_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, in return total; } -static size_t h2_init_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice) +static size_t h2_nego_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice) { struct h2s *h2s = __sc_mux_strm(sc); struct h2c *h2c = h2s->h2c; @@ -7372,7 +7372,7 @@ static const struct mux_ops h2_ops = { .wake = h2_wake, .snd_buf = h2_snd_buf, .rcv_buf = h2_rcv_buf, - .init_fastfwd = h2_init_ff, + .nego_fastfwd = h2_nego_ff, .done_fastfwd = h2_done_ff, .resume_fastfwd = h2_resume_ff, .subscribe = h2_subscribe, diff --git a/src/mux_pt.c b/src/mux_pt.c index 4b50fcdd6..52a5527d9 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -579,7 +579,7 @@ static inline struct sedesc *mux_pt_opposite_sd(struct mux_pt_ctx *ctx) return sdo; } -static size_t mux_pt_init_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice) +static size_t mux_pt_nego_ff(struct stconn *sc, struct buffer *input, size_t count, unsigned int may_splice) { struct connection *conn = __sc_conn(sc); struct mux_pt_ctx *ctx = conn->ctx; @@ -661,7 +661,7 @@ static int mux_pt_fastfwd(struct stconn *sc, unsigned int count, unsigned int fl goto out; } - try = se_init_ff(sdo, &BUF_NULL, count, conn->xprt->rcv_pipe && !!(flags & CO_RFL_MAY_SPLICE) && !(sdo->iobuf.flags & IOBUF_FL_NO_SPLICING)); + try = se_nego_ff(sdo, &BUF_NULL, count, conn->xprt->rcv_pipe && !!(flags & CO_RFL_MAY_SPLICE) && !(sdo->iobuf.flags & IOBUF_FL_NO_SPLICING)); if (sdo->iobuf.flags & IOBUF_FL_NO_FF) { /* Fast forwading is not supported by the consumer */ se_fl_clr(ctx->sd, SE_FL_MAY_FASTFWD); @@ -800,7 +800,7 @@ const struct mux_ops mux_tcp_ops = { .wake = mux_pt_wake, .rcv_buf = mux_pt_rcv_buf, .snd_buf = mux_pt_snd_buf, - .init_fastfwd = mux_pt_init_ff, + .nego_fastfwd = mux_pt_nego_ff, .done_fastfwd = mux_pt_done_ff, .fastfwd = mux_pt_fastfwd, .resume_fastfwd = mux_pt_resume_fastfwd, @@ -825,7 +825,7 @@ const struct mux_ops mux_pt_ops = { .wake = mux_pt_wake, .rcv_buf = mux_pt_rcv_buf, .snd_buf = mux_pt_snd_buf, - .init_fastfwd = mux_pt_init_ff, + .nego_fastfwd = mux_pt_nego_ff, .done_fastfwd = mux_pt_done_ff, .fastfwd = mux_pt_fastfwd, .resume_fastfwd = mux_pt_resume_fastfwd,