Minwoo Im [Sun, 1 Jul 2018 13:58:05 +0000 (22:58 +0900)]
nvme-cli: print firmware activation notices support bit to id_ctrl
It's now currently printing the OAES(Optional Asynchronous Events Supported)
field in identify controller data structure without [9] firmware activation
notices field in case of human-readable format.
Print it out by updating the reserved bit field.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
Alexey Timofeyev [Thu, 28 Jun 2018 17:33:05 +0000 (17:33 +0000)]
nvme-cli: add support of RAE
Currently telemetry-log cannot retain content of corresponding log page as RAE is not set.
This patch adds RAE bit support into routines to retrieve log pages.
Keith Busch [Fri, 15 Jun 2018 19:28:11 +0000 (13:28 -0600)]
Fix json output of 128-bit numbers
We use the long float for only very large integers. We don't want to
see the decimal, and the locale settings could cause different output,
so let's remove it.
Minwoo Im [Sun, 15 Apr 2018 17:34:41 +0000 (02:34 +0900)]
nvme-cli: add support for id-nvmset subcommand
Identify for NVM Set List has been added and it can be found in TP 4018.
This identify CNS 0x4 uses CDW11 as a NVM Set Identify(NVMSETID).
Currently nvme-cli is not using cdw11 for the identify command.
Therefore make it available for cdw11 to be passed to ioctl command by
adding nvme_identify13() to support the new CNS.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
James Smart [Mon, 30 Apr 2018 22:46:58 +0000 (15:46 -0700)]
nvme-cli: Add ioctl retry support for "connect-all"
Currently, if an ioctl command to a controller fails, the routines
within nvme-cli don't do retries and just fail. In the case of
operations such as "connect-all" which depend on the ioctl to read
the discovery log to give it the list of controller to then "connect"
to, this failure can be catastrophic as there's no guarantee that the
event/admin action that performed the connect-all will be re-triggered,
resulting in a loss of connectivity to storage subsystems.
As to why the ioctl may have failed in the first place: if the
controller is in the middle of a reset or reconnect due to
an error or temporary loss of connectivity (which can happen even
on a discovery controller), ioctl commands will fail rather than
suspend for the full duration of the controller state change
(say to live or delete), which could be a minute or more.
This patch makes the following changes:
- Implement an ioctl wrapper that does retries. The ioctl will only
retry if the failure status was EAGAIN.
- Create an admin passthru wrapper that uses the ioctl wrapper with
retry
= Modify the ioctl that reads the discovery log to use the new
admin passthru wrapper that performs retries when reading the
discovery log, and uses the normal admin passthru (no retries)
for all other log types.
Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
James Smart [Fri, 27 Apr 2018 17:29:39 +0000 (10:29 -0700)]
nvme-cli: Wait for device file if not present after successful add_ctrl
It's possible for the transport to return very quickly after add_ctrl
such that the cli may attempt to access the /dev/nvme? device file
before the udev event has propagated to user space to create the device
file. In these cases, the open fails with EAGAIN.
As the add_ctrl call was successful, thus there "should" be a device
file, if the open fails with EAGAIN delay 500ms and try again. Wait
for at most 2 seconds for the device file to come into existence.
Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
James Smart [Fri, 27 Apr 2018 17:27:33 +0000 (10:27 -0700)]
nvme-cli: show partial results if controller fails during list and list-subsys
For the current versions of "list" and "list-subsys":
If a command to a controller fails, which is possible if the controller
is going through a reconnect, the operation will fail and all results
gathered up to that point is dropped. Thus, the operation shows no
results.
Revise the commands so that they will report an error if one of the
controllers fail, but will now skip over the failing controller and
continue with the next one.
Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
Minwoo Im [Sun, 15 Apr 2018 16:23:45 +0000 (01:23 +0900)]
nvme-cli: fix perror when blkdev not given when get-ns-id
nvme-cli currently is printing out the error code via perror when nsid
from the nvme_get_nsid(fd) <= 0. Once user gives a chrdev node instead of
blkdev node, following "Success" message is being printed-out even it's
a failure case.
Error: requesting namespace-id from non-block device
nvme0: Success
errno will *not* be set in case that blkdev is not given. So set the
proper errno for this case. The following message will be nicer than
previous one.
Error: requesting namespace-id from non-block device
nvme0: Block device required
This patch will also fix the return value of this subcommand. 0 will
*not* be given when the subcommand fails.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Thu, 12 Apr 2018 12:38:25 +0000 (21:38 +0900)]
nvme-cli: make it return 0 in case of non-fabric for show-regs
Currently, non-fabrics show-regs subcommand is *not* returning 0 even if it has
successfully read from the bar. Make it return 0 when successfully done.
Link: #338
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Johannes Thumshirn [Tue, 10 Apr 2018 08:51:10 +0000 (10:51 +0200)]
Documentation: add manpage entry for connect's --ctrl-loss-tmo setting
When adding nvme connect's --ctrl-loss-tmo flag we forgot to update
the manpage accordingly.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reported-by: Matt Schulte <matt.schulte@netapp.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Wed, 4 Apr 2018 14:14:26 +0000 (08:14 -0600)]
Remove error print for telemetry log arg parse
We don't want to see an error message if the '--help' option was
utilized. Parsing errors are also already printed, so don't need the
second error message anyway.
Signed-off-by: Keith Busch <keith.busch@intel.com>