Skip to content

Commit 53825af

Browse files
committed
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
1 parent 4983685 commit 53825af

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sys/dev/nvme/nvme.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,9 +1507,7 @@ struct nvme_namespace_data {
15071507
uint8_t eui64[8];
15081508

15091509
/** lba format support */
1510-
uint32_t lbaf[16];
1511-
1512-
uint8_t reserved7[192];
1510+
uint32_t lbaf[64];
15131511

15141512
uint8_t vendor_specific[3712];
15151513
} __packed __aligned(4);
@@ -2175,7 +2173,7 @@ void nvme_namespace_data_swapbytes(struct nvme_namespace_data *s __unused)
21752173
s->anagrpid = le32toh(s->anagrpid);
21762174
s->nvmsetid = le16toh(s->nvmsetid);
21772175
s->endgid = le16toh(s->endgid);
2178-
for (i = 0; i < 16; i++)
2176+
for (i = 0; i < 64; i++)
21792177
s->lbaf[i] = le32toh(s->lbaf[i]);
21802178
#endif
21812179
}

0 commit comments

Comments
 (0)