public inbox for [email protected]
 help / color / mirror / Atom feed
From: Christoph Hellwig <[email protected]>
To: Kanchan Joshi <[email protected]>
Cc: "Christoph Hellwig" <[email protected]>,
	"Kanchan Joshi" <[email protected]>,
	"Jens Axboe" <[email protected]>, "Keith Busch" <[email protected]>,
	"Pavel Begunkov" <[email protected]>,
	[email protected], [email protected],
	[email protected], [email protected],
	[email protected], "Pankaj Raghav" <[email protected]>,
	"Javier González" <[email protected]>,
	"Luis Chamberlain" <[email protected]>,
	"Adam Manzanares" <[email protected]>,
	"Anuj Gupta" <[email protected]>
Subject: Re: [PATCH 17/17] nvme: enable non-inline passthru commands
Date: Thu, 10 Mar 2022 15:19:45 +0100	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+1E3rLaQstG8LWUyJrbK5Qz+AnNpOnAyoK-7H5foFm67BJeFA@mail.gmail.com>

On Thu, Mar 10, 2022 at 05:20:13PM +0530, Kanchan Joshi wrote:
> In sync ioctl, we always update this result field by doing put_user on
> completion.
> For async ioctl, since command is inside the the sqe, its lifetime is
> only upto submission. SQE may get reused post submission, leaving no
> way to update the "result" field on completion. Had this field been a
> pointer, we could have saved this on submission and updated on
> completion. But that would require redesigning this structure and
> adding newer ioctl in nvme.

Why would it required adding an ioctl to nvme?  The whole io_uring
async_cmd infrastructure is completely independent from ioctls.

> Coming back, even though sync-ioctl alway updates this result to
> user-space, only a few nvme io commands (e.g. zone-append, copy,
> zone-mgmt-send) can return this additional result (spec-wise).
> Therefore in nvme, when we are dealing with inline-sqe commands from
> io_uring, we never attempt to update the result. And since we don't
> update the result, we limit support to only read/write passthru
> commands. And fail any other command during submission itself (Patch
> 2).

Yikes.  That is outright horrible.  passthrough needs to be command
agnostic and future proof to any newly added nvme command.

> > Overly long line.
> 
> Under 100, but sure, can fold it under 80.

You can only use 100 sparingly if it makes the code more readable.  Which
I know is fuzzy, and in practice never does.  Certainly not in nvme and
block code.


  parent reply	other threads:[~2022-03-10 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[email protected]>
     [not found] ` <CGME20220308152716epcas5p3d38d2372c184259f1a10c969f7e4396f@epcas5p3.samsung.com>
     [not found]   ` <[email protected]>
     [not found]     ` <[email protected]>
2022-03-10 12:25       ` [PATCH 11/17] block: factor out helper for bio allocation from cache Kanchan Joshi
     [not found] ` <CGME20220308152714epcas5p4c5a0d16512fd7054c9a713ee28ede492@epcas5p4.samsung.com>
     [not found]   ` <[email protected]>
     [not found]     ` <[email protected]>
2022-03-10 12:40       ` [PATCH 10/17] block: wire-up support for plugging Kanchan Joshi
     [not found] ` <CGME20220308152729epcas5p17e82d59c68076eb46b5ef658619d65e3@epcas5p1.samsung.com>
     [not found]   ` <[email protected]>
     [not found]     ` <[email protected]>
     [not found]       ` <CA+1E3rLaQstG8LWUyJrbK5Qz+AnNpOnAyoK-7H5foFm67BJeFA@mail.gmail.com>
2022-03-10 14:19         ` Christoph Hellwig [this message]
     [not found]           ` <CA+1E3rL3Q2noHW-cD20SZyo9EqbzjF54F6TgZoUMMuZGkhkqnw@mail.gmail.com>
2022-03-11  6:27             ` [PATCH 17/17] nvme: enable non-inline passthru commands Christoph Hellwig
     [not found] ` <CGME20220308152702epcas5p1eb1880e024ac8b9531c85a82f31a4e78@epcas5p1.samsung.com>
     [not found]   ` <[email protected]>
2022-03-11  7:01     ` [PATCH 05/17] nvme: wire-up support for async-passthru on char-device Christoph Hellwig
2022-03-22 15:18     ` Clay Mayers

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [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