Linux io-uring development
 help / color / mirror / Atom feed
From: lizetao <lizetao1@huawei.com>
To: Pavel Begunkov <asml.silence@gmail.com>,
	"io-uring@vger.kernel.org" <io-uring@vger.kernel.org>
Cc: Anuj Gupta <anuj20.g@samsung.com>, Kanchan Joshi <joshi.k@samsung.com>
Subject: RE: [PATCH 2/4] io_uring: add registered request arguments
Date: Mon, 6 Jan 2025 11:33:42 +0000	[thread overview]
Message-ID: <4cda935c978f48ceac6d69dd2e9587f9@huawei.com> (raw)
In-Reply-To: <cb3cc963ad684d5687b90f28ff9d928a20f80b76.1735301337.git.asml.silence@gmail.com>

Hi,

> -----Original Message-----
> From: Pavel Begunkov <asml.silence@gmail.com>
> Sent: Monday, December 30, 2024 9:30 PM
> To: io-uring@vger.kernel.org
> Cc: asml.silence@gmail.com; Anuj Gupta <anuj20.g@samsung.com>; Kanchan
> Joshi <joshi.k@samsung.com>
> 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@gmail.com>
> ---
>  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
IORING_MEM_REGION_REG_WAIT_ARG cause management confusion?
>  	return 0;
>  }
> 
> --
> 2.47.1
> 

---
Li Zetao

  reply	other threads:[~2025-01-06 11:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-30 13:30 [RFC 0/4] pre-mapped rw attributes Pavel Begunkov
2024-12-30 13:30 ` [PATCH 1/4] io_uring: add structure for registered arguments Pavel Begunkov
2024-12-30 13:30 ` [PATCH 2/4] io_uring: add registered request arguments Pavel Begunkov
2025-01-06 11:33   ` lizetao [this message]
2025-01-06 16:40     ` Pavel Begunkov
2024-12-30 13:30 ` [PATCH 3/4] io_uring/rw: use READ_ONCE with rw attributes Pavel Begunkov
2024-12-30 13:30 ` [PATCH 4/4] io_uring/rw: pre-mapped " Pavel Begunkov
2025-01-06 11:13   ` lizetao
2025-01-06 16:53     ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4cda935c978f48ceac6d69dd2e9587f9@huawei.com \
    --to=lizetao1@huawei.com \
    --cc=anuj20.g@samsung.com \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    --cc=joshi.k@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox