Skip to content

Commit 396fc4b

Browse files
author
Gopinath P/Gopinath P
committed
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 <[email protected]> Reviewed-by: Arunpandian J <[email protected]> Signed-off-by: Gopinath P <[email protected]>
1 parent c16be1f commit 396fc4b

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

plugins/ocp/ocp-print-json.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ static void json_smart_extended_log_v1(struct ocp_smart_extended_log *log)
226226
case 0 ... 1:
227227
break;
228228
default:
229+
case 6:
230+
json_object_add_value_uint(root, "Form factor",
231+
log->form_factor);
232+
json_object_add_value_uint(root, "Die in use bad nand block",
233+
le64_to_cpu(log->die_in_use_bad_nand_block));
234+
fallthrough;
229235
case 5:
230236
json_object_add_value_uint(root, "NVMe Over Pcie Errata Version",
231237
log->nvme_over_pcie_errate_version);

plugins/ocp/ocp-print-stdout.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ static void stdout_smart_extended_log(struct ocp_smart_extended_log *log, unsign
168168
case 0 ... 1:
169169
break;
170170
default:
171+
case 6:
172+
printf(" Form factor %d\n",
173+
log->form_factor);
174+
printf(" Die in use bad nand block %"PRIu64"\n",
175+
le64_to_cpu(log->die_in_use_bad_nand_block));
176+
fallthrough;
171177
case 5:
172178
printf(" NVMe Over Pcie Errata Version %d\n",
173179
log->nvme_over_pcie_errate_version);

plugins/ocp/ocp-smart-extended-log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static int get_c0_log_page(struct nvme_transport_handle *hdl, char *format,
4242
return ret;
4343
}
4444

45-
data = malloc(sizeof(__u8) * C0_SMART_CLOUD_ATTR_LEN);
45+
data = (struct ocp_smart_extended_log *) malloc(sizeof(__u8) * C0_SMART_CLOUD_ATTR_LEN);
4646
if (!data) {
4747
fprintf(stderr, "ERROR : OCP : malloc : %s\n", strerror(errno));
4848
return -1;

plugins/ocp/ocp-smart-extended-log.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct ocp_smart_extended_log {
128128
__le16 total_die_failure_tolerance; /* [219:218] */
129129
__le16 media_dies_offline; /* [221:220] */
130130
__u8 max_temperature_recorded; /* [222] */
131-
__u8 rsvd223; /* [223] */
131+
__u8 form_factor; /* [223] */
132132
__le64 nand_avg_erase_count; /* [231:224] */
133133
__le32 command_timeouts; /* [235:232] */
134134
__le32 sys_area_program_fail_count_raw; /* [239:236] */
@@ -145,8 +145,9 @@ struct ocp_smart_extended_log {
145145
__u8 lifetime_power_consumed[6]; /* [269:264] */
146146
__u8 dssd_firmware_revision[8]; /* [277:270] */
147147
__u8 dssd_firmware_build_uuid[16]; /* [293:278] */
148-
__u8 dssd_firmware_build_label[64]; /* [375:294] */
149-
__u8 rsvd358[136]; /* [493:358] */
148+
__u8 dssd_firmware_build_label[64]; /* [357:294] */
149+
__le64 die_in_use_bad_nand_block; /* [365:358] */
150+
__u8 rsvd358[128]; /* [493:358] */
150151
__le16 log_page_version; /* [495:494] */
151152
__u8 log_page_guid[16]; /* [511:496] */
152153
};

0 commit comments

Comments
 (0)