'\" t
.\" Title: nvme-create-ns
-.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
-.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\" Date: 11/08/2019
+.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
+.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
+.\" Date: 11/16/2019
.\" Manual: NVMe Manual
.\" Source: NVMe
.\" Language: English
.\"
-.TH "NVME\-CREATE\-NS" "1" "11/08/2019" "NVMe" "NVMe Manual"
+.TH "NVME\-CREATE\-NS" "1" "11/16/2019" "NVMe" "NVMe Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
[\-\-flbas=<flbas> | \-f <flbas>]
[\-\-dps=<dps> | \-d <dps>]
[\-\-nmic=<nmic> | \-m <nmic>]
+ [\-\-anagrp\-id=<anagrpid> | \-a <anagrpid>]
+ [\-\-nvmset\-id=<nvmsetid> | \-i <nvmsetid>]
[\-\-block\-size=<block\-size> | \-b <block\-size>]
+ [\-\-timeout=<timeout> | \-t <timeout>]
+DESCRIPTION
.fi
-.SH "DESCRIPTION"
.sp
-For the NVMe device given, sends a namespace management command to create the namespace with the requested settings\&. On success, the namespace identifier assigned by the controller is returned\&.
-.sp
-The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&.
-.SH "OPTIONS"
+.nf
+For the NVMe device given, sends a namespace management command to create
+the namespace with the requested settings\&. On success, the namespace
+identifier assigned by the controller is returned\&.
+
+The <device> parameter is mandatory and may be either the NVMe character
+device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&.
+
+OPTIONS
+.fi
.PP
\-s, \-\-nsze
.RS 4
Namespace multipath and sharing capabilities\&.
.RE
.PP
+\-a, \-\-anagrp\-id
+.RS 4
+ANA Gorup Identifier\&. If this value is 0h specifies that the controller determines the value to use
+.RE
+.PP
+\-i <nvmsetid>, \-\-nvmset_id=<nvmsetid>
+.RS 4
+This field specifies the identifier of the NVM Set\&.
+.RE
+.PP
\-b, \-\-block\-size
.RS 4
Target block size the new namespace should be formatted as\&. Potential FLBAS values will be values will be scanned and the lowest numbered will be selected for the create\-ns operation\&. Conflicts with \-\-flbas argument\&.
[--flbas=<flbas> | -f <flbas>]\r
[--dps=<dps> | -d <dps>]\r
[--nmic=<nmic> | -m <nmic>]\r
- [--block-size=<block-size> | -b <block-size>]</pre>\r
+ [--anagrp-id=<anagrpid> | -a <anagrpid>]\r
+ [--nvmset-id=<nvmsetid> | -i <nvmsetid>]\r
+ [--block-size=<block-size> | -b <block-size>]\r
+ [--timeout=<timeout> | -t <timeout>]\r
+DESCRIPTION</pre>\r
<div class="attribution">\r
</div></div>\r
-</div>\r
-</div>\r
-<div class="sect1">\r
-<h2 id="_description">DESCRIPTION</h2>\r
-<div class="sectionbody">\r
-<div class="paragraph"><p>For the NVMe device given, sends a namespace management command to create\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><code>For the NVMe device given, sends a namespace management command to create\r
the namespace with the requested settings. On success, the namespace\r
-identifier assigned by the controller is returned.</p></div>\r
-<div class="paragraph"><p>The <device> parameter is mandatory and may be either the NVMe character\r
-device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).</p></div>\r
-</div>\r
-</div>\r
-<div class="sect1">\r
-<h2 id="_options">OPTIONS</h2>\r
-<div class="sectionbody">\r
+identifier assigned by the controller is returned.\r
+\r
+The <device> parameter is mandatory and may be either the NVMe character\r
+device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).\r
+\r
+OPTIONS</code></pre>\r
+</div></div>\r
<div class="dlist"><dl>\r
<dt class="hdlist1">\r
-s\r
</p>\r
</dd>\r
<dt class="hdlist1">\r
+-a\r
+</dt>\r
+<dt class="hdlist1">\r
+--anagrp-id\r
+</dt>\r
+<dd>\r
+<p>\r
+ ANA Gorup Identifier. If this value is 0h specifies\r
+ that the controller determines the value to use\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+-i <nvmsetid>\r
+</dt>\r
+<dt class="hdlist1">\r
+--nvmset_id=<nvmsetid>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This field specifies the identifier of the NVM Set.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
-b\r
</dt>\r
<dt class="hdlist1">\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2019-01-28 17:49:54 MST\r
+Last updated 2019-11-16 14:07:32 KST\r
</div>\r
</div>\r
</body>\r
[--flbas=<flbas> | -f <flbas>]
[--dps=<dps> | -d <dps>]
[--nmic=<nmic> | -m <nmic>]
+ [--anagrp-id=<anagrpid> | -a <anagrpid>]
+ [--nvmset-id=<nvmsetid> | -i <nvmsetid>]
[--block-size=<block-size> | -b <block-size>]
-
+ [--timeout=<timeout> | -t <timeout>]
DESCRIPTION
-----------
For the NVMe device given, sends a namespace management command to create
--nmic::
Namespace multipath and sharing capabilities.
+-a::
+--anagrp-id::
+ ANA Gorup Identifier. If this value is 0h specifies
+ that the controller determines the value to use
+
+-i <nvmsetid>::
+--nvmset-id=<nvmsetid>::
+ This field specifies the identifier of the NVM Set.
+
-b::
--block-size::
Target block size the new namespace should be formatted as. Potential FLBAS
return nvme_submit_admin_passthru(fd, &cmd);
}
-int nvme_ns_create(int fd, __u64 nsze, __u64 ncap, __u8 flbas,
- __u8 dps, __u8 nmic, __u32 timeout, __u32 *result)
+int nvme_ns_create(int fd, __u64 nsze, __u64 ncap, __u8 flbas, __u8 dps,
+ __u8 nmic, __u32 anagrpid, __u16 nvmsetid, __u32 timeout,
+ __u32 *result)
{
struct nvme_id_ns ns = {
.nsze = cpu_to_le64(nsze),
.flbas = flbas,
.dps = dps,
.nmic = nmic,
+ .anagrpid = anagrpid,
+ .nvmsetid = nvmsetid,
};
struct nvme_admin_cmd cmd = {
int nvme_format(int fd, __u32 nsid, __u8 lbaf, __u8 ses, __u8 pi,
__u8 pil, __u8 ms, __u32 timeout);
-int nvme_ns_create(int fd, __u64 nsze, __u64 ncap, __u8 flbas,
- __u8 dps, __u8 nmic, __u32 timeout, __u32 *result);
+int nvme_ns_create(int fd, __u64 nsze, __u64 ncap, __u8 flbas, __u8 dps,
+ __u8 nmic, __u32 anagrpid, __u16 nvmsetid, __u32 timeout,
+ __u32 *result);
int nvme_ns_delete(int fd, __u32 nsid, __u32 timeout);
int nvme_ns_attachment(int fd, __u32 nsid, __u16 num_ctrls,
const char *flbas = "FLBA size";
const char *dps = "data protection capabilities";
const char *nmic = "multipath and sharing capabilities";
+ const char *anagrpid = "ANA Group Identifier";
+ const char *nvmsetid = "NVM Set Identifier";
const char *timeout = "timeout value, in milliseconds";
const char *bs = "target block size";
__u8 flbas;
__u8 dps;
__u8 nmic;
+ __u32 anagrpid;
+ __u16 nvmsetid;
__u64 bs;
__u32 timeout;
};
struct config cfg = {
.flbas = 0xff,
+ .anagrpid = 0,
+ .nvmsetid = 0,
.bs = 0x00,
.timeout = NVME_IOCTL_TIMEOUT,
};
OPT_ARGS(opts) = {
- OPT_SUFFIX("nsze", 's', &cfg.nsze, nsze),
- OPT_SUFFIX("ncap", 'c', &cfg.ncap, ncap),
- OPT_BYTE("flbas", 'f', &cfg.flbas, flbas),
- OPT_BYTE("dps", 'd', &cfg.dps, dps),
- OPT_BYTE("nmic", 'm', &cfg.nmic, nmic),
- OPT_SUFFIX("block-size", 'b', &cfg.bs, bs),
- OPT_UINT("timeout", 't', &cfg.timeout, timeout),
+ OPT_SUFFIX("nsze", 's', &cfg.nsze, nsze),
+ OPT_SUFFIX("ncap", 'c', &cfg.ncap, ncap),
+ 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_SUFFIX("block-size", 'b', &cfg.bs, bs),
+ OPT_UINT("timeout", 't', &cfg.timeout, timeout),
OPT_END()
};
goto close_fd;
}
-
- err = nvme_ns_create(fd, cfg.nsze, cfg.ncap, cfg.flbas, cfg.dps,
- cfg.nmic, cfg.timeout, &nsid);
+ err = nvme_ns_create(fd, cfg.nsze, cfg.ncap, cfg.flbas, cfg.dps, cfg.nmic,
+ cfg.anagrpid, cfg.nvmsetid, cfg.timeout, &nsid);
if (!err)
printf("%s: Success, created nsid:%d\n", cmd->name, nsid);
else if (err > 0)