diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-03 08:17:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-03 08:17:29 +0000 |
commit | 61c4ff8b2ddc3841050c17a5f87791653dbd2b7b (patch) | |
tree | e97b4f25c511372d73bdd96c389c5f468d99138a /plugins/solidigm | |
parent | Adding upstream version 2.4. (diff) | |
download | nvme-cli-573fa445a5a78b3fa054676bf7d8c806b52c8994.tar.xz nvme-cli-573fa445a5a78b3fa054676bf7d8c806b52c8994.zip |
Adding upstream version 2.4+really2.3.upstream/2.4+really2.3
This reverts commit f42531334c05b7f49ae43c0a27e347a487fb2667.
Diffstat (limited to 'plugins/solidigm')
-rw-r--r-- | plugins/solidigm/meson.build | 1 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-garbage-collection.c | 32 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-latency-tracking.c | 22 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-nvme.c | 10 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-nvme.h | 3 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-smart.c | 34 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-telemetry.c | 2 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-telemetry/cod.c | 8 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-telemetry/config.c | 12 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-telemetry/config.h | 5 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-telemetry/data-area.c | 48 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-telemetry/header.c | 32 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-telemetry/telemetry-log.h | 6 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-util.c | 20 | ||||
-rw-r--r-- | plugins/solidigm/solidigm-util.h | 10 |
15 files changed, 76 insertions, 169 deletions
diff --git a/plugins/solidigm/meson.build b/plugins/solidigm/meson.build index 526fb02..bca13bb 100644 --- a/plugins/solidigm/meson.build +++ b/plugins/solidigm/meson.build @@ -1,5 +1,4 @@ sources += [ - 'plugins/solidigm/solidigm-util.c', 'plugins/solidigm/solidigm-smart.c', 'plugins/solidigm/solidigm-garbage-collection.c', 'plugins/solidigm/solidigm-latency-tracking.c', diff --git a/plugins/solidigm/solidigm-garbage-collection.c b/plugins/solidigm/solidigm-garbage-collection.c index 3828b9e..8e2eccc 100644 --- a/plugins/solidigm/solidigm-garbage-collection.c +++ b/plugins/solidigm/solidigm-garbage-collection.c @@ -19,7 +19,6 @@ #include "linux/types.h" #include "nvme-print.h" #include "solidigm-garbage-collection.h" -#include "solidigm-util.h" typedef struct __attribute__((packed)) gc_item { __le32 timer_type; @@ -50,11 +49,9 @@ static void vu_gc_log_show_json(garbage_control_collection_log_t *payload, const json_free_object(gc_entries); } -static void vu_gc_log_show(garbage_control_collection_log_t *payload, const char *devname, - __u8 uuid_index) +static void vu_gc_log_show(garbage_control_collection_log_t *payload, const char *devname) { - printf("Solidigm Garbage Collection Log for NVME device:%s UUID-idx:%d\n", devname, - uuid_index); + printf("Solidigm Garbage Collection Log for NVME device: %s\n", devname); printf("Timestamp Timer Type\n"); for (int i = 0; i < VU_GC_MAX_ITEMS; i++) { @@ -68,7 +65,6 @@ int solidigm_get_garbage_collection_log(int argc, char **argv, struct command *c const char *desc = "Get and parse Solidigm vendor specific garbage collection event log."; struct nvme_dev *dev; int err; - __u8 uuid_index; struct config { char *output_format; @@ -94,36 +90,18 @@ int solidigm_get_garbage_collection_log(int argc, char **argv, struct command *c return EINVAL; } - uuid_index = solidigm_get_vu_uuid_index(dev); - garbage_control_collection_log_t gc_log; const int solidigm_vu_gc_log_id = 0xfd; - struct nvme_get_log_args args = { - .lpo = 0, - .result = NULL, - .log = &gc_log, - .args_size = sizeof(args), - .fd = dev_fd(dev), - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .lid = solidigm_vu_gc_log_id, - .len = sizeof(gc_log), - .nsid = NVME_NSID_ALL, - .csi = NVME_CSI_NVM, - .lsi = NVME_LOG_LSI_NONE, - .lsp = NVME_LOG_LSP_NONE, - .uuidx = uuid_index, - .rae = false, - .ot = false, - }; - err = nvme_get_log(&args); + err = nvme_get_log_simple(dev_fd(dev), solidigm_vu_gc_log_id, + sizeof(gc_log), &gc_log); if (!err) { if (flags & BINARY) { d_raw((unsigned char *)&gc_log, sizeof(gc_log)); } else if (flags & JSON) { vu_gc_log_show_json(&gc_log, dev->name); } else { - vu_gc_log_show(&gc_log, dev->name, uuid_index); + vu_gc_log_show(&gc_log, dev->name); } } else if (err > 0) { diff --git a/plugins/solidigm/solidigm-latency-tracking.c b/plugins/solidigm/solidigm-latency-tracking.c index 40edcfa..1013ae8 100644 --- a/plugins/solidigm/solidigm-latency-tracking.c +++ b/plugins/solidigm/solidigm-latency-tracking.c @@ -17,7 +17,6 @@ #include "plugin.h" #include "linux/types.h" #include "nvme-print.h" -#include "solidigm-util.h" #define BUCKET_LIST_SIZE_4_0 152 #define BUCKET_LIST_SIZE_4_1 1216 @@ -43,7 +42,6 @@ struct config { struct latency_tracker { int fd; - __u8 uuid_index; struct config cfg; enum nvme_print_flags print_flags; struct latency_statistics stats; @@ -215,7 +213,6 @@ static void latency_tracker_pre_parse(struct latency_tracker *lt) if (lt->print_flags == NORMAL) { printf("Solidigm IO %s Command Latency Tracking Statistics type %d\n", lt->cfg.write ? "Write" : "Read", lt->cfg.type); - printf("UUID-idx: %d\n", lt->uuid_index); printf("Major Revision: %u\nMinor Revision: %u\n", le16_to_cpu(lt->stats.version_major), le16_to_cpu(lt->stats.version_minor)); if (lt->has_average_latency_field) { @@ -279,12 +276,12 @@ static int latency_tracking_is_enable(struct latency_tracker *lt, __u32 * enable { struct nvme_get_features_args args_get = { .args_size = sizeof(args_get), - .fd = lt->fd, - .uuidx = lt->uuid_index, + .fd = lt->fd, .fid = LATENCY_TRACKING_FID, .nsid = 0, .sel = 0, .cdw11 = 0, + .uuidx = 0, .data_len = LATENCY_TRACKING_FID_DATA_LEN, .data = NULL, .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, @@ -310,12 +307,12 @@ static int latency_tracking_enable(struct latency_tracker *lt) struct nvme_set_features_args args_set = { .args_size = sizeof(args_set), .fd = lt->fd, - .uuidx = lt->uuid_index, .fid = LATENCY_TRACKING_FID, .nsid = 0, .cdw11 = lt->cfg.enable, .cdw12 = 0, .save = 0, + .uuidx = 0, .cdw15 = 0, .data_len = LATENCY_TRACKING_FID_DATA_LEN, .data = NULL, @@ -331,8 +328,8 @@ static int latency_tracking_enable(struct latency_tracker *lt) fprintf(stderr, "Command failed while parsing.\n"); } else { if (lt->print_flags == NORMAL) { - printf("Successfully set enable bit for UUID-idx:%d FID:0x%X, to %i.\n", - lt->uuid_index, LATENCY_TRACKING_FID, lt->cfg.enable); + printf("Successfully set enable bit for FID (0x%X) to %i.\n", + LATENCY_TRACKING_FID, lt->cfg.enable); } } return err; @@ -359,7 +356,6 @@ static int latency_tracker_get_log(struct latency_tracker *lt) .log = <->stats, .args_size = sizeof(args), .fd = lt->fd, - .uuidx = lt->uuid_index, .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, .lid = lt->cfg.write ? WRITE_LOG_ID : READ_LOG_ID, .len = sizeof(lt->stats), @@ -367,6 +363,7 @@ static int latency_tracker_get_log(struct latency_tracker *lt) .csi = NVME_CSI_NVM, .lsi = NVME_LOG_LSI_NONE, .lsp = lt->cfg.type, + .uuidx = NVME_UUID_NONE, .rae = false, .ot = false, }; @@ -393,7 +390,6 @@ int solidigm_get_latency_tracking_log(int argc, char **argv, struct command *cmd int err; struct latency_tracker lt = { - .uuid_index = 0, .cfg = { .output_format = "normal", }, @@ -437,8 +433,6 @@ int solidigm_get_latency_tracking_log(int argc, char **argv, struct command *cmd return EINVAL; } - lt.uuid_index = solidigm_get_vu_uuid_index(dev); - err = latency_tracking_enable(<); if (err){ dev_close(dev); @@ -468,8 +462,8 @@ int solidigm_get_latency_tracking_log(int argc, char **argv, struct command *cmd putchar(enabled); } else { printf( - "Latency Statistics Tracking (UUID-idx:%d, FID:0x%X) is currently %i.\n", - lt.uuid_index, LATENCY_TRACKING_FID, enabled); + "Latency Statistics Tracking (FID 0x%X) is currently (%i).\n", + LATENCY_TRACKING_FID, enabled); } } else { fprintf(stderr, "Could not read feature id 0xE2.\n"); diff --git a/plugins/solidigm/solidigm-nvme.c b/plugins/solidigm/solidigm-nvme.c index 0e42bd6..b547035 100644 --- a/plugins/solidigm/solidigm-nvme.c +++ b/plugins/solidigm/solidigm-nvme.c @@ -14,9 +14,7 @@ #include "solidigm-garbage-collection.h" #include "solidigm-latency-tracking.h" #include "solidigm-telemetry.h" - #include "plugins/ocp/ocp-clear-fw-update-history.h" -#include "plugins/ocp/ocp-smart-extended-log.h" static int get_additional_smart_log(int argc, char **argv, struct command *cmd, struct plugin *plugin) { @@ -39,13 +37,7 @@ static int get_telemetry_log(int argc, char **argv, struct command *cmd, struct } static int clear_fw_update_history(int argc, char **argv, struct command *cmd, - struct plugin *plugin) + struct plugin *plugin) { return ocp_clear_fw_update_history(argc, argv, cmd, plugin); } - -static int smart_cloud(int argc, char **argv, struct command *cmd, - struct plugin *plugin) -{ - return ocp_smart_add_log(argc, argv, cmd, plugin); -} diff --git a/plugins/solidigm/solidigm-nvme.h b/plugins/solidigm/solidigm-nvme.h index 1fdc6a6..778dbf9 100644 --- a/plugins/solidigm/solidigm-nvme.h +++ b/plugins/solidigm/solidigm-nvme.h @@ -13,12 +13,11 @@ #include "cmd.h" -#define SOLIDIGM_PLUGIN_VERSION "0.8" +#define SOLIDIGM_PLUGIN_VERSION "0.7" PLUGIN(NAME("solidigm", "Solidigm vendor specific extensions", SOLIDIGM_PLUGIN_VERSION), COMMAND_LIST( ENTRY("smart-log-add", "Retrieve Solidigm SMART Log", get_additional_smart_log) - ENTRY("vs-smart-add-log", "Get SMART / health extended log (redirects to ocp plug-in)", smart_cloud) ENTRY("garbage-collect-log", "Retrieve Garbage Collection Log", get_garbage_collection_log) ENTRY("latency-tracking-log", "Enable/Retrieve Latency tracking Log", get_latency_tracking_log) ENTRY("parse-telemetry-log", "Parse Telemetry Log binary", get_telemetry_log) diff --git a/plugins/solidigm/solidigm-smart.c b/plugins/solidigm/solidigm-smart.c index 568d3ab..77c26ac 100644 --- a/plugins/solidigm/solidigm-smart.c +++ b/plugins/solidigm/solidigm-smart.c @@ -19,7 +19,6 @@ #include "nvme-print.h" #include "solidigm-smart.h" -#include "solidigm-util.h" struct __attribute__((packed)) nvme_additional_smart_log_item { __u8 id; @@ -180,13 +179,12 @@ static void vu_smart_log_show_json(vu_smart_log_t *payload, unsigned int nsid, c json_free_object(root); } -static void vu_smart_log_show(vu_smart_log_t *payload, unsigned int nsid, const char *devname, - __u8 uuid_index) +static void vu_smart_log_show(vu_smart_log_t *payload, unsigned int nsid, const char *devname) { smart_log_item_t *item = payload->item; - printf("Additional Smart Log for NVMe device:%s namespace-id:%x UUID-idx:%d\n", - devname, nsid, uuid_index); + printf("Additional Smart Log for NVME device:%s namespace-id:%x\n", + devname, nsid); printf("ID KEY Normalized Raw\n"); for (int i = 0; i < VU_SMART_MAX_ITEMS; i++) { @@ -203,7 +201,6 @@ int solidigm_get_additional_smart_log(int argc, char **argv, struct command *cmd enum nvme_print_flags flags; struct nvme_dev *dev; int err; - __u8 uuid_index; struct config { __u32 namespace_id; @@ -232,27 +229,8 @@ int solidigm_get_additional_smart_log(int argc, char **argv, struct command *cmd return flags; } - uuid_index = solidigm_get_vu_uuid_index(dev); - - struct nvme_get_log_args args = { - .lpo = 0, - .result = NULL, - .log = &smart_log_payload, - .args_size = sizeof(args), - .fd = dev_fd(dev), - .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, - .lid = solidigm_vu_smart_log_id, - .len = sizeof(smart_log_payload), - .nsid = NVME_NSID_ALL, - .csi = NVME_CSI_NVM, - .lsi = NVME_LOG_LSI_NONE, - .lsp = NVME_LOG_LSP_NONE, - .uuidx = uuid_index, - .rae = false, - .ot = false, - }; - - err = nvme_get_log(&args); + err = nvme_get_log_simple(dev_fd(dev), solidigm_vu_smart_log_id, + sizeof(smart_log_payload), &smart_log_payload); if (!err) { if (flags & JSON) { vu_smart_log_show_json(&smart_log_payload, @@ -261,7 +239,7 @@ int solidigm_get_additional_smart_log(int argc, char **argv, struct command *cmd d_raw((unsigned char *)&smart_log_payload, sizeof(smart_log_payload)); } else { vu_smart_log_show(&smart_log_payload, cfg.namespace_id, - dev->name, uuid_index); + dev->name); } } else if (err > 0) { nvme_show_status(err); diff --git a/plugins/solidigm/solidigm-telemetry.c b/plugins/solidigm/solidigm-telemetry.c index 9946991..84a4e2a 100644 --- a/plugins/solidigm/solidigm-telemetry.c +++ b/plugins/solidigm/solidigm-telemetry.c @@ -121,7 +121,7 @@ int solidigm_get_telemetry_log(int argc, char **argv, struct command *cmd, struc cfg.cfg_file, strerror(err)); goto close_fd; } - struct json_tokener * jstok = json_tokener_new(); + json_tokener * jstok = json_tokener_new(); tl.configuration = json_tokener_parse_ex(jstok, conf_str, length); if (jstok->err != json_tokener_success) { diff --git a/plugins/solidigm/solidigm-telemetry/cod.c b/plugins/solidigm/solidigm-telemetry/cod.c index 7accc53..be5685b 100644 --- a/plugins/solidigm/solidigm-telemetry/cod.c +++ b/plugins/solidigm/solidigm-telemetry/cod.c @@ -110,9 +110,9 @@ void solidigm_telemetry_log_cod_parse(struct telemetry_log *tl) UNKNOWN = 0xFF, }; - struct json_object *telemetry_header = NULL; - struct json_object *COD_offset = NULL; - struct json_object *reason_id = NULL; + json_object *telemetry_header = NULL; + json_object *COD_offset = NULL; + json_object *reason_id = NULL; if (!json_object_object_get_ex(tl->root, "telemetryHeader", &telemetry_header)) return; @@ -144,7 +144,7 @@ void solidigm_telemetry_log_cod_parse(struct telemetry_log *tl) return; } - struct json_object *cod = json_create_object(); + json_object *cod = json_create_object(); json_object_object_add(tl->root, "cod", cod); for (int i =0 ; i < data->header.EntryCount; i++) { diff --git a/plugins/solidigm/solidigm-telemetry/config.c b/plugins/solidigm/solidigm-telemetry/config.c index 5111703..781d786 100644 --- a/plugins/solidigm/solidigm-telemetry/config.c +++ b/plugins/solidigm/solidigm-telemetry/config.c @@ -11,15 +11,15 @@ // max 16 bit unsigned integer nummber 65535 #define MAX_16BIT_NUM_AS_STRING_SIZE 6 -static bool config_get_by_version(const struct json_object *obj, int version_major, - int version_minor, struct json_object **value) +static bool config_get_by_version(const json_object *obj, int version_major, + int version_minor, json_object **value) { char str_key[MAX_16BIT_NUM_AS_STRING_SIZE]; char str_subkey[MAX_16BIT_NUM_AS_STRING_SIZE]; snprintf(str_key, sizeof(str_key), "%d", version_major); snprintf(str_subkey, sizeof(str_subkey), "%d", version_minor); - struct json_object *major_obj = NULL; + json_object *major_obj = NULL; if (!json_object_object_get_ex(obj, str_key, &major_obj)) return false; @@ -28,11 +28,11 @@ static bool config_get_by_version(const struct json_object *obj, int version_maj return value != NULL; } -bool solidigm_config_get_by_token_version(const struct json_object *obj, int token_id, +bool solidigm_config_get_by_token_version(const json_object *obj, int token_id, int version_major, int version_minor, - struct json_object **value) + json_object **value) { - struct json_object *token_obj = NULL; + json_object *token_obj = NULL; char str_key[MAX_16BIT_NUM_AS_STRING_SIZE]; snprintf(str_key, sizeof(str_key), "%d", token_id); diff --git a/plugins/solidigm/solidigm-telemetry/config.h b/plugins/solidigm/solidigm-telemetry/config.h index 30e61ff..bea84fb 100644 --- a/plugins/solidigm/solidigm-telemetry/config.h +++ b/plugins/solidigm/solidigm-telemetry/config.h @@ -7,7 +7,4 @@ #include <stdbool.h> #include "util/json.h" -bool solidigm_config_get_by_token_version(const struct json_object *obj, - int key, int subkey, - int subsubkey, - struct json_object **value); +bool solidigm_config_get_by_token_version(const json_object *obj, int key, int subkey, int subsubkey, json_object **value); diff --git a/plugins/solidigm/solidigm-telemetry/data-area.c b/plugins/solidigm/solidigm-telemetry/data-area.c index 2f18ea2..7233e8f 100644 --- a/plugins/solidigm/solidigm-telemetry/data-area.c +++ b/plugins/solidigm/solidigm-telemetry/data-area.c @@ -17,7 +17,7 @@ static bool telemetry_log_get_value(const struct telemetry_log *tl, uint32_t offset_bit, uint32_t size_bit, - bool is_signed, struct json_object **val_obj) + bool is_signed, json_object **val_obj) { uint32_t offset_bit_from_byte; uint32_t additional_size_byte; @@ -77,16 +77,16 @@ static bool telemetry_log_get_value(const struct telemetry_log *tl, } static int telemetry_log_structure_parse(const struct telemetry_log *tl, - struct json_object *struct_def, + json_object *struct_def, size_t parent_offset_bit, - struct json_object *output, - struct json_object *metadata) + json_object *output, + json_object *metadata) { - struct json_object *obj_arraySizeArray = NULL; - struct json_object *obj = NULL; - struct json_object *obj_memberList; - struct json_object *major_dimension; - struct json_object *sub_output; + json_object *obj_arraySizeArray = NULL; + json_object *obj = NULL; + json_object *obj_memberList; + json_object *major_dimension; + json_object *sub_output; bool is_enumeration = false; bool has_member_list; const char *type = ""; @@ -155,7 +155,7 @@ static int telemetry_log_structure_parse(const struct telemetry_log *tl, uint32_t array_size_dimension[array_rank]; for (size_t i = 0; i < array_rank; i++) { - struct json_object *dimension = json_object_array_get_idx(obj_arraySizeArray, i); + json_object *dimension = json_object_array_get_idx(obj_arraySizeArray, i); array_size_dimension[i] = json_object_get_uint64(dimension); major_dimension = dimension; @@ -163,7 +163,7 @@ static int telemetry_log_structure_parse(const struct telemetry_log *tl, if (array_rank > 1) { uint32_t linear_pos_per_index = array_size_dimension[0]; uint32_t prev_index_offset_bit = 0; - struct json_object *dimension_output; + json_object *dimension_output; for (int i = 1; i < (array_rank - 1); i++) linear_pos_per_index *= array_size_dimension[i]; @@ -182,7 +182,7 @@ static int telemetry_log_structure_parse(const struct telemetry_log *tl, json_object_array_del_idx(obj_arraySizeArray, array_rank - 1, 1); for (int i = 0 ; i < array_size_dimension[0]; i++) { - struct json_object *sub_array = json_create_array(); + json_object *sub_array = json_create_array(); size_t offset; offset = parent_offset_bit + prev_index_offset_bit; @@ -213,7 +213,7 @@ static int telemetry_log_structure_parse(const struct telemetry_log *tl, for (uint32_t j = 0; j < array_size_dimension[0]; j++) { if (is_enumeration || !has_member_list) { bool is_signed = !strncmp(type, SIGNED_INT_PREFIX, sizeof(SIGNED_INT_PREFIX)-1); - struct json_object *val_obj; + json_object *val_obj; size_t offset; offset = parent_offset_bit + offset_bit + linear_array_pos_bit; @@ -230,7 +230,7 @@ static int telemetry_log_structure_parse(const struct telemetry_log *tl, json_free_object(val_obj); } } else { - struct json_object *sub_sub_output = json_create_object(); + json_object *sub_sub_output = json_object_new_object(); int num_members; if (array_size_dimension[0] > 1) @@ -240,7 +240,7 @@ static int telemetry_log_structure_parse(const struct telemetry_log *tl, num_members = json_object_array_length(obj_memberList); for (int k = 0; k < num_members; k++) { - struct json_object *member = json_object_array_get_idx(obj_memberList, k); + json_object *member = json_object_array_get_idx(obj_memberList, k); size_t offset; offset = parent_offset_bit + offset_bit + linear_array_pos_bit; @@ -322,8 +322,8 @@ struct telemetry_object_header { static void telemetry_log_data_area_toc_parse(const struct telemetry_log *tl, enum nvme_telemetry_da da, - struct json_object *toc_array, - struct json_object *tele_obj_array) + json_object *toc_array, + json_object *tele_obj_array) { const struct telemetry_object_header *header; @@ -339,8 +339,8 @@ static void telemetry_log_data_area_toc_parse(const struct telemetry_log *tl, payload = (char *) tl->log; for (int i = 0; i < toc->header.TableOfContentsCount; i++) { - struct json_object *structure_definition = NULL; - struct json_object *toc_item; + json_object *structure_definition = NULL; + json_object *toc_item; uint32_t obj_offset; bool has_struct; @@ -379,15 +379,15 @@ static void telemetry_log_data_area_toc_parse(const struct telemetry_log *tl, &structure_definition); if (has_struct) { - struct json_object *tele_obj_item = json_create_object(); + json_object *tele_obj_item = json_create_object(); json_object_array_add(tele_obj_array, tele_obj_item); json_object_get(toc_item); json_object_add_value_object(tele_obj_item, "metadata", toc_item); - struct json_object *parsed_struct = json_create_object(); + json_object *parsed_struct = json_object_new_object(); json_object_add_value_object(tele_obj_item, "objectData", parsed_struct); - struct json_object *obj_hasTelemObjHdr = NULL; + json_object *obj_hasTelemObjHdr = NULL; uint32_t header_offset = sizeof(const struct telemetry_object_header); uint32_t file_offset; @@ -411,8 +411,8 @@ static void telemetry_log_data_area_toc_parse(const struct telemetry_log *tl, int solidigm_telemetry_log_data_areas_parse(const struct telemetry_log *tl, enum nvme_telemetry_da last_da) { - struct json_object *tele_obj_array = json_create_array(); - struct json_object *toc_array = json_create_array(); + json_object *tele_obj_array = json_create_array(); + json_object *toc_array = json_create_array(); json_object_add_value_array(tl->root, "tableOfContents", toc_array); json_object_add_value_array(tl->root, "telemetryObjects", tele_obj_array); diff --git a/plugins/solidigm/solidigm-telemetry/header.c b/plugins/solidigm/solidigm-telemetry/header.c index d085c24..72b2d97 100644 --- a/plugins/solidigm/solidigm-telemetry/header.c +++ b/plugins/solidigm/solidigm-telemetry/header.c @@ -63,10 +63,10 @@ static_assert(sizeof(const struct reason_indentifier_1_2) == #pragma pack(pop, reason_indentifier) static void telemetry_log_reason_id_parse1_0_ext(const struct telemetry_log *tl, - struct json_object *reason_id) + json_object *reason_id) { const struct reason_indentifier_1_0 *ri; - struct json_object *reserved; + json_object *reserved; ri = (struct reason_indentifier_1_0 *) tl->log->rsnident; json_object_object_add(reason_id, "FirmwareVersion", json_object_new_string_len(ri->FirmwareVersion, sizeof(ri->FirmwareVersion))); @@ -76,16 +76,16 @@ static void telemetry_log_reason_id_parse1_0_ext(const struct telemetry_log *tl, reserved = json_create_array(); json_object_add_value_array(reason_id, "Reserved", reserved); for ( int i=0; i < sizeof(ri->Reserved); i++) { - struct json_object *val = json_object_new_int(ri->Reserved[i]); + json_object *val = json_object_new_int(ri->Reserved[i]); json_object_array_add(reserved, val); } } static void telemetry_log_reason_id_parse1_1_ext(const struct telemetry_log *tl, - struct json_object *reason_id) + json_object *reason_id) { const struct reason_indentifier_1_1 *ri; - struct json_object *reserved; + json_object *reserved; ri = (struct reason_indentifier_1_1 *) tl->log->rsnident; json_object_object_add(reason_id, "FirmwareVersion", json_object_new_string_len(ri->FirmwareVersion, sizeof(ri->FirmwareVersion))); @@ -98,17 +98,17 @@ static void telemetry_log_reason_id_parse1_1_ext(const struct telemetry_log *tl, reserved = json_create_array(); json_object_add_value_array(reason_id, "Reserved", reserved); for (int i = 0; i < sizeof(ri->Reserved); i++) { - struct json_object *val = json_object_new_int(ri->Reserved[i]); + json_object *val = json_object_new_int(ri->Reserved[i]); json_object_array_add(reserved, val); } } static void telemetry_log_reason_id_parse1_2_ext(const struct telemetry_log *tl, - struct json_object *reason_id) + json_object *reason_id) { const struct reason_indentifier_1_2 *ri; - struct json_object *dp_reserved; - struct json_object *reserved; + json_object *dp_reserved; + json_object *reserved; ri = (struct reason_indentifier_1_2 *) tl->log->rsnident; @@ -121,19 +121,19 @@ static void telemetry_log_reason_id_parse1_2_ext(const struct telemetry_log *tl, reserved = json_create_array(); json_object_add_value_array(reason_id, "Reserved2", reserved); for (int i = 0; i < sizeof(ri->Reserved2); i++) { - struct json_object *val = json_object_new_int(ri->Reserved2[i]); + json_object *val = json_object_new_int(ri->Reserved2[i]); json_object_array_add(reserved, val); } dp_reserved = json_create_array(); json_object_add_value_array(reason_id, "DualPortReserved", dp_reserved); for (int i = 0; i < sizeof(ri->DualPortReserved); i++) { - struct json_object *val = json_object_new_int(ri->DualPortReserved[i]); + json_object *val = json_object_new_int(ri->DualPortReserved[i]); json_object_array_add(dp_reserved, val); } } -static void solidigm_telemetry_log_reason_id_parse(const struct telemetry_log *tl, struct json_object *reason_id) +static void solidigm_telemetry_log_reason_id_parse(const struct telemetry_log *tl, json_object *reason_id) { const struct reason_indentifier_1_0 *ri1_0 = (struct reason_indentifier_1_0 *) tl->log->rsnident; @@ -161,9 +161,9 @@ static void solidigm_telemetry_log_reason_id_parse(const struct telemetry_log *t bool solidigm_telemetry_log_header_parse(const struct telemetry_log *tl) { const struct nvme_telemetry_log *log; - struct json_object *ieee_oui_id; - struct json_object *reason_id; - struct json_object *header; + json_object *ieee_oui_id; + json_object *reason_id; + json_object *header; if (tl->log_size < sizeof(const struct nvme_telemetry_log)) { SOLIDIGM_LOG_WARNING("Telemetry log too short."); @@ -180,7 +180,7 @@ bool solidigm_telemetry_log_header_parse(const struct telemetry_log *tl) json_object_object_add(header, "ieeeOuiIdentifier", ieee_oui_id); for (int i = 0; i < sizeof(log->ieee); i++) { - struct json_object *val = json_object_new_int(log->ieee[i]); + json_object *val = json_object_new_int(log->ieee[i]); json_object_array_add(ieee_oui_id, val); } diff --git a/plugins/solidigm/solidigm-telemetry/telemetry-log.h b/plugins/solidigm/solidigm-telemetry/telemetry-log.h index e9eff73..ef4ec5d 100644 --- a/plugins/solidigm/solidigm-telemetry/telemetry-log.h +++ b/plugins/solidigm/solidigm-telemetry/telemetry-log.h @@ -24,8 +24,8 @@ struct telemetry_log { struct nvme_telemetry_log *log; size_t log_size; - struct json_object *root; - struct json_object *configuration; + json_object *root; + json_object *configuration; }; -#endif /* _SOLIDIGM_TELEMETRY_LOG_H */ +#endif /* _SOLIDIGM_TELEMETRY_LOG_H */
\ No newline at end of file diff --git a/plugins/solidigm/solidigm-util.c b/plugins/solidigm/solidigm-util.c deleted file mode 100644 index 0171a49..0000000 --- a/plugins/solidigm/solidigm-util.c +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (c) 2023 Solidigm. - * - * Author: leonardo.da.cunha@solidigm.com - */ - -#include "plugins/ocp/ocp-utils.h" -#include "solidigm-util.h" - -__u8 solidigm_get_vu_uuid_index(struct nvme_dev *dev) -{ - int ocp_uuid_index = 0; - - if (ocp_get_uuid_index(dev, &ocp_uuid_index) == 0) - if (ocp_uuid_index == 2) - return 1; - - return 0; -} diff --git a/plugins/solidigm/solidigm-util.h b/plugins/solidigm/solidigm-util.h deleted file mode 100644 index 3a18501..0000000 --- a/plugins/solidigm/solidigm-util.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Copyright (c) 2023 Solidigm. - * - * Author: leonardo.da.cunha@solidigm.com - */ - -#include "nvme.h" - -__u8 solidigm_get_vu_uuid_index(struct nvme_dev *dev); |