aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2024-04-16 22:36:31 +0000
committerWarner Losh <imp@FreeBSD.org>2024-04-17 03:30:18 +0000
commit3d28a9c608a382af669e22e9e8eda7fd0bc02cad (patch)
treeb28de81d47e6079cc19ea277bcf3145a11c1a7b0 /sbin
parentb850caf7b7099636fd4323cb47a82f5201309fed (diff)
downloadsrc-3d28a9c608a382af669e22e9e8eda7fd0bc02cad.tar.gz
src-3d28a9c608a382af669e22e9e8eda7fd0bc02cad.zip
nvmecontrol: Move reservation notifcation page printing to little endian orderinng
Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44656
Diffstat (limited to 'sbin')
-rw-r--r--sbin/nvmecontrol/logpage.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c
index bdabc1078166..2ab97294e976 100644
--- a/sbin/nvmecontrol/logpage.c
+++ b/sbin/nvmecontrol/logpage.c
@@ -219,10 +219,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);
@@ -472,9 +468,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;
@@ -488,11 +485,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