public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: expose read/write attribute capability
       [not found] <CGME20241205062910epcas5p2aed41bc2f50a58cb1966543dfd31c316@epcas5p2.samsung.com>
@ 2024-12-05  6:21 ` Anuj Gupta
  2024-12-05  6:54   ` lizetao
  0 siblings, 1 reply; 2+ messages in thread
From: Anuj Gupta @ 2024-12-05  6:21 UTC (permalink / raw)
  To: axboe, asml.silence, anuj1072538; +Cc: io-uring, vishak.g, Anuj Gupta

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 <[email protected]>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] io_uring: expose read/write attribute capability
  2024-12-05  6:21 ` [PATCH] io_uring: expose read/write attribute capability Anuj Gupta
@ 2024-12-05  6:54   ` lizetao
  0 siblings, 0 replies; 2+ messages in thread
From: lizetao @ 2024-12-05  6:54 UTC (permalink / raw)
  To: Anuj Gupta, [email protected], [email protected],
	[email protected]
  Cc: [email protected], [email protected]



> -----Original Message-----
> From: Anuj Gupta <[email protected]>
> Sent: Thursday, December 5, 2024 2:21 PM
> To: [email protected]; [email protected]; [email protected]
> Cc: [email protected]; [email protected]; Anuj Gupta
> <[email protected]>
> 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 <[email protected]>
> ---
>  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 <[email protected]>

--
Li Zetao


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-05  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20241205062910epcas5p2aed41bc2f50a58cb1966543dfd31c316@epcas5p2.samsung.com>
2024-12-05  6:21 ` [PATCH] io_uring: expose read/write attribute capability Anuj Gupta
2024-12-05  6:54   ` lizetao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox