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

From: Caleb Sander Mateos

Date: Fri Feb 20 2026 - 11:20:39 EST


On Fri, Feb 20, 2026 at 8:07 AM Christoph Hellwig <hch@xxxxxx> 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.

Thanks,
Caleb