public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH liburing v3] register: Remove deprecated io_uring_cqwait_reg_arg
@ 2025-05-16 17:12 Haiyue Wang
  2025-05-20 17:15 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Haiyue Wang @ 2025-05-16 17:12 UTC (permalink / raw)
  To: io-uring; +Cc: Haiyue Wang

The opcode IORING_REGISTER_CQWAIT_REG and its argument io_uring_cqwait_reg_arg
have been removed by [1] and [2].

And a more generic opcode IORING_REGISTER_MEM_REGION has been introduced by [3]
since Linux 6.13.

Update the document about IORING_REGISTER_MEM_REGION based on [4] and [5].

[1]: https://git.kernel.org/torvalds/c/83e041522eb9
[2]: https://git.kernel.org/torvalds/c/c750629caeca
[3]: https://git.kernel.org/torvalds/c/93238e661855
[4]: https://git.kernel.org/torvalds/c/dfbbfbf19187
[5]: https://git.kernel.org/torvalds/c/d617b3147d54

Signed-off-by: Haiyue Wang <haiyuewa@163.com>
---
v3:
 - Replace the document CQWAIT_REG with MEM_REGION.
v2: https://lore.kernel.org/io-uring/20250516091040.32374-1-haiyuewa@163.com/
 - Correct the commit message about the IORING_REGISTER_CQWAIT_REG which
   is really removed.
v1: https://lore.kernel.org/io-uring/20250516090704.32220-1-haiyuewa@163.com/
---
 man/io_uring_enter.2            |  4 +--
 man/io_uring_register.2         | 55 +++++++++++++++++++++------------
 src/include/liburing/io_uring.h | 14 ---------
 3 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/man/io_uring_enter.2 b/man/io_uring_enter.2
index bbae6fb..99c0ab2 100644
--- a/man/io_uring_enter.2
+++ b/man/io_uring_enter.2
@@ -133,8 +133,8 @@ is not a pointer to a
 but merely an offset into an area of wait regions previously registered with
 .BR io_uring_register (2)
 using the
-.B IORING_REGISTER_CQWAIT_REG
-operation. Available since 6.12
+.B IORING_REGISTER_MEM_REGION
+operation. Available since 6.13
 
 .PP
 .PP
diff --git a/man/io_uring_register.2 b/man/io_uring_register.2
index a81d950..75112d0 100644
--- a/man/io_uring_register.2
+++ b/man/io_uring_register.2
@@ -951,40 +951,55 @@ of this system call, which can be used to memory map the ring just like how
 a new ring would've been mapped. Available since kernel 6.13.
 
 .TP
-.B IORING_REGISTER_CQWAIT_REG
-Supports registering fixed wait regions, avoiding unnecessary copying in
-of
+.B IORING_REGISTER_MEM_REGION
+Supports registering multiple purposes memory regions, avoiding unnecessary
+copying in of
 .IR struct io_uring_getevents_arg
 for wait operations that specify a timeout or minimum timeout. Takes a pointer
 to a
-.IR struct io_uring_cqwait_reg_arg
+.IR struct io_uring_mem_region_reg
 structure, which looks as follows:
 .PP
 .in +12n
 .EX
-struct io_uring_cqwait_reg_arg {
-    __u32 flags;
-    __u32 struct_size;
-    __u32 nr_entries;
-    __u32 pad;
-    __u64 user_addr;
-    __u64 pad2[2];
+struct io_uring_mem_region_reg {
+    __u64 region_uptr;
+    __u64 flags;
+    __u64 __resv[2];
 };
 .EE
 .in
 .TP
 .PP
 where
+.IR region_uptr
+must be set to the region being registered as memory regions,
 .IR flags
 specifies modifier flags (must currently be
-.B 0 ),
-.IR struct_size
-must be set to the size of the struct, and
-.IR user_addr
-must be set to the region being registered as wait regions. The pad fields
-must all be cleared to
+.B IORING_MEM_REGION_REG_WAIT_ARG ). The pad fields must all be cleared to
 .B 0 .
-Each wait regions looks as follows:
+Each memory regions looks as follows:
+.PP
+.in +12n
+.EX
+struct io_uring_region_desc {
+    __u64 user_addr;
+    __u64 size;
+    __u32 flags;
+    __u32 id;
+    __u64 mmap_offset;
+    __u64 __resv[4];
+};
+.EE
+.in
+.TP
+.PP
+where
+.IR user_addr
+points to userspace memory mappings,
+.IR size
+is the size of userspace memory. Current supported userspace memory regions
+looks as follows:
 .PP
 .in +12n
 .EX
@@ -1018,9 +1033,9 @@ which, if set, says that the values in
 are valid and should be used for a timeout operation. The
 .IR user_addr
 field of
-.IR struct io_uring_cqwait_reg_arg
+.IR struct io_uring_region_desc
 must be set to an address of
-.IR struct io_uring_cqwait_reg
+.IR struct io_uring_reg_wait
 members, an up to a page size can be mapped. At the size of 64 bytes per
 region, that allows at least 64 individual regions on a 4k page size system.
 The offsets of these regions are used for an
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index a89d0d1..73d2997 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -851,20 +851,6 @@ enum {
 	IORING_REG_WAIT_TS		= (1U << 0),
 };
 
-/*
- * Argument for IORING_REGISTER_CQWAIT_REG, registering a region of
- * struct io_uring_reg_wait that can be indexed when io_uring_enter(2) is
- * called rather than pass in a wait argument structure separately.
- */
-struct io_uring_cqwait_reg_arg {
-	__u32		flags;
-	__u32		struct_size;
-	__u32		nr_entries;
-	__u32		pad;
-	__u64		user_addr;
-	__u64		pad2[3];
-};
-
 /*
  * Argument for io_uring_enter(2) with
  * IORING_GETEVENTS | IORING_ENTER_EXT_ARG_REG set, where the actual argument
-- 
2.49.0


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

* Re: [PATCH liburing v3] register: Remove deprecated io_uring_cqwait_reg_arg
  2025-05-16 17:12 [PATCH liburing v3] register: Remove deprecated io_uring_cqwait_reg_arg Haiyue Wang
@ 2025-05-20 17:15 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-05-20 17:15 UTC (permalink / raw)
  To: io-uring, Haiyue Wang


On Sat, 17 May 2025 01:12:25 +0800, Haiyue Wang wrote:
> The opcode IORING_REGISTER_CQWAIT_REG and its argument io_uring_cqwait_reg_arg
> have been removed by [1] and [2].
> 
> And a more generic opcode IORING_REGISTER_MEM_REGION has been introduced by [3]
> since Linux 6.13.
> 
> Update the document about IORING_REGISTER_MEM_REGION based on [4] and [5].
> 
> [...]

Applied, thanks!

[1/1] register: Remove deprecated io_uring_cqwait_reg_arg
      commit: 3fd9ebb6889461736774a7b3c797b165789674ee

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2025-05-20 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16 17:12 [PATCH liburing v3] register: Remove deprecated io_uring_cqwait_reg_arg Haiyue Wang
2025-05-20 17:15 ` Jens Axboe

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