diff mbox series

io_uring: expose read/write attribute capability

Message ID 20241205062109.1788-1-anuj20.g@samsung.com (mailing list archive)
State New
Headers show
Series io_uring: expose read/write attribute capability | expand

Commit Message

Anuj Gupta Dec. 5, 2024, 6:21 a.m. UTC
After commit 9a213d3b80c0, we can pass additional attributes along with
read/write. However, userspace doesn't know that. Add a new feature flag
IORING_FEAT_RW_ATTR, to notify the userspace that the kernel has this
ability.

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 include/uapi/linux/io_uring.h | 1 +
 io_uring/io_uring.c           | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

lizetao Dec. 5, 2024, 6:54 a.m. UTC | #1
> -----Original Message-----
> From: Anuj Gupta <anuj20.g@samsung.com>
> Sent: Thursday, December 5, 2024 2:21 PM
> To: axboe@kernel.dk; asml.silence@gmail.com; anuj1072538@gmail.com
> Cc: io-uring@vger.kernel.org; vishak.g@samsung.com; Anuj Gupta
> <anuj20.g@samsung.com>
> Subject: [PATCH] io_uring: expose read/write attribute capability
> 
> After commit 9a213d3b80c0, we can pass additional attributes along with
> read/write. However, userspace doesn't know that. Add a new feature flag
> IORING_FEAT_RW_ATTR, to notify the userspace that the kernel has this
> ability.
> 
> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
> ---
>  include/uapi/linux/io_uring.h | 1 +
>  io_uring/io_uring.c           | 3 ++-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
> index 38f0d6b10eaf..e11c82638527 100644
> --- a/include/uapi/linux/io_uring.h
> +++ b/include/uapi/linux/io_uring.h
> @@ -577,6 +577,7 @@ struct io_uring_params {
>  #define IORING_FEAT_REG_REG_RING	(1U << 13)
>  #define IORING_FEAT_RECVSEND_BUNDLE	(1U << 14)
>  #define IORING_FEAT_MIN_TIMEOUT		(1U << 15)
> +#define IORING_FEAT_RW_ATTR		(1U << 16)
> 
>  /*
>   * io_uring_register(2) opcodes and arguments diff --git
> a/io_uring/io_uring.c b/io_uring/io_uring.c index
> a8cbe674e5d6..a895de54eb3e 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -3710,7 +3710,8 @@ static __cold int io_uring_create(unsigned entries,
> struct io_uring_params *p,
>  			IORING_FEAT_EXT_ARG |
> IORING_FEAT_NATIVE_WORKERS |
>  			IORING_FEAT_RSRC_TAGS | IORING_FEAT_CQE_SKIP
> |
>  			IORING_FEAT_LINKED_FILE |
> IORING_FEAT_REG_REG_RING |
> -			IORING_FEAT_RECVSEND_BUNDLE |
> IORING_FEAT_MIN_TIMEOUT;
> +			IORING_FEAT_RECVSEND_BUNDLE |
> IORING_FEAT_MIN_TIMEOUT |
> +			IORING_FEAT_RW_ATTR;
> 
>  	if (copy_to_user(params, p, sizeof(*p))) {
>  		ret = -EFAULT;
> --
> 2.25.1
> 

Reviewed-by: Li Zetao <lizetao1@huawei.com>

--
Li Zetao
diff mbox series

Patch

diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index 38f0d6b10eaf..e11c82638527 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -577,6 +577,7 @@  struct io_uring_params {
 #define IORING_FEAT_REG_REG_RING	(1U << 13)
 #define IORING_FEAT_RECVSEND_BUNDLE	(1U << 14)
 #define IORING_FEAT_MIN_TIMEOUT		(1U << 15)
+#define IORING_FEAT_RW_ATTR		(1U << 16)
 
 /*
  * io_uring_register(2) opcodes and arguments
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index a8cbe674e5d6..a895de54eb3e 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -3710,7 +3710,8 @@  static __cold int io_uring_create(unsigned entries, struct io_uring_params *p,
 			IORING_FEAT_EXT_ARG | IORING_FEAT_NATIVE_WORKERS |
 			IORING_FEAT_RSRC_TAGS | IORING_FEAT_CQE_SKIP |
 			IORING_FEAT_LINKED_FILE | IORING_FEAT_REG_REG_RING |
-			IORING_FEAT_RECVSEND_BUNDLE | IORING_FEAT_MIN_TIMEOUT;
+			IORING_FEAT_RECVSEND_BUNDLE | IORING_FEAT_MIN_TIMEOUT |
+			IORING_FEAT_RW_ATTR;
 
 	if (copy_to_user(params, p, sizeof(*p))) {
 		ret = -EFAULT;