From 9559da8cab8f508bfa55116daf1fffb54c8b4cd3 Mon Sep 17 00:00:00 2001 From: Gollu Appalanaidu Date: Thu, 18 Feb 2021 15:57:17 +0530 Subject: [PATCH] nvme: add man page and completions of nvm command set id controller This is to add the man page for the NVM comand set Identify Controller struture and zsh, bash completions. Signed-off-by: Gollu Appalanaidu Co-Authored-By: Karthik Balan --- Documentation/nvme-nvm-id-ctrl.1 | 98 ++++ Documentation/nvme-nvm-id-ctrl.html | 828 ++++++++++++++++++++++++++++ Documentation/nvme-nvm-id-ctrl.txt | 49 ++ completions/_nvme | 11 +- completions/bash-nvme-completion.sh | 5 +- 5 files changed, 989 insertions(+), 2 deletions(-) create mode 100644 Documentation/nvme-nvm-id-ctrl.1 create mode 100644 Documentation/nvme-nvm-id-ctrl.html create mode 100644 Documentation/nvme-nvm-id-ctrl.txt diff --git a/Documentation/nvme-nvm-id-ctrl.1 b/Documentation/nvme-nvm-id-ctrl.1 new file mode 100644 index 00000000..4d1c634e --- /dev/null +++ b/Documentation/nvme-nvm-id-ctrl.1 @@ -0,0 +1,98 @@ +'\" t +.\" Title: nvme-nvm-id-ctrl +.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 02/18/2021 +.\" Manual: NVMe Manual +.\" Source: NVMe +.\" Language: English +.\" +.TH "NVME\-NVM\-ID\-CTRL" "1" "02/18/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-nvm-id-ctrl \- Send NVMe Identify Controller, return NVM command set structure +.SH "SYNOPSIS" +.sp +.nf +\fInvme nvm\-id\-ctrl\fR [\-o | \-\-output\-format=] +.fi +.SH "DESCRIPTION" +.sp +For the NVMe device given, sends the NVM command set\(cqs identify controller command and provides the result and returned structure\&. +.sp +The parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&. +.sp +On success, the data structure returned by the device will be decoded and displayed in one of several ways\&. +.SH "OPTIONS" +.PP +\-o , \-\-output\-format= +.RS 4 +Set the reporting format to +\fInormal\fR, +\fIjson\fR, or +\fIbinary\fR\&. Only one output format can be used at a time\&. +.RE +.SH "EXAMPLES" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Has the program interpret the returned buffer and display the known fields in a human readable format: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# nvme nvm\-id\-ctrl /dev/nvme0 +.fi +.if n \{\ +.RE +.\} +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Show the output in json format +.sp +.if n \{\ +.RS 4 +.\} +.nf +# nvme nvm\-id\-ctrl /dev/nvme0 \-o json +.fi +.if n \{\ +.RE +.\} +.RE +.SH "NVME" +.sp +Part of nvme\-cli diff --git a/Documentation/nvme-nvm-id-ctrl.html b/Documentation/nvme-nvm-id-ctrl.html new file mode 100644 index 00000000..fa08be05 --- /dev/null +++ b/Documentation/nvme-nvm-id-ctrl.html @@ -0,0 +1,828 @@ + + + + + + +nvme-nvm-id-ctrl(1) + + + + + +
+
+

SYNOPSIS

+
+
+
nvme nvm-id-ctrl <device> [-o <fmt> | --output-format=<fmt>]
+
+
+
+
+
+

DESCRIPTION

+
+

For the NVMe device given, sends the NVM command set’s identify controller +command and provides the result and returned structure.

+

The <device> parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

+

On success, the data structure returned by the device will be decoded and +displayed in one of several ways.

+
+
+
+

OPTIONS

+
+
+
+-o <format> +
+
+--output-format=<format> +
+
+

+ Set the reporting format to normal, json, or + binary. Only one output format can be used at a time. +

+
+
+
+
+
+

EXAMPLES

+
+
    +
  • +

    +Has the program interpret the returned buffer and display the known +fields in a human readable format: +

    +
    +
    +
    # nvme nvm-id-ctrl /dev/nvme0
    +
    +
  • +
  • +

    +Show the output in json format +

    +
    +
    +
    # nvme nvm-id-ctrl /dev/nvme0 -o json
    +
    +
  • +
+
+
+
+

NVME

+
+

Part of nvme-cli

+
+
+
+

+ + + diff --git a/Documentation/nvme-nvm-id-ctrl.txt b/Documentation/nvme-nvm-id-ctrl.txt new file mode 100644 index 00000000..fb4a2372 --- /dev/null +++ b/Documentation/nvme-nvm-id-ctrl.txt @@ -0,0 +1,49 @@ +nvme-nvm-id-ctrl(1) +=================== + +NAME +---- +nvme-nvm-id-ctrl - Send NVMe Identify Controller, return NVM command set structure + +SYNOPSIS +-------- +[verse] +'nvme nvm-id-ctrl' [-o | --output-format=] + +DESCRIPTION +----------- +For the NVMe device given, sends the NVM command set's identify controller +command and provides the result and returned structure. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). + +On success, the data structure returned by the device will be decoded and +displayed in one of several ways. + +OPTIONS +------- +-o :: +--output-format=:: + Set the reporting format to 'normal', 'json', or + 'binary'. Only one output format can be used at a time. + +EXAMPLES +-------- +* Has the program interpret the returned buffer and display the known +fields in a human readable format: ++ +------------ +# nvme nvm-id-ctrl /dev/nvme0 +------------ ++ + +* Show the output in json format ++ +------------ +# nvme nvm-id-ctrl /dev/nvme0 -o json +------------ + +NVME +---- +Part of nvme-cli diff --git a/completions/_nvme b/completions/_nvme index afa5bab8..8cb67296 100644 --- a/completions/_nvme +++ b/completions/_nvme @@ -16,6 +16,7 @@ _nvme () { 'attach-ns:attach namespace to controller' 'detach-ns:detach namespace from controller' 'list-ctrl:identify all controller(s) attached' + 'nvm-id-ctrl:display information about the nvm command set' 'get-ns-id:get namespace id of opened block device' 'get-log:retrieve any log in raw format' 'predictable-lat-log:retrieve predictable latency per nvmset log' @@ -109,6 +110,14 @@ _nvme () { _arguments '*:: :->subcmds' _describe -t commands "nvme id-iocs options" _idiocs ;; + nvm-id-ctrl) + local _nvmidctrl + _nvmidctrl=( + /dev/nvme':supply a device to use (required)' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme nvm-id-ctrl options" _nvmidctrl + ;; (create-ns) local _createns _createns=( @@ -743,7 +752,7 @@ _nvme () { set-feature format fw-activate fw-download admin-passthru io-passthru security-send security-recv resv-acquire resv-register resv-release resv-report flush compare read write copy show-regs persistent-event-log - pred-lat-event-agg-log + pred-lat-event-agg-log nvm-id-ctrl ) _arguments '*:: :->subcmds' _describe -t commands "help: infos on a specific nvme command, or provide no option to see a synopsis of all nvme commands" _h diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh index d669e9b2..456db1b3 100644 --- a/completions/bash-nvme-completion.sh +++ b/completions/bash-nvme-completion.sh @@ -2,7 +2,7 @@ # (unfortunately, bash won't let me add descriptions to cmds) # Kelly Kaoudis kelly.n.kaoudis at intel.com, Aug. 2015 -_cmds="list id-ctrl id-ns list-ns id-iocs create-ns delete-ns \ +_cmds="list id-ctrl id-ns list-ns id-iocs nvm-id-ctrl create-ns delete-ns \ attach-ns detach-ns list-ctrl get-ns-id get-log persistent-event-log \ pred-lat-event-agg-log fw-log smart-log smart-log-add error-log \ predictable-lat-log get-feature set-feature format fw-activate \ @@ -49,6 +49,9 @@ nvme_list_opts () { "id-iocs") opts+=" --controller-id= -c" ;; + "nvm-id-ctrl") + opts+=" --output-format= -o" + ;; "create-ns") opts+=" --nsze= -s --ncap= -c --flbas= -f \ --dps= -d --nmic= -n --csi= -y" -- 2.50.1