linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Daniel Wagner <dwagner@suse.de>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	Sagi Grimberg <sagi@grimberg.me>, Hannes Reinecke <hare@suse.de>
Subject: Re: [RFC v1] nvme: add cse, ds, ms, nsze and nuse to sysfs
Date: Tue, 28 Nov 2023 12:02:58 -0700	[thread overview]
Message-ID: <ZWY5YkYJ4Pf0meiD@kbusch-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20231128130508.GA8221@lst.de>

On Tue, Nov 28, 2023 at 02:05:08PM +0100, Christoph Hellwig wrote:
> On Mon, Nov 27, 2023 at 09:46:43AM -0700, Keith Busch wrote:
> > > 
> > > Yes.  But does it care about the tuple size, or the actual size of the
> > > metadata field even if is bigger than the PI tuple?
> > 
> > tuple_size is the same value as metadata size regardless of PI usage.
> > See nvme_init_integrity() for how this driver sets it:
> > 
> > 	integrity.tuple_size = ns->ms;
> 
> Yes, for the case where we actually support integrity in the kernel
> for a given device.  But if the device has a metadata size larger than
> the PI size we still support it, and just let the device strip/insert
> the PI.

I'm pretty sure that isn't right. We already support PI regardless of
the metadata size as long as the PI field is in the first 8 bytes.
Strip/insert doesn't even work if metadata is larger than a PI field.
For any metadata case where PI isn't used, the driver requests
allocating an empty buffer for the purpose.

> And if nvme-cli wants to report detailed information about
> the namespace it probably needs to report the actual metadata size
> as the tuple size won't be reported given that we're never initializing
> the kernel PI support.

I don't understand. For any namespace with a metadata size, even if the
namespace format doesn't have PI support, we still register an
"integrity" profile with no-ops to get that unused buffer just so the
block layer can access the format. We alyways set the tuple_size to the
namespace metadata-size so the kernel buffer is correctly sized.

This all works as long as the metadata is separate (not extended) and
kernel has CONFIG_BLK_DEV_INTEGRITY.


      reply	other threads:[~2023-11-28 19:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 10:32 [RFC v1] nvme: add cse, ds, ms, nsze and nuse to sysfs Daniel Wagner
2023-11-27 10:44 ` Keith Busch
2023-11-27 12:07   ` Daniel Wagner
2023-11-27 13:57     ` Christoph Hellwig
2023-11-27 14:18 ` Christoph Hellwig
2023-11-27 15:44   ` Keith Busch
2023-11-27 15:56     ` Christoph Hellwig
2023-11-27 16:30       ` Keith Busch
2023-11-27 16:33         ` Christoph Hellwig
2023-11-27 16:46           ` Keith Busch
2023-11-28  8:21             ` Daniel Wagner
2023-11-28 10:06               ` Sagi Grimberg
2023-11-28 13:05             ` Christoph Hellwig
2023-11-28 19:02               ` 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=ZWY5YkYJ4Pf0meiD@kbusch-mbp.dhcp.thefacebook.com \
    --to=kbusch@kernel.org \
    --cc=dwagner@suse.de \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).