MINOR: muxes: Announce support for zero-copy forwarding on consumer side

It is unused for now, but the muxes announce their support of the zero-copy
forwarding on consumer side. All muxes, except the fgci one, are supported
it.
This commit is contained in:
Christopher Faulet 2024-02-14 15:15:09 +01:00
parent 22d4b0e901
commit e2921ffad1
4 changed files with 14 additions and 1 deletions

View File

@ -830,6 +830,8 @@ static struct h1s *h1c_frt_stream_new(struct h1c *h1c, struct stconn *sc, struct
* especially if headers were already forwarded. But it is not
* mandatory.
*/
if (!(global.tune.no_zero_copy_fwd & NO_ZERO_COPY_FWD_H1_SND))
se_fl_set(h1s->sd, SE_FL_MAY_FASTFWD_CONS);
se_expect_no_data(h1s->sd);
h1s->sess = sess;
@ -867,6 +869,8 @@ static struct h1s *h1c_bck_stream_new(struct h1c *h1c, struct stconn *sc, struct
h1s->sd = sc->sedesc;
h1s->sess = sess;
if (!(global.tune.no_zero_copy_fwd & NO_ZERO_COPY_FWD_H1_SND))
se_fl_set(h1s->sd, SE_FL_MAY_FASTFWD_CONS);
h1c->state = H1_CS_RUNNING;
if (h1c->px->options2 & PR_O2_RSPBUG_OK)

View File

@ -1659,6 +1659,10 @@ static struct h2s *h2c_frt_stream_new(struct h2c *h2c, int id, struct buffer *in
h2s->sd->se = h2s;
h2s->sd->conn = h2c->conn;
se_fl_set(h2s->sd, SE_FL_T_MUX | SE_FL_ORPHAN | SE_FL_NOT_FIRST);
if (!(global.tune.no_zero_copy_fwd & NO_ZERO_COPY_FWD_H2_SND))
se_fl_set(h2s->sd, SE_FL_MAY_FASTFWD_CONS);
/* The request is not finished, don't expect data from the opposite side
* yet
*/
@ -1749,6 +1753,8 @@ static struct h2s *h2c_bck_stream_new(struct h2c *h2c, struct stconn *sc, struct
h2s->sess = sess;
h2c->nb_sc++;
if (!(global.tune.no_zero_copy_fwd & NO_ZERO_COPY_FWD_H2_SND))
se_fl_set(h2s->sd, SE_FL_MAY_FASTFWD_CONS);
/* on the backend we can afford to only count total streams upon success */
h2c->stream_cnt++;

View File

@ -325,7 +325,7 @@ static int mux_pt_init(struct connection *conn, struct proxy *prx, struct sessio
conn->ctx = ctx;
se_fl_set(ctx->sd, SE_FL_RCV_MORE);
if (global.tune.options & GTUNE_USE_SPLICE)
se_fl_set(ctx->sd, SE_FL_MAY_FASTFWD_PROD);
se_fl_set(ctx->sd, SE_FL_MAY_FASTFWD_PROD|SE_FL_MAY_FASTFWD_CONS);
TRACE_LEAVE(PT_EV_CONN_NEW, conn);
return 0;

View File

@ -675,6 +675,9 @@ struct stconn *qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin)
se_fl_set(qcs->sd, SE_FL_T_MUX | SE_FL_ORPHAN | SE_FL_NOT_FIRST);
se_expect_no_data(qcs->sd);
if (!(global.tune.no_zero_copy_fwd & NO_ZERO_COPY_FWD_QUIC_SND))
se_fl_set(qcs->sd, SE_FL_MAY_FASTFWD_CONS);
/* TODO duplicated from mux_h2 */
sess->t_idle = ns_to_ms(now_ns - sess->accept_ts) - sess->t_handshake;