[--timeout=<timeout> | -t <timeout>]
[--nsze-si=<nsze-si> | -S <nsze-si>]
[--ncap-si=<ncap-si> | -C <ncap-si>]
+ [--azr | -z]
+ [--rar=<rar> | -r <rar>]
+ [--ror=<ror> | -o <ror>]
+ [--rnumzrwa=<rnumzrwa> | -u <rnumzrwa>]
[--phndls=<placement-handle-list,> | -p <placement-handle-list,>]
DESCRIPTION
The value SI suffixed is divided by the namespace LBA size to set as NCAP.
If the value not suffixed it is set as same with the ncap option.
+-z::
+--azr::
+ Allocate ZRWA Resources.
+ If set to 1, then the namespace is to be created with the number of ZRWA
+ resource specified in the RNUMZRWA field of this data structure. If cleared
+ to 0, then no ZRWA resources are allocated to the namespace to be created.
+
+-r <rar>::
+--rar=<rar>::
+ Requested Active Resources. This field specifies the number of active
+ resources to be allocated to the created namespace.
+
+-o <ror>::
+--ror=<ror>::
+ Requested Open Resources. This field specifies the number of open resources
+ to be allocated to the created namespace.
+
+-u <rnumzrwa>::
+--rnumzrwa=<rnumzrwa>::
+ Requested Number of ZRWA Resources. This field specifies the number of ZRWA
+ resources to be allocated to the created namespace.
+
-p <placement-handle-list,>::
--phndls=<placement-handle-list,>::
The comma separated list of Reclaim Unit Handle Identifier to be associated
"value not entered";
const char *nsze_si = "size of ns (NSZE) in standard SI units";
const char *ncap_si = "capacity of ns (NCAP) in standard SI units";
+ const char *azr = "Allocate ZRWA Resources (AZR) for "\
+ "Zoned Namespace Command Set";
+ const char *rar = "Requested Active Resources (RAR) for "\
+ "Zoned Namespace Command Set";
+ const char *ror = "Requested Open Resources (ROR) for "\
+ "Zoned Namespace Command Set";
+ const char *rnumzrwa = "Requested Number of ZRWA Resources (RNUMZRWA) for "\
+ "Zoned Namespace Command Set";
const char *phndls = "Comma separated list of Placement Handle "\
"Associated RUH";
__u16 nphndls;
char *nsze_si;
char *ncap_si;
+ bool azr;
+ __u32 rar;
+ __u32 ror;
+ __u32 rnumzrwa;
char *phndls;
};
.nphndls = 0,
.nsze_si = NULL,
.ncap_si = NULL,
+ .azr = false,
+ .rar = 0,
+ .ror = 0,
+ .rnumzrwa = 0,
.phndls = "",
};
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_END()
};
if (err)
goto close_dev;
+ if (cfg.csi != NVME_CSI_ZNS &&
+ (cfg.azr || cfg.rar || cfg.ror|| cfg.rnumzrwa)) {
+ fprintf(stderr, "Invaild ZNS argument is given (CSI:%#x)\n", cfg.csi);
+ err = -EINVAL;
+ goto close_dev;
+ }
+
struct nvme_ns_mgmt_host_sw_specified data = {
.nsze = cpu_to_le64(cfg.nsze),
.ncap = cpu_to_le64(cfg.ncap),
.anagrpid = cpu_to_le32(cfg.anagrpid),
.nvmsetid = cpu_to_le16(cfg.nvmsetid),
.lbstm = cpu_to_le64(cfg.lbstm),
+ .zns.znsco = cfg.azr,
+ .zns.rar = cpu_to_le32(cfg.rar),
+ .zns.ror = cpu_to_le32(cfg.ror),
+ .zns.rnumzrwa = cpu_to_le32(cfg.rnumzrwa),
.nphndls = cpu_to_le16(cfg.nphndls),
};