]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
Print out correct TREQ strings for discovery
authorHannes Reinecke <hare@suse.de>
Tue, 28 Mar 2023 10:28:21 +0000 (12:28 +0200)
committerDaniel Wagner <wagi@monom.org>
Tue, 28 Mar 2023 12:24:48 +0000 (14:24 +0200)
The TREQ field in the discover log page is actually a bit field,
so we need to update the string mapping to print out all possible
combinations correctly.

Signed-off-by: Hannes Reinecke <hare@suse.de>
src/nvme/fabrics.c

index 6dab54668c9a1219725a673543a16a0df331107a..c12dbf6a796bf1ea51d42f61e4c17936ba8cb456 100644 (file)
@@ -110,8 +110,15 @@ static const char * const treqs[] = {
        [NVMF_TREQ_NOT_SPECIFIED]       = "not specified",
        [NVMF_TREQ_REQUIRED]            = "required",
        [NVMF_TREQ_NOT_REQUIRED]        = "not required",
-       [NVMF_TREQ_DISABLE_SQFLOW]      = "not specified, "
-                                         "sq flow control disable supported",
+       [NVMF_TREQ_NOT_SPECIFIED |
+        NVMF_TREQ_DISABLE_SQFLOW]      = "not specified, "
+                               "sq flow control disable supported",
+       [NVMF_TREQ_REQUIRED |
+        NVMF_TREQ_DISABLE_SQFLOW]      = "required, "
+                               "sq flow control disable supported",
+       [NVMF_TREQ_NOT_REQUIRED |
+        NVMF_TREQ_DISABLE_SQFLOW]      = "not required, "
+                               "sq flow control disable supported",
 };
 
 const char *nvmf_treq_str(__u8 treq)