Re: [PATCH 1/2] io_uring/net: support registered buffer for plain send and recv
Jens Axboe <[email protected]>
| Newsgroups | org.kernel.vger.io-uring |
|---|---|
| Message-ID | <[email protected]> |
On 6/1/26 3:58 AM, Ming Lei wrote:
> diff --git a/io_uring/net.c b/io_uring/net.c
> index f01f1d25e930..9c42c3dbccd7 100644
> --- a/io_uring/net.c
> +++ b/io_uring/net.c
> @@ -431,6 +432,14 @@ int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
> sr->flags = READ_ONCE(sqe->ioprio);
> if (sr->flags & ~SENDMSG_FLAGS)
> return -EINVAL;
> + if (sr->flags & IORING_RECVSEND_FIXED_BUF) {
> + /* registered buffer send only supported for plain IORING_OP_SEND */
> + if (req->opcode != IORING_OP_SEND ||
> + (sr->flags & IORING_RECVSEND_BUNDLE) ||
> + (req->flags & REQ_F_BUFFER_SELECT))
> + return -EINVAL;
> + req->buf_index = READ_ONCE(sqe->buf_index);
> + }
I think this should either reject IORING_SEND_VECTORIZED, or if there's
a use case for it, ensure that it actually works.
Outside of that, change seems straight forward to me.
--
Jens Axboe