git: 71484bbbfff3 - stable/14 - nvmecontrol: Move command effeccts page printing to little endian orderinng

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 27 Aug 2024 01:06:43 UTC
The branch stable/14 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=71484bbbfff3cb93be026749cde3af55ab885c2f

commit 71484bbbfff3cb93be026749cde3af55ab885c2f
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-04-16 22:36:25 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-08-26 18:31:03 +0000

    nvmecontrol: Move command effeccts page printing to little endian orderinng
    
    Sponsored by:           Netflix
    Reviewed by:            chuck
    Differential Revision:  https://reviews.freebsd.org/D44655
    
    (cherry picked from commit b850caf7b7099636fd4323cb47a82f5201309fed)
---
 sbin/nvmecontrol/logpage.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c
index 897bb7a59118..67d296df6afb 100644
--- a/sbin/nvmecontrol/logpage.c
+++ b/sbin/nvmecontrol/logpage.c
@@ -220,10 +220,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp,
 
 	/* Convert data to host endian */
 	switch (log_page) {
-	case NVME_LOG_COMMAND_EFFECT:
-		nvme_command_effects_page_swapbytes(
-		    (struct nvme_command_effects_page *)payload);
-		break;
 	case NVME_LOG_RES_NOTIFICATION:
 		nvme_res_notification_page_swapbytes(
 		    (struct nvme_res_notification_page *)payload);
@@ -442,7 +438,7 @@ print_log_command_effects(const struct nvme_controller_data *cdata __unused,
 	printf("  Command\tLBCC\tNCC\tNIC\tCCC\tCSE\tUUID\n");
 
 	for (i = 0; i < 255; i++) {
-		s = ce->acs[i];
+		s = letoh(ce->acs[i]);
 		if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0)
 			continue;
 		printf("Admin\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i,
@@ -454,7 +450,7 @@ print_log_command_effects(const struct nvme_controller_data *cdata __unused,
 		    NVMEV(NVME_CE_PAGE_UUID, s) != 0 ? "Yes" : "No");
 	}
 	for (i = 0; i < 255; i++) {
-		s = ce->iocs[i];
+		s = letoh(ce->iocs[i]);
 		if (NVMEV(NVME_CE_PAGE_CSUP, s) == 0)
 			continue;
 		printf("I/O\t%02x\t%s\t%s\t%s\t%s\t%u\t%s\n", i,