]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-cli: Get Feature support for Extended Host Id
authorSchremmer, Steven <Steve.Schremmer@netapp.com>
Fri, 23 Jun 2017 16:18:25 +0000 (16:18 +0000)
committerKeith Busch <keith.busch@intel.com>
Fri, 23 Jun 2017 16:34:32 +0000 (12:34 -0400)
Enable Extended Host Identifier flag is specified in cdw11.
Also added the feature string for kato.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Documentation/nvme-get-feature.txt
nvme-print.c
nvme.c

index 4be581f5437542f3ef061c4310becf8235fc0249..cdf6eef40b7d3d220357161c80cdb4d688d6d899 100644 (file)
@@ -63,8 +63,7 @@ OPTIONS
        Range Type
 
 --cdw11=<cdw11>::
-       The value for command dword 11, if applicable. Only known feature
-       using this is the interrupt vector configuration feature.
+       The value for command dword 11, if applicable.
 
 -b::
 --raw-binary::
index f0f7121cb0703d0229da9775098d9e16199f4657..dca4a19df5bd18661d9eadf444c498f1c621958c 100644 (file)
@@ -1041,6 +1041,7 @@ char *nvme_feature_to_string(int feature)
        case NVME_FEAT_ASYNC_EVENT:     return "Async Event Configuration";
        case NVME_FEAT_AUTO_PST:        return "Autonomous Power State Transition";
        case NVME_FEAT_HOST_MEM_BUF:    return "Host Memory Buffer";
+       case NVME_FEAT_KATO:            return "Keep Alive Timer";
        case NVME_FEAT_SW_PROGRESS:     return "Software Progress";
        case NVME_FEAT_HOST_ID:         return "Host Identifier";
        case NVME_FEAT_RESV_MASK:       return "Reservation Notification Mask";
diff --git a/nvme.c b/nvme.c
index a2d6e7d1955140894f56bffd2ac8d9e489328f71..f746b74408c1257f48e6ee14dbdb3c7cd0cf59c7 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1181,6 +1181,9 @@ static int get_feature(int argc, char **argv, struct command *cmd, struct plugin
                break;
        case NVME_FEAT_HOST_ID:
                cfg.data_len = 8;
+               /* check for Extended Host Identifier */
+               if (cfg.cdw11 & 0x1)
+                       cfg.data_len = 16;
                break;
        }