]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
plugins/solidigm : Fixing vs-internal-log to generate identify per allocated namespace.
authorHaro Panosyan <haro.panosyan@solidigm.com>
Wed, 21 Aug 2024 23:38:03 +0000 (16:38 -0700)
committerDaniel Wagner <wagi@monom.org>
Mon, 9 Sep 2024 06:52:00 +0000 (08:52 +0200)
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 <haro.panosyan@solidigm.com>
plugins/solidigm/solidigm-internal-logs.c

index f5b57f321a45fa373c2ce201f5d077083c01c4e8..0c9940630456d99d9cdccd71095257ed573841a8 100644 (file)
@@ -4,6 +4,7 @@
  *
  * Authors: leonardo.da.cunha@solidigm.com
  * shankaralingegowda.singonahalli@solidigm.com
+ * haro.panosyan@solidigm.com
  */
 
 #include <fcntl.h>
@@ -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;
 }