2022-05-08 19:11:23

by Hao Xu

[permalink] [raw]
Subject: [PATCH 1/5] io_uring: add IORING_ACCEPT_MULTISHOT for accept

From: Hao Xu <[email protected]>

add an accept_flag IORING_ACCEPT_MULTISHOT for accept, which is to
support multishot.

Signed-off-by: Hao Xu <[email protected]>
---
include/uapi/linux/io_uring.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index fad63564678a..73bc7e54ac18 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -213,6 +213,11 @@ enum {
#define IORING_ASYNC_CANCEL_FD (1U << 1)
#define IORING_ASYNC_CANCEL_ANY (1U << 2)

+/*
+ * accept flags stored in accept_flags
+ */
+#define IORING_ACCEPT_MULTISHOT (1U << 15)
+
/*
* IO completion data structure (Completion Queue Entry)
*/
--
2.36.0



2022-05-09 06:33:24

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH 1/5] io_uring: add IORING_ACCEPT_MULTISHOT for accept

On 5/6/22 1:00 AM, Hao Xu wrote:
> From: Hao Xu <[email protected]>
>
> add an accept_flag IORING_ACCEPT_MULTISHOT for accept, which is to
> support multishot.
>
> Signed-off-by: Hao Xu <[email protected]>
> ---
> include/uapi/linux/io_uring.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
> index fad63564678a..73bc7e54ac18 100644
> --- a/include/uapi/linux/io_uring.h
> +++ b/include/uapi/linux/io_uring.h
> @@ -213,6 +213,11 @@ enum {
> #define IORING_ASYNC_CANCEL_FD (1U << 1)
> #define IORING_ASYNC_CANCEL_ANY (1U << 2)
>
> +/*
> + * accept flags stored in accept_flags
> + */
> +#define IORING_ACCEPT_MULTISHOT (1U << 15)

It isn't stored in accept_flags, is it? This is an io_uring private
flag, and it's in ioprio. Which is honestly a good place for per-op
private flags, since nobody really uses ioprio outside of read/write
style requests. But the comment is wrong :-)

--
Jens Axboe


2022-05-09 08:09:10

by Hao Xu

[permalink] [raw]
Subject: Re: [PATCH 1/5] io_uring: add IORING_ACCEPT_MULTISHOT for accept

在 5/6/22 10:32 PM, Jens Axboe 写道:
> On 5/6/22 1:00 AM, Hao Xu wrote:
>> From: Hao Xu <[email protected]>
>>
>> add an accept_flag IORING_ACCEPT_MULTISHOT for accept, which is to
>> support multishot.
>>
>> Signed-off-by: Hao Xu <[email protected]>
>> ---
>> include/uapi/linux/io_uring.h | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
>> index fad63564678a..73bc7e54ac18 100644
>> --- a/include/uapi/linux/io_uring.h
>> +++ b/include/uapi/linux/io_uring.h
>> @@ -213,6 +213,11 @@ enum {
>> #define IORING_ASYNC_CANCEL_FD (1U << 1)
>> #define IORING_ASYNC_CANCEL_ANY (1U << 2)
>>
>> +/*
>> + * accept flags stored in accept_flags
>> + */
>> +#define IORING_ACCEPT_MULTISHOT (1U << 15)
>
> It isn't stored in accept_flags, is it? This is an io_uring private
> flag, and it's in ioprio. Which is honestly a good place for per-op
> private flags, since nobody really uses ioprio outside of read/write
> style requests. But the comment is wrong :-)

Ah, yes, thanks for pointing it out, I forgot to update the comment
>