Re: git: 53825afc5dd1 - main - nvme: There's 64 LBAF descriptors, not 16
- In reply to: Warner Losh : "git: 53825afc5dd1 - main - nvme: There's 64 LBAF descriptors, not 16"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 10 Oct 2025 12:53:24 UTC
On 10/9/25 20:21, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=53825afc5dd13f3d16c3db6727260d7184bcd581 > > commit 53825afc5dd13f3d16c3db6727260d7184bcd581 > Author: Warner Losh <imp@FreeBSD.org> > AuthorDate: 2025-10-10 00:16:47 +0000 > Commit: Warner Losh <imp@FreeBSD.org> > CommitDate: 2025-10-10 00:19:04 +0000 > > nvme: There's 64 LBAF descriptors, not 16 > > Older versions of the standard were limited to 16, but the actual limit > is 64. Bump the limit to 64. This should be a #define, but there's no > good standardized name, so I'm punting on that. All the places that use > it, apart from the byte swapping code, do the right thing and use the > nlbaf field to limit what to access. > > Sponsored by: Netflix > --- > sys/dev/nvme/nvme.h | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h > index 17c5cdb4db87..57cb37907e65 100644 > --- a/sys/dev/nvme/nvme.h > +++ b/sys/dev/nvme/nvme.h > @@ -1507,9 +1507,7 @@ struct nvme_namespace_data { > uint8_t eui64[8]; > > /** lba format support */ > - uint32_t lbaf[16]; > - > - uint8_t reserved7[192]; > + uint32_t lbaf[64]; > > uint8_t vendor_specific[3712]; > } __packed __aligned(4); > @@ -2175,7 +2173,7 @@ void nvme_namespace_data_swapbytes(struct nvme_namespace_data *s __unused) > s->anagrpid = le32toh(s->anagrpid); > s->nvmsetid = le16toh(s->nvmsetid); > s->endgid = le16toh(s->endgid); > - for (i = 0; i < 16; i++) > + for (i = 0; i < 64; i++) > s->lbaf[i] = le32toh(s->lbaf[i]); You could use `nitems(s->lbaf)` instead of 64 in this loop. -- John Baldwin