Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109838887
D44654.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D44654.id.diff
View Options
diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c
--- a/sbin/nvmecontrol/logpage.c
+++ b/sbin/nvmecontrol/logpage.c
@@ -219,10 +219,6 @@
/* Convert data to host endian */
switch (log_page) {
- case NVME_LOG_DEVICE_SELF_TEST:
- nvme_device_self_test_swapbytes(
- (struct nvme_device_self_test_page *)payload);
- break;
case NVME_LOG_COMMAND_EFFECT:
nvme_command_effects_page_swapbytes(
(struct nvme_command_effects_page *)payload);
@@ -573,13 +569,14 @@
{
struct nvme_device_self_test_page *dst;
uint32_t r;
+ uint16_t vs;
dst = buf;
printf("Device Self-test Status\n");
printf("=======================\n");
printf("Current Operation: ");
- switch (dst->curr_operation) {
+ switch (letoh(dst->curr_operation)) {
case 0x0:
printf("No device self-test operation in progress\n");
break;
@@ -593,19 +590,20 @@
printf("Vendor specific\n");
break;
default:
- printf("Reserved (0x%x)\n", dst->curr_operation);
+ printf("Reserved (0x%x)\n", letoh(dst->curr_operation));
}
- if (dst->curr_operation != 0)
- printf("Current Completion: %u%%\n", dst->curr_compl & 0x7f);
+ if (letoh(dst->curr_operation) != 0)
+ printf("Current Completion: %u%%\n", letoh(dst->curr_compl) & 0x7f);
printf("Results\n");
for (r = 0; r < 20; r++) {
uint64_t failing_lba;
- uint8_t code, res;
+ uint8_t code, res, status;
- code = (dst->result[r].status >> 4) & 0xf;
- res = dst->result[r].status & 0xf;
+ status = letoh(dst->result[r].status);
+ code = (status >> 4) & 0xf;
+ res = status & 0xf;
if (res == 0xf)
continue;
@@ -630,21 +628,24 @@
printf(" Reserved status 0x%x", res);
if (res == 7)
- printf(" starting in segment %u", dst->result[r].segment_num);
+ printf(" starting in segment %u",
+ letoh(dst->result[r].segment_num));
#define BIT(b) (1 << (b))
- if (dst->result[r].valid_diag_info & BIT(0))
- printf(" NSID=0x%x", dst->result[r].nsid);
- if (dst->result[r].valid_diag_info & BIT(1)) {
+ if (letoh(dst->result[r].valid_diag_info) & BIT(0))
+ printf(" NSID=0x%x", letoh(dst->result[r].nsid));
+ if (letoh(dst->result[r].valid_diag_info) & BIT(1)) {
memcpy(&failing_lba, dst->result[r].failing_lba,
sizeof(failing_lba));
- printf(" FLBA=0x%jx", failing_lba);
+ printf(" FLBA=0x%jx", (uintmax_t)letoh(failing_lba));
}
- if (dst->result[r].valid_diag_info & BIT(2))
- printf(" SCT=0x%x", dst->result[r].status_code_type);
- if (dst->result[r].valid_diag_info & BIT(3))
- printf(" SC=0x%x", dst->result[r].status_code);
+ if (letoh(dst->result[r].valid_diag_info) & BIT(2))
+ printf(" SCT=0x%x", letoh(dst->result[r].status_code_type));
+ if (letoh(dst->result[r].valid_diag_info) & BIT(3))
+ printf(" SC=0x%x", letoh(dst->result[r].status_code));
#undef BIT
+ memcpy(&vs, dst->result[r].vendor_specific, sizeof(vs));
+ printf(" VENDOR_SPECIFIC=0x%x", letoh(vs));
printf("\n");
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 11, 4:49 AM (27 m, 58 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16589025
Default Alt Text
D44654.id.diff (2 KB)
Attached To
Mode
D44654: nvmecontrol: Move self test status page printing to little endian orderinng
Attached
Detach File
Event Timeline
Log In to Comment