]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
zns: Add support for zone random write area (zrwa)
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Wed, 8 Dec 2021 06:18:12 +0000 (15:18 +0900)
committerDaniel Wagner <dwagner@suse.de>
Fri, 10 Dec 2021 14:53:43 +0000 (15:53 +0100)
NVMe - TP 4076 Zoned Random Write Area 2021.08.23 - Ratified

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Co-authored-by: Klaus Jensen <k.jensen@samsung.com>
16 files changed:
Documentation/nvme-zns-flush-zone.1 [new file with mode: 0644]
Documentation/nvme-zns-flush-zone.html [new file with mode: 0644]
Documentation/nvme-zns-flush-zone.txt [new file with mode: 0644]
Documentation/nvme-zns-open-zone.1
Documentation/nvme-zns-open-zone.html
Documentation/nvme-zns-open-zone.txt
Documentation/nvme-zns-set-zone-desc.1
Documentation/nvme-zns-set-zone-desc.html
Documentation/nvme-zns-set-zone-desc.txt
Documentation/nvme-zns-zone-mgmt-send.1
Documentation/nvme-zns-zone-mgmt-send.html
Documentation/nvme-zns-zone-mgmt-send.txt
completions/bash-nvme-completion.sh
nvme-print.c
plugins/zns/zns.c
plugins/zns/zns.h

diff --git a/Documentation/nvme-zns-flush-zone.1 b/Documentation/nvme-zns-flush-zone.1
new file mode 100644 (file)
index 0000000..558f119
--- /dev/null
@@ -0,0 +1,84 @@
+'\" t
+.\"     Title: nvme-zns-flush-zone
+.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
+.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
+.\"      Date: 12/08/2021
+.\"    Manual: NVMe Manual
+.\"    Source: NVMe
+.\"  Language: English
+.\"
+.TH "NVME\-ZNS\-FLUSH\-ZO" "1" "12/08/2021" "NVMe" "NVMe Manual"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+nvme-zns-flush-zone \- flush zone
+.SH "SYNOPSIS"
+.sp
+.nf
+\fInvme zns flush\-zone\fR <device> [\-\-namespace\-id=<NUM> | \-n <NUM>]
+                               [\-\-last\-lba=<LBA> | \-l <LBA>]
+                                   [\-\-timeout=<timeout> | \-t <timeout> ]
+.fi
+.SH "DESCRIPTION"
+.sp
+For the NVMe device given, issues the Zone Management Send command with the "flush Zone" action\&. This will flush the zone that is opened as zone random write area\&.
+.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"
+.PP
+\-n <NUM>, \-\-namespace\-id=<NUM>
+.RS 4
+Use the provided namespace id for the command\&. If not provided, the namespace id of the block device will be used\&. If the command is issued to a non\-block device, the parameter is required\&.
+.RE
+.PP
+\-l <lba>, \-\-last\-lba=<lba>
+.RS 4
+The last LBA of the zone to be flushed\&.
+.RE
+.PP
+\-t <timeout>, \-\-timeout=<timeout>
+.RS 4
+Override default timeout value\&. In milliseconds\&.
+.RE
+.SH "EXAMPLES"
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+flush the first zwra of first zone for zrwacg(15) on namespace 1:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+# nvme zns flush\-zone /dev/nvme0 \-n 1 \-l 15
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.SH "NVME"
+.sp
+Part of nvme\-cli
diff --git a/Documentation/nvme-zns-flush-zone.html b/Documentation/nvme-zns-flush-zone.html
new file mode 100644 (file)
index 0000000..e8026db
--- /dev/null
@@ -0,0 +1,838 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.8" />\r
+<title>nvme-zns-flush-zone(1)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+  font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+  font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+  margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+  color: blue;\r
+  text-decoration: underline;\r
+}\r
+a:visited {\r
+  color: fuchsia;\r
+}\r
+\r
+em {\r
+  font-style: italic;\r
+  color: navy;\r
+}\r
+\r
+strong {\r
+  font-weight: bold;\r
+  color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+  color: #527bbd;\r
+  margin-top: 1.2em;\r
+  margin-bottom: 0.5em;\r
+  line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+  border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+  padding-top: 0.5em;\r
+}\r
+h3 {\r
+  float: left;\r
+}\r
+h3 + * {\r
+  clear: left;\r
+}\r
+h5 {\r
+  font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+  margin-left: 0;\r
+}\r
+\r
+hr {\r
+  border: 1px solid silver;\r
+}\r
+\r
+p {\r
+  margin-top: 0.5em;\r
+  margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+  margin-top: 0;\r
+}\r
+ul > li     { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+.monospaced, code, pre {\r
+  font-family: "Courier New", Courier, monospace;\r
+  font-size: inherit;\r
+  color: navy;\r
+  padding: 0;\r
+  margin: 0;\r
+}\r
+\r
+\r
+#author {\r
+  color: #527bbd;\r
+  font-weight: bold;\r
+  font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+  font-size: small;\r
+  border-top: 2px solid silver;\r
+  padding-top: 0.5em;\r
+  margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+  float: left;\r
+  padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+  float: right;\r
+  padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+  margin-top: 1.5em;\r
+  margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+  margin-top: 1.0em;\r
+  margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+  margin-top: 2.0em;\r
+  margin-bottom: 2.0em;\r
+  margin-right: 10%;\r
+  color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+  padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+  color: #527bbd;\r
+  font-weight: bold;\r
+  text-align: left;\r
+  margin-top: 1.0em;\r
+  margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+  margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+  margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+  margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+  margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+  background: #ffffee;\r
+  border: 1px solid #dddddd;\r
+  border-left: 4px solid #f0f0f0;\r
+  padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+  border: 1px solid #dddddd;\r
+  border-left: 5px solid #f0f0f0;\r
+  background: #f8f8f8;\r
+  padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+  padding-left: 1.0em;\r
+  margin-left: 1.0em;\r
+  margin-right: 10%;\r
+  border-left: 5px solid #f0f0f0;\r
+  color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+  padding-top: 0.5em;\r
+  text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+  font-family: inherit;\r
+  font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+  padding-top: 0.75em;\r
+  text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+  text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+  vertical-align: top;\r
+  font-size: 1.1em;\r
+  font-weight: bold;\r
+  text-decoration: underline;\r
+  color: #527bbd;\r
+  padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+  padding-left: 0.5em;\r
+  border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+  border-left: 3px solid #dddddd;\r
+  padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+  margin-top: 0.8em;\r
+  margin-bottom: 0.8em;\r
+}\r
+dt {\r
+  margin-top: 0.5em;\r
+  margin-bottom: 0;\r
+  font-style: normal;\r
+  color: navy;\r
+}\r
+dd > *:first-child {\r
+  margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+    list-style-position: outside;\r
+}\r
+ol.arabic {\r
+  list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+  list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+  list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+  list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+  list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+  margin-top: 0.1em;\r
+  margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+  font-weight: bold;\r
+}\r
+td > div.verse {\r
+  white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+  margin-top: 0.8em;\r
+  margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+  padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+  font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+  vertical-align: top;\r
+  font-style: normal;\r
+  padding-right: 0.8em;\r
+  color: navy;\r
+}\r
+td.hdlist2 {\r
+  vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+  margin: 0;\r
+  padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+  background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+  font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+  vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+  margin: 20px 0 20px 0;\r
+  padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+  margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+  border: none;\r
+  border-top: 1px solid silver;\r
+  height: 1px;\r
+  text-align: left;\r
+  margin-left: 0;\r
+  width: 20%;\r
+  min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+  padding-right: 0.5em;\r
+  padding-bottom: 0.3em;\r
+  vertical-align: top;\r
+}\r
+div.colist td img {\r
+  margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+  #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+  margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+  color: #527bbd;\r
+  font-size: 1.1em;\r
+  font-weight: bold;\r
+  margin-top: 1.0em;\r
+  margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+  margin-top: 0;\r
+  margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+  margin-left: 2em;\r
+  font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+  margin-left: 4em;\r
+  font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+  margin-left: 6em;\r
+  font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+div.unbreakable { page-break-inside: avoid; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+div.tableblock {\r
+  margin-top: 1.0em;\r
+  margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+  border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+  font-weight: bold;\r
+  color: #527bbd;\r
+}\r
+p.table {\r
+  margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+  border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+  border-left-style: none;\r
+  border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+  border-top-style: none;\r
+  border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+table.tableblock {\r
+  margin-top: 1.0em;\r
+  margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+  font-weight: bold;\r
+  color: #527bbd;\r
+}\r
+p.tableblock {\r
+  margin-top: 0;\r
+}\r
+table.tableblock {\r
+  border-width: 3px;\r
+  border-spacing: 0px;\r
+  border-style: solid;\r
+  border-color: #527bbd;\r
+  border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+  border-width: 1px;\r
+  padding: 4px;\r
+  border-style: solid;\r
+  border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+  border-left-style: hidden;\r
+  border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+  border-top-style: hidden;\r
+  border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+  border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+  text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+  text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+  text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+  vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+  vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+  vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+  padding-top: 0.5em;\r
+  padding-bottom: 0.5em;\r
+  border-top: 2px solid silver;\r
+  border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+  border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+  margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+  body.manpage div#toc { display: none; }\r
+}\r
+\r
+\r
+</style>\r
+<script type="text/javascript">\r
+/*<![CDATA[*/\r
+var asciidoc = {  // Namespace.\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Table Of Contents generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Author: Mihai Bazon, September 2002\r
+ * http://students.infoiasi.ro/~mishoo\r
+ *\r
+ * Table Of Content generator\r
+ * Version: 0.4\r
+ *\r
+ * Feel free to use this script under the terms of the GNU General Public\r
+ * License, as long as you do not remove or alter this notice.\r
+ */\r
+\r
+ /* modified by Troy D. Hanson, September 2006. License: GPL */\r
+ /* modified by Stuart Rackham, 2006, 2009. License: GPL */\r
+\r
+// toclevels = 1..4.\r
+toc: function (toclevels) {\r
+\r
+  function getText(el) {\r
+    var text = "";\r
+    for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.\r
+        text += i.data;\r
+      else if (i.firstChild != null)\r
+        text += getText(i);\r
+    }\r
+    return text;\r
+  }\r
+\r
+  function TocEntry(el, text, toclevel) {\r
+    this.element = el;\r
+    this.text = text;\r
+    this.toclevel = toclevel;\r
+  }\r
+\r
+  function tocEntries(el, toclevels) {\r
+    var result = new Array;\r
+    var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');\r
+    // Function that scans the DOM tree for header elements (the DOM2\r
+    // nodeIterator API would be a better technique but not supported by all\r
+    // browsers).\r
+    var iterate = function (el) {\r
+      for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+          var mo = re.exec(i.tagName);\r
+          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+          }\r
+          iterate(i);\r
+        }\r
+      }\r
+    }\r
+    iterate(el);\r
+    return result;\r
+  }\r
+\r
+  var toc = document.getElementById("toc");\r
+  if (!toc) {\r
+    return;\r
+  }\r
+\r
+  // Delete existing TOC entries in case we're reloading the TOC.\r
+  var tocEntriesToRemove = [];\r
+  var i;\r
+  for (i = 0; i < toc.childNodes.length; i++) {\r
+    var entry = toc.childNodes[i];\r
+    if (entry.nodeName.toLowerCase() == 'div'\r
+     && entry.getAttribute("class")\r
+     && entry.getAttribute("class").match(/^toclevel/))\r
+      tocEntriesToRemove.push(entry);\r
+  }\r
+  for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+    toc.removeChild(tocEntriesToRemove[i]);\r
+  }\r
+\r
+  // Rebuild TOC entries.\r
+  var entries = tocEntries(document.getElementById("content"), toclevels);\r
+  for (var i = 0; i < entries.length; ++i) {\r
+    var entry = entries[i];\r
+    if (entry.element.id == "")\r
+      entry.element.id = "_toc_" + i;\r
+    var a = document.createElement("a");\r
+    a.href = "#" + entry.element.id;\r
+    a.appendChild(document.createTextNode(entry.text));\r
+    var div = document.createElement("div");\r
+    div.appendChild(a);\r
+    div.className = "toclevel" + entry.toclevel;\r
+    toc.appendChild(div);\r
+  }\r
+  if (entries.length == 0)\r
+    toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+  // Delete existing footnote entries in case we're reloading the footnodes.\r
+  var i;\r
+  var noteholder = document.getElementById("footnotes");\r
+  if (!noteholder) {\r
+    return;\r
+  }\r
+  var entriesToRemove = [];\r
+  for (i = 0; i < noteholder.childNodes.length; i++) {\r
+    var entry = noteholder.childNodes[i];\r
+    if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")\r
+      entriesToRemove.push(entry);\r
+  }\r
+  for (i = 0; i < entriesToRemove.length; i++) {\r
+    noteholder.removeChild(entriesToRemove[i]);\r
+  }\r
+\r
+  // Rebuild footnote entries.\r
+  var cont = document.getElementById("content");\r
+  var spans = cont.getElementsByTagName("span");\r
+  var refs = {};\r
+  var n = 0;\r
+  for (i=0; i<spans.length; i++) {\r
+    if (spans[i].className == "footnote") {\r
+      n++;\r
+      var note = spans[i].getAttribute("data-note");\r
+      if (!note) {\r
+        // Use [\s\S] in place of . so multi-line matches work.\r
+        // Because JavaScript has no s (dotall) regex flag.\r
+        note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+        spans[i].innerHTML =\r
+          "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+          "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+        spans[i].setAttribute("data-note", note);\r
+      }\r
+      noteholder.innerHTML +=\r
+        "<div class='footnote' id='_footnote_" + n + "'>" +\r
+        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+        n + "</a>. " + note + "</div>";\r
+      var id =spans[i].getAttribute("id");\r
+      if (id != null) refs["#"+id] = n;\r
+    }\r
+  }\r
+  if (n == 0)\r
+    noteholder.parentNode.removeChild(noteholder);\r
+  else {\r
+    // Process footnoterefs.\r
+    for (i=0; i<spans.length; i++) {\r
+      if (spans[i].className == "footnoteref") {\r
+        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+        href = href.match(/#.*/)[0];  // Because IE return full URL.\r
+        n = refs[href];\r
+        spans[i].innerHTML =\r
+          "[<a href='#_footnote_" + n +\r
+          "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+      }\r
+    }\r
+  }\r
+},\r
+\r
+install: function(toclevels) {\r
+  var timerId;\r
+\r
+  function reinstall() {\r
+    asciidoc.footnotes();\r
+    if (toclevels) {\r
+      asciidoc.toc(toclevels);\r
+    }\r
+  }\r
+\r
+  function reinstallAndRemoveTimer() {\r
+    clearInterval(timerId);\r
+    reinstall();\r
+  }\r
+\r
+  timerId = setInterval(reinstall, 500);\r
+  if (document.addEventListener)\r
+    document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+  else\r
+    window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+nvme-zns-flush-zone(1) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>nvme-zns-flush-zone -\r
+   flush zone\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="verseblock">\r
+<pre class="content"><em>nvme zns flush-zone</em> &lt;device&gt; [--namespace-id=&lt;NUM&gt; | -n &lt;NUM&gt;]\r
+                               [--last-lba=&lt;LBA&gt; | -l &lt;LBA&gt;]\r
+                                   [--timeout=&lt;timeout&gt; | -t &lt;timeout&gt; ]</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, issues the Zone Management Send command with the\r
+"flush Zone" action. This will flush the zone that is opened as\r
+zone random write area.</p></div>\r
+<div class="paragraph"><p>The &lt;device&gt; 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
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+-n &lt;NUM&gt;\r
+</dt>\r
+<dt class="hdlist1">\r
+--namespace-id=&lt;NUM&gt;\r
+</dt>\r
+<dd>\r
+<p>\r
+        Use the provided namespace id for the command. If not provided, the\r
+        namespace id of the block device will be used. If the command is issued\r
+        to a non-block device, the parameter is required.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+-l &lt;lba&gt;\r
+</dt>\r
+<dt class="hdlist1">\r
+--last-lba=&lt;lba&gt;\r
+</dt>\r
+<dd>\r
+<p>\r
+        The last LBA of the zone to be flushed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+-t &lt;timeout&gt;\r
+</dt>\r
+<dt class="hdlist1">\r
+--timeout=&lt;timeout&gt;\r
+</dt>\r
+<dd>\r
+<p>\r
+        Override default timeout value. In milliseconds.\r
+</p>\r
+</dd>\r
+</dl></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_examples">EXAMPLES</h2>\r
+<div class="sectionbody">\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+flush the first zwra of first zone for zrwacg(15) on namespace 1:\r
+</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><code># nvme zns flush-zone /dev/nvme0 -n 1 -l 15</code></pre>\r
+</div></div>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_nvme">NVME</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Part of nvme-cli</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+Last updated 2021-12-07 17:49:58 KST\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
diff --git a/Documentation/nvme-zns-flush-zone.txt b/Documentation/nvme-zns-flush-zone.txt
new file mode 100644 (file)
index 0000000..f1ee558
--- /dev/null
@@ -0,0 +1,50 @@
+nvme-zns-flush-zone(1)
+======================
+
+NAME
+----
+nvme-zns-flush-zone - flush zone
+
+SYNOPSIS
+--------
+[verse]
+'nvme zns flush-zone' <device> [--namespace-id=<NUM> | -n <NUM>]
+                              [--last-lba=<LBA> | -l <LBA>]
+                                  [--timeout=<timeout> | -t <timeout> ]
+
+DESCRIPTION
+-----------
+For the NVMe device given, issues the Zone Management Send command with the
+"flush Zone" action. This will flush the zone that is opened as
+zone random write area.
+
+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
+-------
+-n <NUM>::
+--namespace-id=<NUM>::
+       Use the provided namespace id for the command. If not provided, the
+       namespace id of the block device will be used. If the command is issued
+       to a non-block device, the parameter is required.
+
+-l <lba>::
+--last-lba=<lba>::
+       The last LBA of the zone to be flushed. 
+
+-t <timeout>::
+--timeout=<timeout>::
+       Override default timeout value. In milliseconds.
+
+EXAMPLES
+--------
+* flush the first zwra of first zone for zrwacg(15) on namespace 1:
++
+------------
+# nvme zns flush-zone /dev/nvme0 -n 1 -l 15
+------------
+
+NVME
+----
+Part of nvme-cli
index 99fff88f4d0437f73e563bf66c26ea7ffb047bc3..037f3fcd2f05f9f6182aca7cdea0acc869b7d620 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: nvme-zns-open-zone
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 08/26/2021
+.\"      Date: 12/08/2021
 .\"    Manual: NVMe Manual
 .\"    Source: NVMe
 .\"  Language: English
 .\"
-.TH "NVME\-ZNS\-OPEN\-ZON" "1" "08/26/2021" "NVMe" "NVMe Manual"
+.TH "NVME\-ZNS\-OPEN\-ZON" "1" "12/08/2021" "NVMe" "NVMe Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -34,6 +34,7 @@ nvme-zns-open-zone \- Opens one or all zones
 .nf
 \fInvme zns open\-zone\fR <device> [\-\-namespace\-id=<NUM> | \-n <NUM>]
                                                 [\-\-start\-lba=<LBA> | \-s <LBA>]
+                                                [\-\-zrwa | \-r]
                                                 [\-\-select\-all | \-a]
                                                 [\-\-timeout=<timeout> | \-t <timeout>]
 .fi
@@ -54,6 +55,11 @@ Use the provided namespace id for the command\&. If not provided, the namespace
 The starting LBA of the zone to open\&.
 .RE
 .PP
+\-r, \-\-zrwa
+.RS 4
+Zone Random Write Area Allocation
+.RE
+.PP
 \-a, \-\-select\-all
 .RS 4
 Select all zones for this action
index 62a7e128557152ededabc62011b3f2019be0c7b3..b2407355486964bdc30a676ee8980bb4b9d155bc 100644 (file)
@@ -748,6 +748,7 @@ nvme-zns-open-zone(1) Manual Page
 <div class="verseblock">\r
 <pre class="content"><em>nvme zns open-zone</em> &lt;device&gt; [--namespace-id=&lt;NUM&gt; | -n &lt;NUM&gt;]\r
                                                 [--start-lba=&lt;LBA&gt; | -s &lt;LBA&gt;]\r
+                                                [--zrwa | -r]\r
                                                 [--select-all | -a]\r
                                                 [--timeout=&lt;timeout&gt; | -t &lt;timeout&gt;]</pre>\r
 <div class="attribution">\r
@@ -792,6 +793,17 @@ device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).</p></di
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
+-r\r
+</dt>\r
+<dt class="hdlist1">\r
+--zrwa\r
+</dt>\r
+<dd>\r
+<p>\r
+        Zone Random Write Area Allocation\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
 -a\r
 </dt>\r
 <dt class="hdlist1">\r
@@ -842,7 +854,7 @@ Open the first zone on namespace 1:
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 2021-08-26 14:39:34 KST\r
+Last updated 2021-12-08 15:16:54 KST\r
 </div>\r
 </div>\r
 </body>\r
index bf1c9118eae2efa91a022c13cf18bd0140ad4d9a..420320c60bd33084f9d7ee7e45cf6206eb39c78b 100644 (file)
@@ -10,6 +10,7 @@ SYNOPSIS
 [verse]
 'nvme zns open-zone' <device> [--namespace-id=<NUM> | -n <NUM>]
                                                [--start-lba=<LBA> | -s <LBA>]
+                                               [--zrwa | -r]
                                                [--select-all | -a]
                                                [--timeout=<timeout> | -t <timeout>]
 
@@ -33,6 +34,10 @@ OPTIONS
 --start-lba=<lba>::
        The starting LBA of the zone to open. 
 
+-r::
+--zrwa::
+       Zone Random Write Area Allocation
+
 -a::
 --select-all::
        Select all zones for this action
index b3130d6adf9406d23c681d86aef8cd53327e1a54..bbb6b200aa26a3e179435368b2a160e10e1e138f 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: nvme-zns-set-zone-desc
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 08/26/2021
+.\"      Date: 12/08/2021
 .\"    Manual: NVMe Manual
 .\"    Source: NVMe
 .\"  Language: English
 .\"
-.TH "NVME\-ZNS\-SET\-ZONE" "1" "08/26/2021" "NVMe" "NVMe Manual"
+.TH "NVME\-ZNS\-SET\-ZONE" "1" "12/08/2021" "NVMe" "NVMe Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -34,6 +34,7 @@ nvme-zns-set-zone-desc \- Set extended descriptor data for a zone
 .nf
 \fInvme zns setzone\-desc\fR <device> [\-\-namespace\-id=<NUM> | \-n <NUM>]
                                  [\-\-start\-lba=<IONUM>, \-s <IONUM>]
+                                 [\-\-zrwa | \-r]
                                  [\-data=<FILE>, \-d <FILE>]
                                  [\-\-timeout=<timeout> | \-t <timeout>]
 .fi
@@ -52,6 +53,11 @@ Use the provided namespace id for the command\&. If not provided, the namespace
 The starting LBA of the zone to manage send\&.
 .RE
 .PP
+\-r, \-\-zrwa
+.RS 4
+Zone Random Write Area Allocation
+.RE
+.PP
 \-d <FILE, \-data=<FILE>
 .RS 4
 Optional file for data (default stdin)
index 3fe678b0a5f3b3ab7b7cd57805cb0290046caf4f..b595554bbf84977b682b987e3535bbadec6a5033 100644 (file)
@@ -748,6 +748,7 @@ nvme-zns-set-zone-desc(1) Manual Page
 <div class="verseblock">\r
 <pre class="content"><em>nvme zns setzone-desc</em> &lt;device&gt; [--namespace-id=&lt;NUM&gt; | -n &lt;NUM&gt;]\r
                                  [--start-lba=&lt;IONUM&gt;, -s &lt;IONUM&gt;]\r
+                                 [--zrwa | -r]\r
                                  [-data=&lt;FILE&gt;, -d &lt;FILE&gt;]\r
                                  [--timeout=&lt;timeout&gt; | -t &lt;timeout&gt;]</pre>\r
 <div class="attribution">\r
@@ -792,6 +793,17 @@ length will automatically be calculated from the zns identify namesapce.</p></di
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
+-r\r
+</dt>\r
+<dt class="hdlist1">\r
+--zrwa\r
+</dt>\r
+<dd>\r
+<p>\r
+        Zone Random Write Area Allocation\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
 -d &lt;FILE\r
 </dt>\r
 <dt class="hdlist1">\r
@@ -843,7 +855,7 @@ Write "hello world" into the zone descriptor for namespace 1&#8217;s first zone
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 2021-08-26 14:39:19 KST\r
+Last updated 2021-12-08 15:17:18 KST\r
 </div>\r
 </div>\r
 </body>\r
index 880d405f6c4d3769cbbfdfce471b815053cfe0ee..c24afa460c53202ac1ae017be931ed99bbb7621a 100644 (file)
@@ -10,6 +10,7 @@ SYNOPSIS
 [verse]
 'nvme zns setzone-desc' <device> [--namespace-id=<NUM> | -n <NUM>]
                                 [--start-lba=<IONUM>, -s <IONUM>]
+                                [--zrwa | -r]
                                 [-data=<FILE>, -d <FILE>]
                                 [--timeout=<timeout> | -t <timeout>]
 
@@ -32,6 +33,10 @@ OPTIONS
 --start-lba=<lba>::
        The starting LBA of the zone to manage send.
 
+-r::
+--zrwa::
+       Zone Random Write Area Allocation
+
 -d <FILE::
 -data=<FILE>::
        Optional file for data (default stdin)
index 40725a51cce837463debf68a856026e163f78470..dc8bd2a2757b8f93f513c5d22f753263af88b755 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: nvme-zns-zone-mgmt-send
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 08/26/2021
+.\"      Date: 12/08/2021
 .\"    Manual: NVMe Manual
 .\"    Source: NVMe
 .\"  Language: English
 .\"
-.TH "NVME\-ZNS\-ZONE\-MGM" "1" "08/26/2021" "NVMe" "NVMe Manual"
+.TH "NVME\-ZNS\-ZONE\-MGM" "1" "12/08/2021" "NVMe" "NVMe Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -34,10 +34,11 @@ nvme-zns-zone-mgmt-send \- Zone Management Send command
 .nf
 \fInvme zns zone\-mgmt\-send\fR <device> [\-\-namespace\-id=<NUM> | \-n <NUM>]
                                    [\-\-start\-lba=<IONUM>, \-s <IONUM>]
+                                   [\-\-zsaso, \-o]
                                    [\-\-select\-all, \-a]
                                    [\-\-zsa=<NUM>, \-z <NUM>]
                                    [\-\-data\-len=<IONUM>, \-l <IONUM>]
-                                   [\-data=<FILE>, \-d <FILE>]
+                                   [\-\-data=<FILE>, \-d <FILE>]
                                    [\-\-timeout=<timeout> | \-t <timeout>]
 .fi
 .SH "DESCRIPTION"
@@ -60,6 +61,11 @@ The starting LBA of the zone to manage send\&.
 Send data buffer length
 .RE
 .PP
+\-o, \-\-zsaso
+.RS 4
+Zone Send Action Specific Option
+.RE
+.PP
 \-\-select\-all, \-a
 .RS 4
 Send command to all zones
@@ -75,7 +81,7 @@ Zone send action\&.
 Buffer length if data required
 .RE
 .PP
-\-d <FILE, \-data=<FILE>
+\-d <FILE, \-\-data=<FILE>
 .RS 4
 Optional file for data (default stdin)
 .RE
index d74cc25655cf0cda2682fe73e050bc035c49b46c..383290132b3f02e6dc0a87f3277d4eb8330a6ec6 100644 (file)
@@ -748,10 +748,11 @@ nvme-zns-zone-mgmt-send(1) Manual Page
 <div class="verseblock">\r
 <pre class="content"><em>nvme zns zone-mgmt-send</em> &lt;device&gt; [--namespace-id=&lt;NUM&gt; | -n &lt;NUM&gt;]\r
                                    [--start-lba=&lt;IONUM&gt;, -s &lt;IONUM&gt;]\r
+                                   [--zsaso, -o]\r
                                    [--select-all, -a]\r
                                    [--zsa=&lt;NUM&gt;, -z &lt;NUM&gt;]\r
                                    [--data-len=&lt;IONUM&gt;, -l &lt;IONUM&gt;]\r
-                                   [-data=&lt;FILE&gt;, -d &lt;FILE&gt;]\r
+                                   [--data=&lt;FILE&gt;, -d &lt;FILE&gt;]\r
                                    [--timeout=&lt;timeout&gt; | -t &lt;timeout&gt;]</pre>\r
 <div class="attribution">\r
 </div></div>\r
@@ -806,6 +807,17 @@ Alternatively, the data may come from a file that can be specified.</p></div>
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
+-o\r
+</dt>\r
+<dt class="hdlist1">\r
+--zsaso\r
+</dt>\r
+<dd>\r
+<p>\r
+        Zone Send Action Specific Option\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
 --select-all\r
 </dt>\r
 <dt class="hdlist1">\r
@@ -842,7 +854,7 @@ Alternatively, the data may come from a file that can be specified.</p></div>
 -d &lt;FILE\r
 </dt>\r
 <dt class="hdlist1">\r
--data=&lt;FILE&gt;\r
+--data=&lt;FILE&gt;\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -900,7 +912,7 @@ Write "hello world" into the zone descriptor for namespace 1&#8217;s first zone
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 2021-08-26 14:39:47 KST\r
+Last updated 2021-12-07 17:53:10 KST\r
 </div>\r
 </div>\r
 </body>\r
index bf34d5e6400f7797e7b2d64f334dae23f381d0fc..8cbb5c0b5a8a299366620dfe4ea14a861e1d79c5 100644 (file)
@@ -10,10 +10,11 @@ SYNOPSIS
 [verse]
 'nvme zns zone-mgmt-send' <device> [--namespace-id=<NUM> | -n <NUM>]
                                   [--start-lba=<IONUM>, -s <IONUM>]
+                                  [--zsaso, -o]
                                   [--select-all, -a]
                                   [--zsa=<NUM>, -z <NUM>]
                                   [--data-len=<IONUM>, -l <IONUM>]
-                                  [-data=<FILE>, -d <FILE>]
+                                  [--data=<FILE>, -d <FILE>]
                                   [--timeout=<timeout> | -t <timeout>]
 
 DESCRIPTION
@@ -39,6 +40,10 @@ OPTIONS
 --data-len=<NUM>::
        Send data buffer length
 
+-o::
+--zsaso::
+       Zone Send Action Specific Option
+
 --select-all::
 -a::
        Send command to all zones
@@ -52,7 +57,7 @@ OPTIONS
        Buffer length if data required
 
 -d <FILE::
--data=<FILE>::
+--data=<FILE>::
        Optional file for data (default stdin)
 
 -t <timeout>::
index 052566d0feb1a2e4148ad40bc189c089c549dafd..f3812738f6278b113555cc635bb9997efd6d95ad 100644 (file)
@@ -1257,7 +1257,7 @@ plugin_zns_opts () {
                        --data-len= -l"
                        ;;
                "zone-mgmt-send")
-               opts+=" --namespace-id= -n --start-lba= -s \
+               opts+=" --namespace-id= -n --start-lba= -s --zsaso -o \
                        --select-all -a --zsa= -z --data-len= -l \
                        --data= -d --timeout= -t"
                        ;;
@@ -1276,7 +1276,7 @@ plugin_zns_opts () {
                        ;;
                "open-zone")
                opts+=" --namespace-id= -n --start-lba= -s \
-                       --select-all -a --timeout= -t"
+                       --select-all -a --timeout= -t --zrwa -r"
                        ;;
                "reset-zone")
                opts+=" --namespace-id= -n --start-lba= -s \
@@ -1288,7 +1288,10 @@ plugin_zns_opts () {
                        ;;
                "set-zone-desc")
                opts+=" --namespace-id= -n --start-lba= -s \
-                       --data= -d --timeout= -t"
+                       --data= -d --timeout= -t  --zrwa -r"
+                       ;;
+               "flush-zone")
+               opts+=" --namespace-id= -n --last-lba= -l --timeout= -t"
                        ;;
                "zone-append")
                opts+=" --namespace-id= -n --zslba= -s --data-size= -z \
index a199073dd4f4570ee2c8fa6f6f83b953fe19a69f..1254998758262041fb3ebff3ed8dc6370bfe9bc2 100644 (file)
@@ -4299,6 +4299,10 @@ static void json_nvme_zns_id_ns(struct nvme_zns_id_ns *ns,
        json_object_add_value_int(root, "frl1", le32_to_cpu(ns->frl1));
        json_object_add_value_int(root, "frl2", le32_to_cpu(ns->frl2));
        json_object_add_value_int(root, "frl3", le32_to_cpu(ns->frl3));
+       json_object_add_value_int(root, "numzrwa", le32_to_cpu(ns->numzrwa));
+       json_object_add_value_int(root, "zrwafg", le16_to_cpu(ns->zrwafg));
+       json_object_add_value_int(root, "zrwasz", le16_to_cpu(ns->zrwasz));
+       json_object_add_value_int(root, "zrwacap", ns->zrwacap);
 
        lbafs = json_create_array();
        json_object_add_value_array(root, "lbafe", lbafs);
@@ -4335,13 +4339,16 @@ static void show_nvme_id_ns_zoned_zoc(__le16 ns_zoc)
 static void show_nvme_id_ns_zoned_ozcs(__le16 ns_ozcs)
 {
        __u16 ozcs = le16_to_cpu(ns_ozcs);
-       __u8 rsvd = (ozcs & 0xfffe) >> 1;
+       __u8 rsvd = (ozcs & 0xfffc) >> 2;
        __u8 razb = ozcs & 0x1;
+       __u8 zrwasup = (ozcs & 0x2) >> 1;
 
        if (rsvd)
                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 ");
 }
 
 static void nvme_show_zns_id_ns_recommandeded_limit(__le32 ns_rl, int human, 
@@ -4354,6 +4361,17 @@ static void nvme_show_zns_id_ns_recommandeded_limit(__le32 ns_rl, int human,
                printf("%s    : %u\n", target_limit, recommandeded_limit);      
 }
 
+static void nvme_show_zns_id_ns_zrwacap(__u8 zrwacap)
+{
+       __u8 rsvd = (zrwacap & 0xfe) >> 1;
+       __u8 expflushsup = zrwacap & 0x1;
+
+       if (rsvd)
+               printf(" [7:1] : %#x\tReserved\n", rsvd);
+       printf("  [0:0] : %#x\t  Explicit ZRWA Flush %sSupported\n",
+               expflushsup, expflushsup ? "" : "Not ");
+}
+
 void nvme_show_zns_id_ns(struct nvme_zns_id_ns *ns,
        struct nvme_id_ns *id_ns, unsigned long flags)
 {
@@ -4411,6 +4429,16 @@ 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("zrwafg  : %u\n", le16_to_cpu(ns->zrwafg));
+       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);
+       } else {
+               printf("zrwacap : %u\n", ns->zrwacap);
+       }
+
        for (i = 0; i <= id_ns->nlbaf; i++){
                if (human)
                        printf("LBA Format Extension %2d : Zone Size: 0x%"PRIx64" LBAs - "
index 17283110703a4cf842ad42ef94f9594243916961..066aa0f18069ab39a228457998362adfe563004a 100644 (file)
@@ -225,14 +225,14 @@ close_fd:
        return nvme_status_to_errno(err, false);
 }
 
-static int __zns_mgmt_send(int fd, __u32 namespace_id, __u64 zslba, 
+static int __zns_mgmt_send(int fd, __u32 namespace_id, __u64 zslba, __u8 zsaso,
        bool select_all, __u32 timeout, enum nvme_zns_send_action zsa, 
        __u32 data_len, void *buf)
 {
        int err;
-
-       err = nvme_zns_mgmt_send(fd, namespace_id, zslba, zsa, select_all,
+       err = nvme_zns_mgmt_send(fd, namespace_id, zslba, zsa, select_all, zsaso,
                                 data_len, buf, timeout, NULL);
+
        close(fd);
        return err;
 }
@@ -280,7 +280,7 @@ static int zns_mgmt_send(int argc, char **argv, struct command *cmd, struct plug
                }
        }
 
-       err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba,
+       err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba, 0,
                cfg.select_all, cfg.timeout, zsa, 0, NULL);
        if (!err)
                printf("%s: Success, action:%d zone:%"PRIx64" all:%d nsid:%d\n",
@@ -330,7 +330,9 @@ static int get_zdes_bytes(int fd, __u32 nsid)
 static int zone_mgmt_send(int argc, char **argv, struct command *cmd, struct plugin *plugin)
 {
        const char *desc = "Zone Management Send";
-       const char *zslba = "starting LBA of the zone for this command";
+       const char *zslba = "starting LBA of the zone for this command"\
+                                               "(for flush action, last lba to flush)";
+       const char *zsaso = "Zone Send Action Specific Option";
        const char *select_all = "send command to all zones";
        const char *zsa = "zone send action";
        const char *data_len = "buffer length if data required";
@@ -343,6 +345,7 @@ static int zone_mgmt_send(int argc, char **argv, struct command *cmd, struct plu
        struct config {
                __u64   zslba;
                __u32   namespace_id;
+               __u8    zsaso;
                bool    select_all;
                __u8    zsa;
                int     data_len;
@@ -355,6 +358,7 @@ static int zone_mgmt_send(int argc, char **argv, struct command *cmd, struct plu
        OPT_ARGS(opts) = {
                OPT_UINT("namespace-id", 'n', &cfg.namespace_id,  namespace_id),
                OPT_SUFFIX("start-lba",  's', &cfg.zslba,         zslba),
+               OPT_FLAG("zsaso",        'o', &cfg.zsaso,         zsaso),
                OPT_FLAG("select-all",   'a', &cfg.select_all,    select_all),
                OPT_BYTE("zsa",          'z', &cfg.zsa,           zsa),
                OPT_UINT("data-len",     'l', &cfg.data_len,      data_len),
@@ -423,8 +427,8 @@ static int zone_mgmt_send(int argc, char **argv, struct command *cmd, struct plu
                }
        }
 
-       err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba, cfg.select_all,
-                       cfg.timeout, cfg.zsa, cfg.data_len, buf);
+       err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba, cfg.zsaso,
+                       cfg.select_all, cfg.timeout, cfg.zsa, cfg.data_len, buf);
        if (!err)
                printf("zone-mgmt-send: Success, action:%d zone:%"PRIx64" "
                        "all:%d nsid:%d\n",
@@ -462,8 +466,55 @@ static int finish_zone(int argc, char **argv, struct command *cmd, struct plugin
 static int open_zone(int argc, char **argv, struct command *cmd, struct plugin *plugin)
 {
        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 *select_all = "send command to all zones";
+       const char *timeout = "timeout value, in milliseconds";
+
+       int err, fd;
+
+       struct config {
+               __u64   zslba;
+               __u32   namespace_id;
+               bool    zrwa;
+               bool    select_all;
+               __u32   timeout;
+       };
+
+       struct config cfg = {
+       };
+
+       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("select-all",   'a', &cfg.select_all,    select_all),
+               OPT_UINT("timeout",      't', &cfg.timeout,       timeout),
+               OPT_END()
+       };
 
-       return zns_mgmt_send(argc, argv, cmd, plugin, desc, NVME_ZNS_ZSA_OPEN);
+       fd = parse_and_open(argc, argv, desc, opts);
+       if (fd < 0)
+               return errno;
+
+       if (!cfg.namespace_id) {
+               err = nvme_get_nsid(fd, &cfg.namespace_id);
+               if (err < 0) {
+                       perror("get-namespace-id");
+                       goto close_fd;
+               }
+       }
+
+       err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba, cfg.zrwa,
+               cfg.select_all, cfg.timeout, NVME_ZNS_ZSA_OPEN, 0, NULL);
+       if (!err)
+               printf("zns-open-zone: Success zone slba:%"PRIx64" nsid:%d\n",
+                       (uint64_t)cfg.zslba, cfg.namespace_id);
+       else
+               nvme_show_status(err);
+close_fd:
+       close(fd);
+       return nvme_status_to_errno(err, false);
 }
 
 static int reset_zone(int argc, char **argv, struct command *cmd, struct plugin *plugin)
@@ -484,6 +535,7 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug
 {
        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 *data = "optional file for zone extention data (default stdin)";
        const char *timeout = "timeout value, in milliseconds";
 
@@ -493,6 +545,7 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug
 
        struct config {
                __u64   zslba;
+               bool    zrwa;
                __u32   namespace_id;
                char   *file;
                __u32   timeout;
@@ -503,6 +556,7 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug
        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_FILE("data",         'd', &cfg.file,          data),
                OPT_UINT("timeout",      't', &cfg.timeout,       timeout),
                OPT_END()
@@ -552,8 +606,8 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug
                goto close_ffd;
        }
 
-       err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba, 0, cfg.timeout,
-               NVME_ZNS_ZSA_SET_DESC_EXT, data_len, buf);
+       err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zslba, cfg.zrwa, 0,
+               cfg.timeout, NVME_ZNS_ZSA_SET_DESC_EXT, data_len, buf);
        if (!err)
                printf("set-zone-desc: Success, zone:%"PRIx64" nsid:%d\n",
                        (uint64_t)cfg.zslba, cfg.namespace_id);
@@ -571,6 +625,54 @@ close_fd:
        return nvme_status_to_errno(err, false);
 }
 
+
+static int 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 *timeout = "timeout value, in milliseconds";
+
+       int err, fd;
+
+       struct config {
+               __u64   zllba;
+               __u32   namespace_id;
+               __u32   timeout;
+       };
+
+       struct config cfg = {};
+
+       OPT_ARGS(opts) = {
+               OPT_UINT("namespace-id", 'n', &cfg.namespace_id,  namespace_id),
+               OPT_SUFFIX("last-lba",   'l', &cfg.zllba,         zllba),
+               OPT_UINT("timeout",      't', &cfg.timeout,       timeout),
+               OPT_END()
+       };
+
+       fd = parse_and_open(argc, argv, desc, opts);
+       if (fd < 0)
+               return errno;
+
+       if (!cfg.namespace_id) {
+               err = nvme_get_nsid(fd, &cfg.namespace_id);
+               if (err < 0) {
+                       perror("get-namespace-id");
+                       goto close_fd;
+               }
+       }
+
+       err = __zns_mgmt_send(fd, cfg.namespace_id, cfg.zllba, 0, 0, cfg.timeout,
+               NVME_ZNS_ZSA_ZRWA_FLUSH, 0, NULL);
+       if (!err)
+               printf("zns-flush-zone: Success, last lba:%"PRIx64" nsid:%d\n",
+                       (uint64_t)cfg.zllba, cfg.namespace_id);
+       else
+               nvme_show_status(err);
+close_fd:
+       close(fd);
+       return nvme_status_to_errno(err, false);
+}
+
 static int zone_mgmt_recv(int argc, char **argv, struct command *cmd, struct plugin *plugin)
 {
        const char *desc = "Zone Management Receive";
index 17011e1d7103f88198ee425d270c7808978345c2..29af49b368f25e111750ff8010202e20b3190b3d 100644 (file)
@@ -18,6 +18,7 @@ PLUGIN(NAME("zns", "Zoned Namespace Command Set", NVME_VERSION),
                ENTRY("open-zone", "Open one or more zones", open_zone)
                ENTRY("offline-zone", "Offline one or more zones", offline_zone)
                ENTRY("set-zone-desc", "Attach zone descriptor extension data to a zone", set_zone_desc)
+               ENTRY("flush-zone", "Flushes a range of logical blocks from a ZRWA to a zone.", flush_zone)
                ENTRY("changed-zone-list", "Retrieve the changed zone list log", changed_zone_list)
                ENTRY("zone-mgmt-recv", "Send the zone management receive command", zone_mgmt_recv)
                ENTRY("zone-mgmt-send", "Send the zone management send command", zone_mgmt_send)