From 65ce4d917f238631c473dd3c8f72f0fa35b52743 Mon Sep 17 00:00:00 2001
From: Gopinath P/Gopinath P
Date: Tue, 20 Jan 2026 20:47:16 +0530
Subject: [PATCH] plugin/ocp: Added OCP 2.7 smart extended log changes Updated
the smart extended log page structure, json and stdout print ocp2.7
enhancement.
Reviewed-by: Karthik Balan
Reviewed-by: Arunpandian J
Signed-off-by: Gopinath P/Gopinath P
---
plugins/ocp/ocp-print-json.c | 8 ++++++++
plugins/ocp/ocp-print-stdout.c | 8 ++++++++
plugins/ocp/ocp-smart-extended-log.h | 8 +++++---
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/plugins/ocp/ocp-print-json.c b/plugins/ocp/ocp-print-json.c
index a8c18ec18a..4a88ff2b23 100644
--- a/plugins/ocp/ocp-print-json.c
+++ b/plugins/ocp/ocp-print-json.c
@@ -226,6 +226,14 @@ static void json_smart_extended_log_v1(struct ocp_smart_extended_log *log)
case 0 ... 1:
break;
default:
+ case 6:
+ json_object_add_value_uint(root, "Form factor",
+ log->form_factor);
+ json_object_add_value_uint64(root, "Die use badnandblock raw",
+ int48_to_long(log->die_in_use_bad_nand_block_raw));
+ json_object_add_value_uint(root, "Die use badnandblock normal",
+ le16_to_cpu(log->die_in_use_bad_nand_block_normalized));
+ fallthrough;
case 5:
json_object_add_value_uint(root, "NVMe Over Pcie Errata Version",
log->nvme_over_pcie_errate_version);
diff --git a/plugins/ocp/ocp-print-stdout.c b/plugins/ocp/ocp-print-stdout.c
index 3c884c43a2..185b99a3ac 100644
--- a/plugins/ocp/ocp-print-stdout.c
+++ b/plugins/ocp/ocp-print-stdout.c
@@ -168,6 +168,14 @@ static void stdout_smart_extended_log(struct ocp_smart_extended_log *log, unsign
case 0 ... 1:
break;
default:
+ case 6:
+ printf(" Form factor %d\n",
+ log->form_factor);
+ printf(" Die in use badnandblock-Raw %"PRIu64"\n",
+ int48_to_long(log->die_in_use_bad_nand_block_raw));
+ printf(" Die in use badnandblock-Normal %d\n",
+ le16_to_cpu(log->die_in_use_bad_nand_block_normalized));
+ fallthrough;
case 5:
printf(" NVMe Over Pcie Errata Version %d\n",
log->nvme_over_pcie_errate_version);
diff --git a/plugins/ocp/ocp-smart-extended-log.h b/plugins/ocp/ocp-smart-extended-log.h
index 9ac52e508f..bbb2cefc1e 100644
--- a/plugins/ocp/ocp-smart-extended-log.h
+++ b/plugins/ocp/ocp-smart-extended-log.h
@@ -128,7 +128,7 @@ struct ocp_smart_extended_log {
__le16 total_die_failure_tolerance; /* [219:218] */
__le16 media_dies_offline; /* [221:220] */
__u8 max_temperature_recorded; /* [222] */
- __u8 rsvd223; /* [223] */
+ __u8 form_factor; /* [223] */
__le64 nand_avg_erase_count; /* [231:224] */
__le32 command_timeouts; /* [235:232] */
__le32 sys_area_program_fail_count_raw; /* [239:236] */
@@ -145,8 +145,10 @@ struct ocp_smart_extended_log {
__u8 lifetime_power_consumed[6]; /* [269:264] */
__u8 dssd_firmware_revision[8]; /* [277:270] */
__u8 dssd_firmware_build_uuid[16]; /* [293:278] */
- __u8 dssd_firmware_build_label[64]; /* [375:294] */
- __u8 rsvd358[136]; /* [493:358] */
+ __u8 dssd_firmware_build_label[64]; /* [357:294] */
+ __u8 die_in_use_bad_nand_block_raw[6]; /* [363:358] */
+ __le16 die_in_use_bad_nand_block_normalized; /* [365:364] */
+ __u8 rsvd358[128]; /* [493:358] */
__le16 log_page_version; /* [495:494] */
__u8 log_page_guid[16]; /* [511:496] */
};