git: 36269290fcad - stable/14 - nvmecontrol: Move reservation notifcation page printing to little endian orderinng

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

URL: https://cgit.FreeBSD.org/src/commit/?id=36269290fcadcb617c5f02348bc056b3084d8311

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

    nvmecontrol: Move reservation notifcation page printing to little endian orderinng
    
    Sponsored by:           Netflix
    Reviewed by:            chuck
    Differential Revision:  https://reviews.freebsd.org/D44656
    
    (cherry picked from commit 3d28a9c608a382af669e22e9e8eda7fd0bc02cad)
---
 sbin/nvmecontrol/logpage.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c
index 67d296df6afb..b4f9996b10c2 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_RES_NOTIFICATION:
-		nvme_res_notification_page_swapbytes(
-		    (struct nvme_res_notification_page *)payload);
-		break;
 	case NVME_LOG_SANITIZE_STATUS:
 		nvme_sanitize_status_page_swapbytes(
 		    (struct nvme_sanitize_status_page *)payload);
@@ -473,9 +469,10 @@ print_log_res_notification(const struct nvme_controller_data *cdata __unused,
 	printf("Reservation Notification\n");
 	printf("========================\n");
 
-	printf("Log Page Count:                %ju\n", rn->log_page_count);
+	printf("Log Page Count:                %ju\n",
+	    (uintmax_t)letoh(rn->log_page_count));
 	printf("Log Page Type:                 ");
-	switch (rn->log_page_type) {
+	switch (letoh(rn->log_page_type)) {
 	case 0:
 		printf("Empty Log Page\n");
 		break;
@@ -489,11 +486,11 @@ print_log_res_notification(const struct nvme_controller_data *cdata __unused,
 		printf("Reservation Preempted\n");
 		break;
 	default:
-		printf("Unknown %x\n", rn->log_page_type);
+		printf("Unknown %x\n", letoh(rn->log_page_type));
 		break;
 	};
-	printf("Number of Available Log Pages: %d\n", rn->available_log_pages);
-	printf("Namespace ID:                  0x%x\n", rn->nsid);
+	printf("Number of Available Log Pages: %d\n", letoh(rn->available_log_pages));
+	printf("Namespace ID:                  0x%x\n", letoh(rn->nsid));
 }
 
 static void