On 1/6/25 11:33, lizetao wrote:
Hi,
-----Original Message-----
From: Pavel Begunkov <asml.silence@xxxxxxxxx>
Sent: Monday, December 30, 2024 9:30 PM
To: io-uring@xxxxxxxxxxxxxxx
Cc: asml.silence@xxxxxxxxx; Anuj Gupta <anuj20.g@xxxxxxxxxxx>; Kanchan
Joshi <joshi.k@xxxxxxxxxxx>
Subject: [PATCH 2/4] io_uring: add registered request arguments
Similarly to registered wait arguments we want to have a pre-mapped space
for various request arguments. Use the same parameter region, however as -
wait_args has different lifetime rules, add a new instance of struct
io_reg_args.
Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
include/linux/io_uring_types.h | 2 ++
io_uring/register.c | 3 +++
2 files changed, 5 insertions(+)
diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h
index 49008f00d064..cd6642855533 100644
--- a/include/linux/io_uring_types.h
+++ b/include/linux/io_uring_types.h
@@ -299,6 +299,8 @@ struct io_ring_ctx {
struct io_submit_state submit_state;
+ struct io_reg_args sqe_args;
+
/*
* Modifications are protected by ->uring_lock and -
mmap_lock.
* The flags, buf_pages and buf_nr_pages fields should be
stable diff --git a/io_uring/register.c b/io_uring/register.c index
b926eb053408..d2232b90a81d 100644
--- a/io_uring/register.c
+++ b/io_uring/register.c
@@ -607,6 +607,9 @@ static int io_register_mem_region(struct io_ring_ctx
*ctx, void __user *uarg)
ctx->wait_args.ptr = io_region_get_ptr(&ctx->param_region);
ctx->wait_args.size = rd.size;
}
+
+ ctx->sqe_args.ptr = io_region_get_ptr(&ctx->param_region);
+ ctx->sqe_args.size = rd.size;
Why not add an enum value against sqe_args? Will mixing it with
Not sure what you mean
IORING_MEM_REGION_REG_WAIT_ARG cause management confusion?
This specific region was added to be shared for multiple use
cases, the rest is up to the userspace. liburing will need to
have a clear API
--
Pavel Begunkov