From: Norman Maurer <norman_maurer@apple.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org
Subject: Re: [PATCH] io_uring/net: Allow to do vectorized send
Date: Sat, 26 Jul 2025 18:49:38 -1000 [thread overview]
Message-ID: <BBF14DA5-76EE-4E73-86B1-9F7EA392A2D6@apple.com> (raw)
In-Reply-To: <9d13f0b8-e224-40ed-acb3-0dcd50f94ddd@kernel.dk>
> On Jul 24, 2025, at 4:49 AM, Jens Axboe <axboe@kernel.dk> wrote:
>
> On 7/23/25 11:16 PM, norman.maurer@googlemail.com wrote:
>> From: Norman Maurer <norman_maurer@apple.com>
>>
>> At the moment you have to use sendmsg for vectorized send. While this
>> works it's suboptimal as it also means you need to allocate a struct
>> msghdr that needs to be kept alive until a submission happens. We can
>> remove this limitation by just allowing to use send directly.
>
> Looks pretty clean, just a few minor comments below. For the commit
> message above, you should wrap it at ~72 chars.
Will do in a v2…
>
>> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
>> index b8a0e70ee2fd..6957dc539d83 100644
>> --- a/include/uapi/linux/io_uring.h
>> +++ b/include/uapi/linux/io_uring.h
>> @@ -392,12 +392,16 @@ enum io_uring_op {
>> * the starting buffer ID in cqe->flags as per
>> * usual for provided buffer usage. The buffers
>> * will be contiguous from the starting buffer ID.
>> + *
>> + * IORING_SEND_VECTORIZED If set, SEND[_ZC] will take a pointer to a io_vec
>> + * to allow vectorized send operations.
>> */
>> #define IORING_RECVSEND_POLL_FIRST (1U << 0)
>> #define IORING_RECV_MULTISHOT (1U << 1)
>> #define IORING_RECVSEND_FIXED_BUF (1U << 2)
>> #define IORING_SEND_ZC_REPORT_USAGE (1U << 3)
>> #define IORING_RECVSEND_BUNDLE (1U << 4)
>> +#define IORING_SEND_VECTORIZED (1U << 5)
>
> Do we want to support this on the recv side too? I guess that can be
> added later and IORING_RECV_VECTORIZED can just be defined to
> IORING_SEND_VECTORIZED in that case.
I think we can do this a follow if we want too..
>
>> diff --git a/io_uring/net.c b/io_uring/net.c
>> index ba2d0abea349..d4a59f5461ed 100644
>> --- a/io_uring/net.c
>> +++ b/io_uring/net.c
>> @@ -420,6 +424,9 @@ 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 (req->opcode != IORING_OP_SEND && req->opcode != IORING_OP_SEND_ZC && sr->flags & IORING_SEND_VECTORIZED)
>> + return -EINVAL;
>> +
>
> if (req->opcode == IORING_OP_SENDMSG && sr->flags & IORING_SEND_VECTORIZED)
> return -EINVAL;
>
> ?
Sure works for me… Just wanted to make it more explicit but I can change it as part of a v2.
>
> --
> Jens Axboe
prev parent reply other threads:[~2025-07-27 5:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 5:16 [PATCH] io_uring/net: Allow to do vectorized send norman.maurer
2025-07-24 14:49 ` Jens Axboe
2025-07-27 4:49 ` Norman Maurer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BBF14DA5-76EE-4E73-86B1-9F7EA392A2D6@apple.com \
--to=norman_maurer@apple.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox