public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Kanchan Joshi <joshi.k@samsung.com>,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH 6/7] nvme: also return I/O command effects from nvme_command_effects
Date: Tue, 13 Dec 2022 10:53:07 -0700	[thread overview]
Message-ID: <Y5i8A84jGCnvLnbD@kbusch-mbp> (raw)
In-Reply-To: <20221213162453.584965-7-hch@lst.de>

On Tue, Dec 13, 2022 at 05:24:52PM +0100, Christoph Hellwig wrote:
> +static u32 nvme_known_nvm_effects(u8 opcode)
> +{
> +	switch (opcode) {
> +	case nvme_cmd_write:
> +	case nvme_cmd_write_zeroes:
> +		return NVME_CMD_EFFECTS_LBCC;
> +	default:
> +		return 0;
> +	}
> +}

Also nvme_cmd_write_uncorr.

I think you'd need to know the namespace's command set to assume these
opcodes, though.

I was thinking instead of appending effects per-IO, we could always set
ns->head->effects even if the device doesn't support the log page, then
overwrite the log page's opcodes with known LBCC effects during
initialization. That way we don't need a per-io check. Does that sound
reasonable?


  reply	other threads:[~2022-12-13 17:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 16:24 only allow unprivileged passthrough for commands without effects Christoph Hellwig
2022-12-13 16:24 ` [PATCH 1/7] nvmet: use NVME_CMD_EFFECTS_CSUPP instead of open coding it Christoph Hellwig
2022-12-14  4:46   ` Chaitanya Kulkarni
2022-12-13 16:24 ` [PATCH 2/7] nvmet: set the LBCC bit for commands that modify data Christoph Hellwig
2022-12-14  4:47   ` Chaitanya Kulkarni
2022-12-13 16:24 ` [PATCH 3/7] nvmet: allow async passthrough of commands that change logical block contents Christoph Hellwig
2022-12-14  4:52   ` Chaitanya Kulkarni
2022-12-14  7:59     ` Christoph Hellwig
2022-12-13 16:24 ` [PATCH 4/7] nvme: remove nvme_execute_passthru_rq Christoph Hellwig
2022-12-14  4:54   ` Chaitanya Kulkarni
2022-12-13 16:24 ` [PATCH 5/7] nvme: only return actual effects from nvme_command_effects Christoph Hellwig
2022-12-13 16:24 ` [PATCH 6/7] nvme: also return I/O command " Christoph Hellwig
2022-12-13 17:53   ` Keith Busch [this message]
2022-12-13 18:54     ` Christoph Hellwig
2022-12-13 19:18       ` Keith Busch
2022-12-14  7:58         ` Christoph Hellwig
2022-12-13 16:24 ` [PATCH 7/7] nvme: don't allow unprivileged passthrough of commands that have effects Christoph Hellwig

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=Y5i8A84jGCnvLnbD@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=hch@lst.de \
    --cc=joshi.k@samsung.com \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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