[PATCH 2/6] nvme: update nvme_id_ns OPTPERF constants

Christoph Hellwig hch at lst.de
Fri Feb 20 08:20:07 PST 2026


On Fri, Feb 20, 2026 at 08:17:29AM -0800, Caleb Sander Mateos wrote:
> On Fri, Feb 20, 2026 at 8:07 AM Christoph Hellwig <hch at lst.de> wrote:
> >
> > On Thu, Feb 19, 2026 at 08:28:05PM -0700, Caleb Sander Mateos wrote:
> > > Since NVM Command Spec 1.1, OPTPERF comprises both bits 4 and 5 of
> > > NSFEAT in the Identify Namespace structure. Replace NVME_NS_FEAT_IO_OPT,
> > > which represented only bit 4, with NVME_NS_FEAT_OPTPERF_SHIFT and
> > > NVME_NS_FEAT_OPTPERF_MASK.
> >
> > As you're deeper in this than me:  do the older specs require the
> > other bit to be cleared to zero and this is all compatible?  Or do
> > we need to guard it somehow?
> 
> In NVM Command Set spec 1.0 (NVMe version 2.0), OPTPERF is only bit 4
> of NSFEAT and the higher bits are reserved. I think it seems
> relatively safe to assume bit 5 will be reported as 0 on controllers
> advertising older NVMe versions, but you're correct that the host
> should technically check for version >= 2.1 before using bit 5. Let me
> know which approach you'd prefer.

Not entirely sure, but either way the code should have a big fat
comment about this.




More information about the Linux-nvme mailing list