Kenneth Heitke [Wed, 8 May 2019 17:13:29 +0000 (11:13 -0600)]
nvme-print: update self-test log to include 'aborted due to sanitize'
TP 4022 states that when a sanitize operation is started, self-test
operations in progress shall be aborted. The device-self test log page
includes a new result code that indicates if a self-test was aborted due
to a sanitize operation.
Dominique Leuenberger [Wed, 8 May 2019 16:48:02 +0000 (18:48 +0200)]
DOC: Move to DocBook 5 when using asciidoctor
DocBook 5 has been released about a decade ago. Newer versions of
asciidoctor (since version 2.x) no longer support the previously
used DocBook 4.x format, so it is about time for us to switch too.
spec, Makefile: add /etc/nvme files to package files
This way it can automatically be removed upon uninstallation
and we don't need %preun target. Also, this will also allow
to get these files on manual installation from sources.
Also, don't settle on the "file exists" check, use the '-s'
to check that it is not empty as well.
Lastly, in order to have hostnqn and hostid updated upon pkg
install, we have install-spec target that would omit hostnqn and
hostid files, and let the rpm %post do it (otherwise we
use the normal install target).
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Minwoo Im [Thu, 25 Apr 2019 12:40:14 +0000 (21:40 +0900)]
print: Introduce show_nvme_status to print nvme status
We have so many subcommands so that we need to have a function in
common to print out status of nvme command.
The nvme status will be printed out in case the subcommand itself fails
due to a reason. In case of command which is in the middle of the
subcommand, it will be printed as "<cmd> failed" before status.
This patch has nothing to do with functional change.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 24 Apr 2019 00:48:58 +0000 (01:48 +0100)]
ioctl: Fix wrong return case of get_property
If get_property_helper() succeeds in the first time, and then fails in
the next time, then the ret value will not be updated to an error value.
This patch removes 'ret' variable to make 'err' to return being updated
everytime get_property_helper() invoked.
- ontap_vol is a constant char pointer, set to "/vol/", so 5 bytes
- vol_name's size is ONTAP_LABEL_LEN, which is 260, deducting the
null-byte for termination makes 259 required bytes
- "/" is 1 byte
- ns_name's size is also ONTAP_LABEL_LEN, which is 260, deducting
the null-byte for termination makes 259 required bytes
- the final null-byte: 1
That makes in total 5 + 259 + 1 + 259 + 1 = 525 required bytes
Signed-off-by: Simon Schricker <sschricker@suse.de>
Andy Lutomirski [Mon, 15 Apr 2019 17:48:05 +0000 (10:48 -0700)]
Fix passing CFLAGS on the make command line.
Commit 254bcd6b2343 ("Fix CFLAGS parameter") only fixed the problem
if the variable came from the environment, not if it came from the
command line. Fix it using 'override'. See the GNU Make manual,
section 6.7 ("Overriding variables") for details.
Alexander Larin [Thu, 11 Apr 2019 14:11:50 +0000 (17:11 +0300)]
Use 0x prefix for all hex values of id-ctrl output
Sometimes human-readable id-ctrl output could be confusing, e.g.
$ nvme id-ctrl /dev/nvme0
NVME Identify Controller:
vid : 0x144d
ssvid : 0x144d
sn : S3HDNX0K601842
mn : SAMSUNG MZWLL1T6HEHP-00003
fr : GPNA5B3Q
rab : 8
ieee : 002538
cmic : 0x3
mdts : 5
cntlid : 21
...
Here cntlid value is hexdecimal and equals 33, but nothing shows that.
In the same time some other values have 0x prefix. Let's use the prefix
for all hexdecimal values of the output.
Signed-off-by: Alexander Larin <znahar@yandex-team.ru>
Minwoo Im [Thu, 11 Apr 2019 12:51:19 +0000 (21:51 +0900)]
plugin: Return EINVAL instead of ENOTTY
When a given string for a subcommand is not valid, we can return EINVAL which
means invalid arguments. ENOTTY is used to indicate that an invalid IOCTL
number was specified.
Keith Busch [Tue, 9 Apr 2019 21:32:46 +0000 (15:32 -0600)]
Release for new stable fixes
There's been a few fixes since the last tag that are fairly critical for
some scenarios, so we're tagging a new one already. Since these are all
just fixes and no new features, we'll add an additional minor digit to
the revision.
Signed-off-by: Keith Busch <keith.busch@intel.com>
James Smart [Tue, 9 Apr 2019 20:51:54 +0000 (13:51 -0700)]
nvme-cli: Revert stop-on-failure with connect-all
The patch that added special treatment for EALREADY connect failures
also changed the behavior on what happens if a discovery log contains
an entry that is not connectable by the system or host port. If it
encounters a log entry that can't be connected to, it will not attempt
to connect to any log entries beyond it. This can leave lots of devices
unconnected to.
Revert the stop-on-failure introduced by the previous patch.
Specifically, this failed for me on an FC array that had a discovery log
entry for a port that was not visible via zoning for the initiator
port being used.
Fixes: 1a922e0e121d7 ("connect-all: special treatment to EALREADY afetr write to /dev/nvme-fabrics" Signed-off-by: James Smart <jsmart2021@gmail.com> CC: Eyal Ben David <eyalbe@il.ibm.com> CC: Martin George <Martin.George@netapp.com>
Keith Busch [Mon, 8 Apr 2019 20:51:59 +0000 (14:51 -0600)]
Release version 1.8
There are some important fixes pending a release tag, so now seems as
good as any to tag the release.
Thank you again to everyone who's contribute to this round. Shortlog
below.
Breno Leitao (2):
Fix compilation with GCC-8
Fix CFLAGS parameter
Chaitanya Kulkarni (3):
nvme-cli: fix compilation with uint64_t cast
nvme-cli: minor cleanup for submit_io()
nvme-cli: align all the macros
Dong Ho (11):
wdc: Change device capability checking
wdc: Add additional device for vs-internal-log
wdc: Add device unit info log extraction
wdc: Add get drive status command
wdc: Add clear assert dump status command
wdc: Add drive resize command
wdc: Update device capabilities for clear pcie corr
wdc: Update file parameter checking
wdc: Add command to extract NAND statistics
wdc: Add data area extraction for DUI command
wdc: Additional device capabilities check
James Smart (1):
nvme-cli: fix fc trtype string
Jeffrey Lien (3):
NVMe-CLI WDC Plugin - add support for additional SN840 device ID.
WDC plugin Change vs-internal-log Command to Save Partial E6 Log Data.
WDC Plugins vs-internal-log command unsupported on SN340.
Keith Busch (8):
generate new documentation
Regen docs
Fix print format specifiers
Regen documentation
Add new docs to repository
Generate new documentation
Fix format block size usage
Regen documentation
Kenneth Heitke (4):
Add reporting of Virtual Management support to id-ctrl
Fix possible NULL pointer dereferences
Fix possible memory leak on get-internal-log
Print timestamp as a date and time string
Martin George (2):
nvme-cli: add netapp ontapdevices command
nvme-cli: add netapp ontapdevices man page
Maxim (1):
Adding a helper to format command to enable the user to specify desired block size and have nvme-cli determine the correct LBAF and add format helper to nvme-create-ns command
Minwoo Im (15):
fabrics: Return negative errno when asprintf() fails
fabrics: Return negative errno to check remove_ctrl() is failed
doc: Update nvme-discover by describing options
doc: Update nvme-connect by describing options
doc: Update nvme-connect-all by describing options
doc: Update nvme-disconnect by describing options
doc: Add missing commands to main document entry
nvme: Support raw_binary and json format for show-regs
doc: Update show-regs document with output-format
ioctl: Free memory if get_property for fabrics failed
nvme: Use ARRAY_SIZE() macro in common.h
nvme: Unify min(), max() macro as a common one
nvme: Simplify description for virt-mgmt
nvme: Simplify virt-mgmt options to lowercase
tests: Update print to print() for python3
Roy Shterman (1):
nvme-print: Fix evaluation of ctratt on pretty print
Sagi Grimberg (1):
nvme: print I/O error to stderr
Signed-off-by: Keith Busch <keith.busch@intel.com>
Minwoo Im [Sun, 7 Apr 2019 11:24:55 +0000 (20:24 +0900)]
tests: Update print to print() for python3
The following issue has been reported that README in "tests" seems not
correct because it will not be able to be invoked in case python3
because print() has to be taken instead of print which had been used for
python2.
Minwoo Im [Sun, 7 Apr 2019 10:32:53 +0000 (19:32 +0900)]
nvme: Simplify virt-mgmt options to lowercase
All the other subcommand options are supported with lowercase, but
virt-mgmt subcommand has long argument name started with uppercase.
This can be simplified to a lowercase with being the same with the names
on spec document.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Sun, 7 Apr 2019 10:30:25 +0000 (19:30 +0900)]
nvme: Simplify description for virt-mgmt
The options of virt-mgmt subcommand can be simplified for a good
readability. This patch not only adds necessary whitespace between
sentences, but remove unnecessary empty line and words which might cause
too long line to describe options.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Sat, 6 Apr 2019 21:45:16 +0000 (06:45 +0900)]
ioctl: Free memory if get_property for fabrics failed
The given *pbar is allocated inside this function without freeing it
will be freed from the caller in case of show-regs subcommand for NVMe-oF
controller.
If Get Property is failed because it has PCIe transport, then it needs
to be freed here instead of caller.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Sat, 6 Apr 2019 21:01:17 +0000 (06:01 +0900)]
nvme: Support raw_binary and json format for show-regs
Somebody might want to compare entire controller registers in a raw
binary format to check controller status or some of configurations. It
also can be needed to print out JSON format for easily parsing.
This patch introduces JSON and RAW_BINARY print format with a general
--output-format argument. This will have "normal" value by default, and
also support "json" and "binary".
We don't care about whether the given "fabrics" argument in
json_ctrl_registers() because all the reserved registers and fields are
to be returned as 0x0 as specified in NVMe-oF "Property Definitions"
section.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 16:30:33 +0000 (01:30 +0900)]
doc: Add missing commands to main document entry
cmds-main.txt has the entire command sets provided by nvme-cli. This
patch added the following commands which has already had corresponding
documents already.
1. nvme-connect-all
2. nvme-disconnect
2. nvme-disconnect-all
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 16:27:17 +0000 (01:27 +0900)]
doc: Update nvme-connect-all by describing options
We have had newly added command options for Connect to all NVMe-oF subsystems.
This patch updates descriptions of command options.
+ This patch also fixes an trivial mis-aligned paragraph issue which can
be in this commit to avoid any confusions in document update which might
show too many diffs.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 16:24:07 +0000 (01:24 +0900)]
doc: Update nvme-discover by describing options
We have had newly added command options for Discover controller. This
patch updates descriptions of command options.
+ This patch also fixes an trivial mis-aligned paragraph issue which can
be in this commit to avoid any confusions in document update which might
show too many diffs.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 15:02:05 +0000 (00:02 +0900)]
fabrics: Return negative errno to check remove_ctrl() is failed
remove_ctrl() might fail due to a reason such as memory allocation
failure. Once it fails, discovery should not proceed, but return the
errorno to the caller immediately.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 14:53:33 +0000 (23:53 +0900)]
fabrics: Return negative errno when asprintf() fails
asprintf() will return -1 when it fails to allocate memory for the
string given with setting errno to ENOMEM. For the uniformity, we can
return errno with negative value.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Chaitanya Kulkarni [Wed, 6 Feb 2019 22:59:56 +0000 (14:59 -0800)]
nvme-cli: align all the macros
Due to the addition of a lot of code in the WDC Plugin over a period
of time it has non-aligned macro definitions. This is purely cleanup
patch which makes all the macros aligned nicely which makes code
readable.
James Smart [Mon, 4 Feb 2019 21:39:54 +0000 (13:39 -0800)]
nvme-cli: fix fc trtype string
Commit 55b4ec12ffe4
("fabrics: use trtype_str when parsing a discovery log entry")
changed to use the trtypes string names in a generic fashion for
the "transport=?" string passed in the connect string to the kernel.
For FC, this meant the hardcoding of "transport=fc" was removed and
the generic code would now create "transport=fibre-channel", which
doesn't match any transport name anymore once the string is attempted
to be matched in the kernel.
Change the string used by for trtype for FC to use "fc" to restore
operation.