From 55057f9a53ebdc0f715efc77d0f68002b6758277 Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Tue, 11 Jul 2023 23:50:22 +0900 Subject: [PATCH] nvme: Add support for create-ns command endg-id option parameter Signed-off-by: Tokunori Ikegami --- Documentation/nvme-create-ns.txt | 5 +++++ completions/_nvme | 2 ++ completions/bash-nvme-completion.sh | 2 +- nvme.c | 15 ++++++++++----- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Documentation/nvme-create-ns.txt b/Documentation/nvme-create-ns.txt index 5d1355d2..28046b68 100644 --- a/Documentation/nvme-create-ns.txt +++ b/Documentation/nvme-create-ns.txt @@ -15,6 +15,7 @@ SYNOPSIS [--nmic= | -m ] [--anagrp-id= | -a ] [--nvmset-id= | -i ] + [--endg-id= | -e ] [--csi= | -y ] [--lbstm= | -l ] [--nphndls= | -n ] @@ -69,6 +70,10 @@ OPTIONS --nvmset-id=:: This field specifies the identifier of the NVM Set. +-e :: +--endg-id=:: + This field specifies the identifier of the endurance group. + -y :: --csi=:: This field specifies the identifier of command set. diff --git a/completions/_nvme b/completions/_nvme index 49736f58..3c8dd47a 100644 --- a/completions/_nvme +++ b/completions/_nvme @@ -525,6 +525,8 @@ _nvme () { -a':alias of --anagrp-id' --nvmset-id=':NVM Set Identifier' -i':alias of --nvmset-id' + --endg-id=':Endurance Group Identifier' + -e':alias of --endg-id' --block-size=':target block size' -b':alias of --block-size' --timeout=':value for timeout' diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh index 8f451ff9..223f9b50 100644 --- a/completions/bash-nvme-completion.sh +++ b/completions/bash-nvme-completion.sh @@ -114,7 +114,7 @@ nvme_list_opts () { --dps= -d --nmic= -m --anagrp-id= -a --nvmset-id= -i \ --block-size= -b --timeout= -t --csi= -y --lbstm= -l \ --nphndls= -n --nsze-si= -S --ncap-si= -C --azr -z --rar= -r \ - --ror= -o --rnumzrwa= -u --phndls= -p" + --ror= -o --rnumzrwa= -u --phndls= -p --endg-id= -e" ;; "delete-ns") opts+=" -namespace-id= -n --timeout= -t" diff --git a/nvme.c b/nvme.c index ee38ba76..b35f9003 100644 --- a/nvme.c +++ b/nvme.c @@ -3032,6 +3032,7 @@ static int create_ns(int argc, char **argv, struct command *cmd, struct plugin * const char *nmic = "multipath and sharing capabilities (NMIC)"; const char *anagrpid = "ANA Group Identifier (ANAGRPID)"; const char *nvmsetid = "NVM Set Identifier (NVMSETID)"; + const char *endgid = "Endurance Group Identifier (ENDGID)"; const char *csi = "command set identifier (CSI)"; const char *lbstm = "logical block storage tag mask (LBSTM)"; const char *nphndls = "Number of Placement Handles (NPHNDLS)"; @@ -3060,6 +3061,7 @@ static int create_ns(int argc, char **argv, struct command *cmd, struct plugin * __u8 nmic; __u32 anagrpid; __u16 nvmsetid; + __u16 endgid; __u64 bs; __u32 timeout; __u8 csi; @@ -3082,7 +3084,8 @@ static int create_ns(int argc, char **argv, struct command *cmd, struct plugin * .nmic = 0, .anagrpid = 0, .nvmsetid = 0, - .bs = 0x00, + .endgid = 0, + .bs = 0x00, .timeout = 120000, .csi = 0, .lbstm = 0, @@ -3102,20 +3105,21 @@ static int create_ns(int argc, char **argv, struct command *cmd, struct plugin * OPT_BYTE("flbas", 'f', &cfg.flbas, flbas), OPT_BYTE("dps", 'd', &cfg.dps, dps), OPT_BYTE("nmic", 'm', &cfg.nmic, nmic), - OPT_UINT("anagrp-id", 'a', &cfg.anagrpid, anagrpid), - OPT_UINT("nvmset-id", 'i', &cfg.nvmsetid, nvmsetid), + OPT_UINT("anagrp-id", 'a', &cfg.anagrpid, anagrpid), + OPT_UINT("nvmset-id", 'i', &cfg.nvmsetid, nvmsetid), + OPT_UINT("endg-id", 'e', &cfg.endgid, endgid), OPT_SUFFIX("block-size", 'b', &cfg.bs, bs), OPT_UINT("timeout", 't', &cfg.timeout, timeout), OPT_BYTE("csi", 'y', &cfg.csi, csi), OPT_SUFFIX("lbstm", 'l', &cfg.lbstm, lbstm), - OPT_SHRT("nphndls", 'n', &cfg.nphndls, nphndls), + OPT_SHRT("nphndls", 'n', &cfg.nphndls, nphndls), OPT_STR("nsze-si", 'S', &cfg.nsze_si, nsze_si), OPT_STR("ncap-si", 'C', &cfg.ncap_si, ncap_si), OPT_FLAG("azr", 'z', &cfg.azr, azr), OPT_UINT("rar", 'r', &cfg.rar, rar), OPT_UINT("ror", 'o', &cfg.ror, ror), OPT_UINT("rnumzrwa", 'u', &cfg.rnumzrwa, rnumzrwa), - OPT_LIST("phndls", 'p', &cfg.phndls, phndls), + OPT_LIST("phndls", 'p', &cfg.phndls, phndls), OPT_END() }; @@ -3186,6 +3190,7 @@ static int create_ns(int argc, char **argv, struct command *cmd, struct plugin * .nmic = cfg.nmic, .anagrpid = cpu_to_le32(cfg.anagrpid), .nvmsetid = cpu_to_le16(cfg.nvmsetid), + .endgid = cpu_to_le16(cfg.endgid), .lbstm = cpu_to_le64(cfg.lbstm), .zns.znsco = cfg.azr, .zns.rar = cpu_to_le32(cfg.rar), -- 2.49.0