From: Keith Busch <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: VU NVMe commadns with io_uring? NVME_URING_CMD_IO
Date: Thu, 18 Apr 2024 12:17:20 -0600 [thread overview]
Message-ID: <ZiFjsICii8guw5rP@kbusch-mbp> (raw)
In-Reply-To: <DM8PR11MB5717EA70F88545314961D862810E2@DM8PR11MB5717.namprd11.prod.outlook.com>
On Thu, Apr 18, 2024 at 05:24:15PM +0000, [email protected] wrote:
> HI Folks!
>
> Trying to send down some vendor unique NVMe commands with io_uring and fixed buffers via NVME_URING_CMD_IO.
>
> I have no issues sending standard NVMe read/write requests, but we are working on some VU commands which have
> buffer and length in different command payload offsets. So I'm trying to find where io_uring populates the NVMe cmd
> payload for a "write" (outbound) or "read" inbound request.
>
> This percolates into drivers/nvme/host/ioctl.c: nvme_uring_cmd_io() as expected where io_uring_cmd points to the
> expected cmd payload and a local struct nvme_command is created to be encoded into a user request via
> nvme_alloc_user_request() call.
>
> Within the nvme_alloc_user_request() call nvme_init_request() is called which performs a
> memcpy(nvme_req(req)->cmd,cmd, sizeof(*cmd)); which is basically copying the local
> struct nvme_command to the request structure. The issue though is the buffer and length
> are not populated in the cmd payload at this time.
>
> Instead this happens somewhere else at I/O processing time which I haven't found yet.
> I'm trying to track that location down and was wondering if I'm on the right path here or not.
Right after nvme_init_request(), the data payload is attached to the
struct request in nvme_map_user_request(), which works for both fixed
and unregistered buffers.
The payload gets attached to the nvme command later after dispatching
the request through the block layer. Assuming your nvme is PCI, that
happens in nvme_map_data().
> Any suggestions on where this update occurs would be incredibly useful. Also we're hoping
> to have multiple fixed buffers for a specific command specified within the cmd payload
> In order to provide for extended key data on the commands. Essentially providing KV support
> for store/retrieve of keys larger than what can fit in the command payload.
>
> We're on a path to use fixed buffers and to be able to map them on demand for the VU
> commands, but inserting them into the command payload is the missing point at present.
prev parent reply other threads:[~2024-04-18 18:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 17:24 VU NVMe commadns with io_uring? NVME_URING_CMD_IO Doug.Coatney
2024-04-18 18:17 ` Keith Busch [this message]
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=ZiFjsICii8guw5rP@kbusch-mbp \
[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