public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ming Lei <[email protected]>
To: Keith Busch <[email protected]>
Cc: [email protected], [email protected],
	[email protected], [email protected],
	Keith Busch <[email protected]>
Subject: Re: [PATCH 4/6] ublk: zc register/unregister bvec
Date: Sat, 8 Feb 2025 13:50:34 +0800	[thread overview]
Message-ID: <Z6bwqinHSZqWwYdu@fedora> (raw)
In-Reply-To: <[email protected]>

On Mon, Feb 03, 2025 at 07:45:15AM -0800, Keith Busch wrote:
> From: Keith Busch <[email protected]>
> 
> Provide new operations for the user to request mapping an active request
> to an io uring instance's buf_table. The user has to provide the index
> it wants to install the buffer.
> 
> A reference count is taken on the request to ensure it can't be
> completed while it is active in a ring's buf_table.
> 
> Signed-off-by: Keith Busch <[email protected]>
> ---
>  drivers/block/ublk_drv.c      | 139 +++++++++++++++++++++++++---------
>  include/uapi/linux/ublk_cmd.h |   4 +
>  2 files changed, 107 insertions(+), 36 deletions(-)
> 
> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index 529085181f355..58f224b5687b9 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -51,6 +51,9 @@
>  /* private ioctl command mirror */
>  #define UBLK_CMD_DEL_DEV_ASYNC	_IOC_NR(UBLK_U_CMD_DEL_DEV_ASYNC)
>  
> +#define UBLK_IO_REGISTER_IO_BUF		_IOC_NR(UBLK_U_IO_REGISTER_IO_BUF)
> +#define UBLK_IO_UNREGISTER_IO_BUF	_IOC_NR(UBLK_U_IO_UNREGISTER_IO_BUF)
> +

...

> @@ -1798,6 +1894,10 @@ static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd,
>  
>  	ret = -EINVAL;
>  	switch (_IOC_NR(cmd_op)) {
> +	case UBLK_IO_REGISTER_IO_BUF:
> +		return ublk_register_io_buf(cmd, ubq, tag, ub_cmd);
> +	case UBLK_IO_UNREGISTER_IO_BUF:
> +		return ublk_unregister_io_buf(cmd, ubq, tag, ub_cmd);

Here IO_BUF is kernel buffer, we have to make sure that it won't be
leaked.

Such as application panic, how to un-register it?


Thanks,
Ming


  reply	other threads:[~2025-02-08  5:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 15:45 [PATCH 0/6] ublk zero-copy support Keith Busch
2025-02-03 15:45 ` [PATCH 1/6] block: const blk_rq_nr_phys_segments request Keith Busch
2025-02-03 15:45 ` [PATCH 2/6] io_uring: use node for import Keith Busch
2025-02-03 15:45 ` [PATCH 3/6] io_uring: add support for kernel registered bvecs Keith Busch
2025-02-07 14:08   ` Pavel Begunkov
2025-02-07 15:17     ` Keith Busch
2025-02-08 15:49       ` Pavel Begunkov
2025-02-10 14:12   ` Ming Lei
2025-02-10 15:05     ` Keith Busch
2025-02-03 15:45 ` [PATCH 4/6] ublk: zc register/unregister bvec Keith Busch
2025-02-08  5:50   ` Ming Lei [this message]
2025-02-03 15:45 ` [PATCH 5/6] io_uring: add abstraction for buf_table rsrc data Keith Busch
2025-02-03 15:45 ` [PATCH 6/6] io_uring: cache nodes and mapped buffers Keith Busch
2025-02-07 12:41   ` Pavel Begunkov
2025-02-07 15:33     ` Keith Busch
2025-02-08 14:00       ` Pavel Begunkov
2025-02-07 15:59     ` Keith Busch
2025-02-08 14:24       ` Pavel Begunkov
2025-02-06 15:28 ` [PATCH 0/6] ublk zero-copy support Keith Busch
2025-02-07  3:51 ` Ming Lei
2025-02-07 14:06   ` Keith Busch
2025-02-08  5:44     ` Ming Lei
2025-02-08 14:16       ` Pavel Begunkov
2025-02-08 20:13         ` Keith Busch
2025-02-08 21:40           ` Pavel Begunkov
2025-02-08  7:52     ` Ming Lei
2025-02-08  0:51 ` Bernd Schubert

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=Z6bwqinHSZqWwYdu@fedora \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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