From: Haro Panosyan Date: Wed, 21 Aug 2024 23:38:03 +0000 (-0700) Subject: plugins/solidigm : Fixing vs-internal-log to generate identify per allocated namespace. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=97a8584897ad632a99cd7f5bb8411bee165b3feb;p=users%2Fsagi%2Fnvme-cli.git plugins/solidigm : Fixing vs-internal-log to generate identify per allocated namespace. CNS 11h is for namespace data structures for allocated namespaces. Earlier code was using attached namespaces. This fix is to generate identify data structures per allocated namespace. Signed-off-by: Haro Panosyan --- diff --git a/plugins/solidigm/solidigm-internal-logs.c b/plugins/solidigm/solidigm-internal-logs.c index f5b57f32..0c994063 100644 --- a/plugins/solidigm/solidigm-internal-logs.c +++ b/plugins/solidigm/solidigm-internal-logs.c @@ -4,6 +4,7 @@ * * Authors: leonardo.da.cunha@solidigm.com * shankaralingegowda.singonahalli@solidigm.com + * haro.panosyan@solidigm.com */ #include @@ -597,14 +598,17 @@ static int ilog_dump_telemetry(struct ilog *ilog, enum log_type ttype) static int ilog_dump_identify_pages(struct ilog *ilog) { - struct nvme_ns_list ns_list; + struct nvme_ns_list ns_attached_list; + struct nvme_ns_list ns_allocated_list; __u32 j = 0; + struct log identify_base_list[] = { {NVME_IDENTIFY_CNS_NS_ACTIVE_LIST, "Id Active Namespace ID list", - sizeof(ns_list), (__u8 *) &ns_list}, + sizeof(ns_attached_list), (__u8 *) &ns_attached_list}, {NVME_IDENTIFY_CNS_NVMSET_LIST, "Id NVM Set List"}, {NVME_IDENTIFY_CNS_CSI_CTRL, "Id I/O Command Set specific"}, - {NVME_IDENTIFY_CNS_ALLOCATED_NS_LIST, "Id Allocated Namespace ID list"}, + {NVME_IDENTIFY_CNS_ALLOCATED_NS_LIST, "Id Allocated Namespace ID list", + sizeof(ns_allocated_list), (__u8 *) &ns_allocated_list}, {NVME_IDENTIFY_CNS_CTRL_LIST, "Id Controller List"} }; struct log identify_ns_required_list[] = { @@ -613,10 +617,12 @@ static int ilog_dump_identify_pages(struct ilog *ilog) {NVME_IDENTIFY_CNS_CSI_NS, "Id Namespace ID I/O Command Set specific"}, {NVME_IDENTIFY_CNS_CSI_INDEPENDENT_ID_NS, "I/O Command Set Independent Identify Namespace Data"}, - {NVME_IDENTIFY_CNS_ALLOCATED_NS, "Id Namespace data "}, {NVME_IDENTIFY_CNS_NS_CTRL_LIST, "Id Namespace Id Controller List"}, }; + struct log allocated = {NVME_IDENTIFY_CNS_ALLOCATED_NS, "Allocated Namespace Data", + NVME_IDENTIFY_DATA_SIZE, NULL}; + ilog_ensure_dump_id_ctrl(ilog); for (int i = 0; i < ARRAY_SIZE(identify_base_list); i++) { @@ -626,10 +632,10 @@ static int ilog_dump_identify_pages(struct ilog *ilog) ilog->count++; } - while (ns_list.ns[j]) { + while (ns_attached_list.ns[j]) { for (int i = 0; i < ARRAY_SIZE(identify_ns_required_list); i++) { int err = ilog_dump_identify_page(ilog, &identify_ns_required_list[i], - ns_list.ns[j]); + ns_attached_list.ns[j]); if (err == 0) ilog->count++; @@ -637,6 +643,15 @@ static int ilog_dump_identify_pages(struct ilog *ilog) j++; } + j = 0; + while (ns_allocated_list.ns[j]) { + int err = ilog_dump_identify_page(ilog, &allocated, ns_allocated_list.ns[j]); + + if (err == 0) + ilog->count++; + j++; + } + return 0; }