nvmecontrol: Remove an incorrect use of PAGE_SIZE

The mdts value is in terms of the nvme page size, not the host page
size. On many architectures these are both 4k, however on arm64 it is
possible to build a system with the host page size of 16k.

Use NVME_MPS_SHIFT to get the correct nvme page shift.

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D55334
This commit is contained in:
Andrew Turner
2026-02-18 14:20:57 +00:00
parent a6ad3d4ca0
commit bfb7c81f93
+1 -1
View File
@@ -106,7 +106,7 @@ nvme_print_controller(struct nvme_controller_data *cdata)
if (cdata->mdts == 0)
printf("Unlimited\n");
else
printf("%ld bytes\n", PAGE_SIZE * (1L << cdata->mdts));
printf("%ld bytes\n", 1L << (cdata->mdts + NVME_MPS_SHIFT));
printf("Sanitize Crypto Erase: %s\n",
NVMEV(NVME_CTRLR_DATA_SANICAP_CES, cdata->sanicap) != 0 ?
"Supported" : "Not Supported");