printf(" [15:1] : %#x\tReserved\n", rsvd);
printf(" [0:0] : %#x\t Read Across Zone Boundaries: %s\n",
razb, razb ? "Yes" : "No");
- printf(" [1:1] : %#x\tZone Random Write Area: %sSupported\n", zrwasup,
- zrwasup ? "" : "Not ");
+ printf(" [1:1] : %#x\t Zone Random Write Area: %s\n", zrwasup,
+ zrwasup ? "Yes" : "No");
}
static void nvme_show_zns_id_ns_recommandeded_limit(__le32 ns_rl, int human,
if (rsvd)
printf(" [7:1] : %#x\tReserved\n", rsvd);
- printf(" [0:0] : %#x\t Explicit ZRWA Flush %sSupported\n",
- expflushsup, expflushsup ? "" : "Not ");
+ printf(" [0:0] : %#x\t Explicit ZRWA Flush Operations: %s\n",
+ expflushsup, expflushsup ? "Yes" : "No");
}
void nvme_show_zns_id_ns(struct nvme_zns_id_ns *ns,
nvme_show_zns_id_ns_recommandeded_limit(ns->frl, human, "frl2");
nvme_show_zns_id_ns_recommandeded_limit(ns->frl, human, "frl3");
- printf("numzrwa : %u\n", le32_to_cpu(ns->numzrwa));
+ printf("numzrwa : %#x\n", le32_to_cpu(ns->numzrwa));
printf("zrwafg : %u\n", le16_to_cpu(ns->zrwafg));
- printf("zrwasz : %u\n", le16_to_cpu(ns->zrwasz));
+ printf("zrwasz : %u\n", le16_to_cpu(ns->zrwasz));
if (human) {
printf("zrwacap : %u\tZone Random Write Area Capability\n", ns->zrwacap);
nvme_show_zns_id_ns_zrwacap(ns->zrwacap);
const char *select_all = "send command to all zones";
const char *timeout = "timeout value, in milliseconds";
- int err, fd;
+ int err, fd, zcapc = 0;
char *command;
__u32 result;
err = nvme_zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba, zsa,
cfg.select_all, 0, 0, NULL, cfg.timeout, &result);
if (!err) {
- printf("%s: Success, action:%d zone:%"PRIx64" all:%d nsid:%d\n",
+ if (zsa == NVME_ZNS_ZSA_RESET)
+ zcapc = result & 0x1;
+
+ printf("%s: Success, action:%d zone:%"PRIx64" all:%d zcapc:%u nsid:%d\n",
command, zsa, (uint64_t)cfg.zslba, (int)cfg.select_all,
- cfg.namespace_id);
- if(result && zsa == NVME_ZNS_ZSA_RESET) {
- if(result & 0x1)
- printf("Zone Capacity has Changed by the command\n");
- }
+ zcapc, cfg.namespace_id);
}
else if (err > 0)
nvme_show_status(err);
{
const char *desc = "Open zones\n";
const char *zslba = "starting LBA of the zone for this command";
- const char *zrwa = "Zone Random Write Area Allocation";
+ const char *zrwaa = "Allocate Zone Random Write Area to zone";
const char *select_all = "send command to all zones";
const char *timeout = "timeout value, in milliseconds";
struct config {
__u64 zslba;
__u32 namespace_id;
- bool zrwa;
+ bool zrwaa;
bool select_all;
__u32 timeout;
};
OPT_ARGS(opts) = {
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id),
OPT_SUFFIX("start-lba", 's', &cfg.zslba, zslba),
- OPT_FLAG("zrwa", 'r', &cfg.zrwa, zrwa),
+ OPT_FLAG("zrwaa", 'r', &cfg.zrwaa, zrwaa),
OPT_FLAG("select-all", 'a', &cfg.select_all, select_all),
OPT_UINT("timeout", 't', &cfg.timeout, timeout),
OPT_END()
}
err = nvme_zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba, NVME_ZNS_ZSA_OPEN,
- cfg.select_all, cfg.zrwa, 0, NULL, cfg.timeout, NULL);
+ cfg.select_all, cfg.zrwaa, 0, NULL, cfg.timeout, NULL);
if (!err)
printf("zns-open-zone: Success zone slba:%"PRIx64" nsid:%d\n",
(uint64_t)cfg.zslba, cfg.namespace_id);
{
const char *desc = "Set Zone Descriptor Extension\n";
const char *zslba = "starting LBA of the zone for this command";
- const char *zrwa = "Zone Random Write Area Allocation";
+ const char *zrwaa = "Allocate Zone Random Write Area to zone";
const char *data = "optional file for zone extention data (default stdin)";
const char *timeout = "timeout value, in milliseconds";
struct config {
__u64 zslba;
- bool zrwa;
+ bool zrwaa;
__u32 namespace_id;
char *file;
__u32 timeout;
OPT_ARGS(opts) = {
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id),
OPT_SUFFIX("start-lba", 's', &cfg.zslba, zslba),
- OPT_FLAG("zrwa", 'r', &cfg.zrwa, zrwa),
+ OPT_FLAG("zrwaa", 'r', &cfg.zrwaa, zrwaa),
OPT_FILE("data", 'd', &cfg.file, data),
OPT_UINT("timeout", 't', &cfg.timeout, timeout),
OPT_END()
}
err = nvme_zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba,
- NVME_ZNS_ZSA_SET_DESC_EXT, 0, cfg.zrwa, data_len, buf,
+ NVME_ZNS_ZSA_SET_DESC_EXT, 0, cfg.zrwaa, data_len, buf,
cfg.timeout, NULL);
if (!err)
printf("set-zone-desc: Success, zone:%"PRIx64" nsid:%d\n",
}
-static int flush_zone(int argc, char **argv, struct command *cmd, struct plugin *plugin)
+static int zrwa_flush_zone(int argc, char **argv, struct command *cmd, struct plugin *plugin)
{
const char *desc = "Flush Explicit ZRWA Range";
- const char *zllba = "The last LBA of the zone to be flushed";
+ const char *slba = "LBA to flush up to";
const char *timeout = "timeout value, in milliseconds";
int err, fd;
struct config {
- __u64 zllba;
+ __u64 lba;
__u32 namespace_id;
__u32 timeout;
};
OPT_ARGS(opts) = {
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id),
- OPT_SUFFIX("last-lba", 'l', &cfg.zllba, zllba),
+ OPT_SUFFIX("lba", 'l', &cfg.lba, slba),
OPT_UINT("timeout", 't', &cfg.timeout, timeout),
OPT_END()
};
}
}
- err = nvme_zns_mgmt_send(fd, cfg.namespace_id, cfg.zllba,
+ err = nvme_zns_mgmt_send(fd, cfg.namespace_id, cfg.lba,
NVME_ZNS_ZSA_ZRWA_FLUSH, 0, 0, 0, NULL, cfg.timeout, NULL);
if (!err)
- printf("zns-flush-zone: Success, last lba:%"PRIx64" nsid:%d\n",
- (uint64_t)cfg.zllba, cfg.namespace_id);
+ printf("zrwa-flush-zone: Success, lba:%"PRIx64" nsid:%d\n",
+ (uint64_t)cfg.lba, cfg.namespace_id);
else
nvme_show_status(err);
close_fd: