]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
mi: Issue a NSID-specific Controller List Identify in nsid_ctrl_list()
authorJeremy Kerr <jk@codeconstruct.com.au>
Tue, 1 Nov 2022 06:30:35 +0000 (14:30 +0800)
committerJeremy Kerr <jk@codeconstruct.com.au>
Tue, 1 Nov 2022 22:58:01 +0000 (06:58 +0800)
We need a NSIS Controller List CNS value when requesting a NSID-specific
list; we're currently using a non-NSID-specific Identify here.

Reported-by: Willy Tu <wltu@google.com>
Tested-by: Willy Tu <wltu@google.com>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
src/nvme/mi.h
test/mi.c

index ab4216dd542449b7bf86e9114d6311b0031b1bf0..d129f8e7c09fc0ff94c956e2cfa73515b8b57fbf 100644 (file)
@@ -1202,7 +1202,7 @@ static inline int nvme_mi_admin_identify_nsid_ctrl_list(nvme_mi_ctrl_t ctrl,
                .result = NULL,
                .data = list,
                .args_size = sizeof(args),
-               .cns = NVME_IDENTIFY_CNS_CTRL_LIST,
+               .cns = NVME_IDENTIFY_CNS_NS_CTRL_LIST,
                .csi = NVME_CSI_NVM,
                .nsid = nsid,
                .cntid = cntid,
index c21f9dbbb541ca85d74c00a6a7f3a1f10a66c6cd..54fc7b4d606f6329bc9e76c077340ce86b88059e 100644 (file)
--- a/test/mi.c
+++ b/test/mi.c
@@ -1141,7 +1141,7 @@ static int test_admin_id_nsid_ctrl_list_cb(struct nvme_mi_ep *ep,
        assert(req->data_len == 0);
 
        cns = hdr[45] << 8 | hdr[44];
-       assert(cns == NVME_IDENTIFY_CNS_CTRL_LIST);
+       assert(cns == NVME_IDENTIFY_CNS_NS_CTRL_LIST);
 
        nsid = hdr[11] << 24 | hdr[10] << 16 | hdr[9] << 8 | hdr[8];
        assert(nsid == 0x01020304);