From 83018b798795efc43d8ee9e5fa0aee0e7ab6d648 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 6 Jan 2020 01:51:23 +0000 Subject: [PATCH] Fix host memory buffer sizes reporting. Hardware reports values in 4KB units, not in bytes. MFC after: 3 days --- sbin/nvmecontrol/identify_ext.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/nvmecontrol/identify_ext.c b/sbin/nvmecontrol/identify_ext.c index 176564e974ee..93afcf3595c4 100644 --- a/sbin/nvmecontrol/identify_ext.c +++ b/sbin/nvmecontrol/identify_ext.c @@ -192,8 +192,10 @@ nvme_print_controller(struct nvme_controller_data *cdata) uint128_to_str(to128(cdata->untncap.unvmcap), cbuf, sizeof(cbuf))); } - printf("Host Buffer Preferred Size: %d bytes\n", cdata->hmpre); - printf("Host Buffer Minimum Size: %d bytes\n", cdata->hmmin); + printf("Host Buffer Preferred Size: %llu bytes\n", + (long long unsigned)cdata->hmpre * 4096); + printf("Host Buffer Minimum Size: %llu bytes\n", + (long long unsigned)cdata->hmmin * 4096); printf("\n"); printf("NVM Command Set Attributes\n");