fabrics: restore discover_from_conf_file to actually work
With all the rework, discover_from_conf_file was completely
broken. Have both discover and connect-all working with
params passed from /etc/nvme/discovery.conf
Francisco Munoz [Thu, 23 Sep 2021 00:10:23 +0000 (17:10 -0700)]
Optane clears latency stats evey time the log page is pulled.
We only perfom a single query and place the result in a byte
array. Then, we determine the right log page layout in terms of
the media version.
Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
chengjike [Mon, 23 Aug 2021 12:40:47 +0000 (20:40 +0800)]
fix list command bugs
When execute the "nvme list" command in a multipath environment, it generate a core dump. Such as:
[root@localhost ~]# nvme list
Node SN Model Namespace Usage Format FW Rev
--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
Segmentation fault (core dumped)
[root@localhost ~]#
The reason is that when a device is a multipath disk, the value of "nvme_ns_t->c" is NULL.
This also happens when you execute "nvme list -o json" and "nvme list -v -o json" commands.
Signed-off-by: chengjike <chengjike.cheng@huawei.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
Hannes Reinecke [Thu, 12 Aug 2021 08:19:53 +0000 (10:19 +0200)]
fabrics: skip '/dev/' prefix for persistent discovery controllers
When calling 'nvme discover --device' one has to remember to strip the
'/dev/' prefix from the nvme controller device name, which is
quite cumbersome and pointless, as we might as well do it internally.
So be a bit more lenient and accept full device node names on discover.
Hannes Reinecke [Thu, 12 Aug 2021 08:19:53 +0000 (10:19 +0200)]
fabrics: skip '/dev/' prefix on disconnect
When calling 'nvme disconnect -d' one has to remember to strip the
'/dev/' prefix from the nvme controller device name, which is
quite cumbersome and pointless, as we might as well do it internally.
So be a bit more lenient and accept full device node names on disconnect.
Hannes Reinecke [Thu, 12 Aug 2021 06:28:12 +0000 (08:28 +0200)]
fabrics: rework nvmf_discover()
The logic to check for matching controller devices was backwards,
and resulted in stale discovery controllers upon failure.
So rework the logic to first scan the controller device (if present),
and then check if it matches the command line options.
And with that we can rework the entire logic to be easier to follow.
Hannes Reinecke [Thu, 12 Aug 2021 07:03:57 +0000 (09:03 +0200)]
util/argconfig: fixup OPT_INCR
To implement OPT_INCR we cannot simply increase the value in
'value_addr', as getopt() will load the value in 'val' into this
location upon every call to getopt().
As such we need to increase the 'val' setting for getopt() to
get the correct behaviour.
Hannes Reinecke [Wed, 11 Aug 2021 08:38:43 +0000 (10:38 +0200)]
github-workflow: do not build for PPC
For some reason the library is build for PowerPC in addition to the
standard target, but that will make the CI unhappy as libnvme will
build and execute the 'configurator' program during building.
Which clearly will fail, as libnvme doesn't distinguish between
a host and target compiler.
So kill this step as it's of doubtful value anyway.
Hannes Reinecke [Wed, 11 Aug 2021 07:50:15 +0000 (09:50 +0200)]
nvme: use libnvme for printing status
With commit fe62ba7 ("util: Add nvme_status_to_string()") libnvme
now has a 'nvme_status_to_string()' function, which clashes with
the one provided here.
So drop the function in favour of the libnvme one, and convert
all plugins to use nvme_show_status().
Martin George [Sat, 5 Jun 2021 09:46:26 +0000 (15:16 +0530)]
fabrics: skip connect if transport type doesn't match
Discovery log page data may include records belonging to different
transport types. If during a nvme connect-all, a connect is attempted
on a record that doesn't match the transport type passed here, it
would end up in a connect failure for that record. For e.g. one would
see the below error if a connect is attempted on a tcp record but the
transport type passed here is 'fc' and its associated parameters:
Gollu Appalanaidu [Fri, 28 May 2021 13:52:45 +0000 (19:22 +0530)]
nvme: add zone desc changed notice async event
Add the Zone Descriptor Changed Notices in get feature
human readble output for the Async Event config feature
(FID = 0x0B) as per the TP4053 Zoned Namespaces
Daniel Wagner [Wed, 2 Jun 2021 13:42:42 +0000 (15:42 +0200)]
nvme-topology: no error message when openeing of controller fails
scan_ctrl() tries to open the controller device but this operation is
expected to fail for fabric setups when a path is down. This can lead
to the situation where the subsystem is in a healthy state, e.g. at
least one path is in live state. In this scenario a failure is printed
although everything is fine.
This is especially a problem for NVMe/TCP configs where the controller
remains in 'connecting' state for 10 minutes following a path
down. All that time 'nvme list' ends up in errors and that's a major
irritant for end users. This also makes CI automation more complex
than needed.
Just drop the error message as we have other error paths in this
function where we just bail out if they fail without printing an
error message.
Keith Busch [Tue, 1 Jun 2021 14:01:44 +0000 (07:01 -0700)]
default flush to use block device nsid
Kernel 5.13 added checks to ensure the ioctl path can't be abused to
access a different namespace than the one user space has permission to
open. This unfortunately breaks the all-nsid flush usage, so user
tooling needs to default to the device's namespace id.
Sagi Grimberg [Mon, 17 May 2021 18:26:16 +0000 (11:26 -0700)]
fabrics: add fast_io_fail_tmo option
Option to fail fast I/O when connecting to a controller. It is useful
to set a fast-fail timeout for nvme in case upper layer SW wants to
detect unresponsive controllers early (e.g. mdraid).
Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
Sagi Grimberg [Wed, 26 May 2021 07:25:15 +0000 (00:25 -0700)]
systemd/nvmf-autoconnect.service: load nvme-fabrics before autoconnect
Upon boot nvme-fabrics needs to be loaded, so make sure to load
it before executing ExecStart. The driver will know to request
the transport module according to the transport parameter.
Tokunori Ikegami [Thu, 6 May 2021 16:21:19 +0000 (01:21 +0900)]
nvme-print: print both kelvin and celsius temperature values
Previously celsisu values were printed by smart-log and get-feature commands.
But kelvin values were printed by id-ctrl command.
For human readable format print both kelvin and celsisu temperature values.
Keith Busch [Tue, 20 Apr 2021 19:51:14 +0000 (12:51 -0700)]
Tag v1.14
Shortlog below since v1.13: lots of fixes, cleanups, documentation
updates, and a few new features like replay protection.
Affe (4):
Adding and updating some ns-id paramters to be inline with NVMe spec. rev. 1.4b
Adding and updating some ns-id paramters to be inline with NVMe spec. rev. 1.4b
Rebase and merge into HMT
Rebased and removed empty printouts for reserved locations.
Brian King (1):
nvme: Make gen-hostnqn use partition UUID on IBM POWER systems
Chaitanya Kulkarni (3):
zns: NULL arg to free is perfectly acceptable
zns: NULL arg to free is perfectly acceptable
zns: for zra report zone make sure data len is set
Eric Curtin (5):
Typo s/rtyep/rtype/g
Trying to get a ppc64le build going
Input expects device name without /dev
Don't print error on failed to open in nvme-topology.c
Man page update nvme discover
Francisco Munoz (2):
Modify lat-stats cmd to cope with optane bucket format
Fix return type for arconfig functions
Gollu Appalanaidu (67):
nvme: add support for persistent event log page
nvme: add support for predictable latency event aggregate log page
nvme: add support for predictable latency per NVM set log page
nvme: fix get lba status command nsid and data len fields
nvme: fix device self test log
nvme: device self test cdw10 specific fields
nvme: add fix for sanitize OWPASS value and log page structure
nvme: fix log-id data type and remove unnecessary log-id validtion
nvme: fix get and set features feature-id data type
nvme: add latest opcodes for command supported and effects log
nvme: remove zns command set opcodes from the effects log
nvme: print NSFEAT UIDREUSE bit in human readable format
nvme: Round of the metadata size to fit into block count
nvme: remove unused functions nvme_{read, write, compare}
nvme-print: refactor sanitize log status string
nvme-print: align switch-case with existing style
nvme-status: add status to error no support for path related errors
zns: fix namespace-id data type in multiple places
nvme-print: add one space around the operators
nvme-print: fix fetching status code type and status data type
nvme: add identify controller nvm command set support
zns: fix zone management receive command zra and zrasf data types
nvme: remove unassigned variable "lbads" from format function
nvme: add man page and completions of nvm command set id controller
nvme-print: remove unused argument passing to json output format print
nvme: add path related error status codes
nvme-print: add status_to_string for IO command specific status codes
nvme: add endurance group event configuration feature
nvme-print: show feat fields for FID = {0x17,0x12} and refactoring
nvme: fix printing set-feature FID and print cdw12, save fields
nvme: fix status field masking and data type
nvme: add support for endurance group event aggregate log
nvme: add support for lba status log page
nvme-cli: misc. fixes for memory allocation failure case
nvme: fix identify controller structure fabrics identify fields
nvme: change system error notification from fprintf to perror
nvme-print: split pmrmsc into pmrmscl and pmrmscu
nvme: fix security send & receive commands show status code
nvme: fix securuty send and receive commands result field
nvme-print: add NSSC field in directive receive show fields
nvme-print: fix HMB get feature response in human readable format
nvme-print: fix register size for raw format print
nvme: use nvme_show_status when command status code is non-zero
nvme: fix DPS description and improve the other fields descriptions
nvme-print: improve command support and effects log json format
nvme: add reservation notifacation log page
nvme: refactor and improve the passthru function
nvme: add namespace id config field for copy command
nvme: fix dsm and copy commands free up buffers
nvme: address 1.4 to 1.4b changes for Change NS event type
nvme: remove trailing space
nvme: add lba status information attributes feature support
nvme: fix commenting style
nvme: fix timestamp feature in set feature
nvme: make else if and else statements uniform
nvme: remove redundant structure of primary controller capabilities
nvme: nvme get and set features buffer length clean up
nvme: random fixes in primary controller capabilities
nvme: fix human-readable format option in primary ctrl caps
nvme: fix and refactor virt mgmt cdw10 and cdw11 arguments
nvme: add rae field in sanitize-log
nvme-print: print phase tag field separately in error-log fields
zns: return response with status to errno conversion
nvme-print: fix io-command set profile feature
nvme: remove buf allocation check since NULL free is acceptable
nvme: add space in persistent event log desc between words
nvme: add one space around the operand and operator in d_raw
Hannes Reinecke (8):
fabrics: ctrl_loss_tmo setting is invalid for 'loop'
nvme-discover: add json output
fabrics: correctly handle ctrl_loss_tmo settings for loop
fabrics: fix infinite loop on invalid parameters
nvme-discover: lookup existing persistent controllers
util/json: unify struct json_object and struct json_array
nvme: build against json-c library
Read system UUID from DMI and merge hostnqn generation functions
Hanumanthu H (9):
Add support for Replay Protection Memory Block (RPMB) commands
Fix copyright typo
Add support for Replay Protection Memory Block (RPMB) commands
Fix copyright typo
sync with latest repo
Micron plugin changes - extended smart health info and others
Micron plugin changes - version 1.0.4
micron plugin version 1.0.5
micron plugin version 1.0.5 - 51C2, 51C3 support
Jeff Lien (18):
[nvme-cli] wdc plugin fix for vs-internal-log command for SN730 drive.
[nvme-cli] Additional fixes to wdc plugin vs-internal-log command for SN730
[NVMe-CLI] Review comment changes to wdc plugin vs-internal-log fix for SN730
[nvme-cli] 2nd change to address review comments
[nvme-cli] WDC Plugin fix to Fix clear-fw-activate-history command for SN640 Drives
[nvme-cli] WDC plugin add support for cloud-SSD-plugin-version
[nvme cli] Add WDC plugin command vs-pcie-stats [nvme cli] Fix vs-smart-add-log min/max user data erase counts
[nvme cli] Fix drive capabilities to meet OCP Spec
[nvme cli] Add Customer Serial Num to vs-drive-info command
[NVME-CLI] WDC Plugin Fixes for SN-730 vs-nand-stats not printing json format vs-nand-stats not printing raw format for several fields vs-temperature-stats not printing json format vs-drive-info not printing json format
Fix build failure from incorrect indenting
[nvme-cli] WDC plugin fixes for vs-fw-activate-history command Change to use Power on Hours instead of Timestamp in certain cases Fix Entry order so entries are displayed oldest to newest
[nvme-cli] Add support for 0x2720 PCI Device ID
[nvme-cli] Change to set default DA for SN730
[nvme-cli] Add support for WDC Plugin cloud-SSD-plugin-version to SN355
[nvme-cli] Fix Max/Min User data erase counts displayed in 0xC2 Log Page
[NVMe-CLI] Add support for new customer ids to WDC plugin commmands
[NVMe-CLI] SN730 Updates for FW Maintenance Release
Jonathan Teh (1):
nvme-print: Show more async event config fields
Keith Busch (17):
fix address print format
provide value bounds check on numerical lists
Merge branch 'ErwanAliasr1-evelu-feature'
fix null string compiler warning
fix 'list' verbose for controller namespaces
Merge branch 'master' of https://github.com/hanumanthuh/nvme-cli into hanumanthuh-master
Merge branch 'hanumanthuh-master'
Merge branch 'master' into dst/fix
Merge branch 'ganaidu707-dst/fix'
fix 32-bit compile
Merge branch 'HMT' of https://github.com/cgdeveloper1/nvme-cli into cgdeveloper1-HMT
Merge branch 'cgdeveloper1-HMT'
micron printf for 64-bit on 32-bit archs
Squashed commit of the following:
Merge branch 'fixes' of https://github.com/mwilck/nvme-cli into mwilck-fixes
add timeout parameter to get-lba-status
tag v1.14
Klaus Jensen (3):
fix dsm and copy range setup
zns: do not check metadata when pract is set
zns: support piremap flag for zone append
Martin Belanger (1):
print device name when creating a persistent device
Martin George (3):
fabrics: permit kato int argument for discovery controllers
fabrics: update discovery.conf error message
fabrics: ensure zero kato for non-persistent controllers
Martin Wilck (9):
do_discover: free cfg.device when resetting it
nvme-connect-all(1): fix documentation for --quiet/-S
nvme: add some simplifying macros for __attribute__((cleanup()))
nvme-cli: add generic logging functionality
nvme: convert some function arguments from "char *" to "const char *"
fabrics: use "const char *" in struct config
fabrics: fix some memory leaks
fabrics: fix invalid memory access in discover_from_conf_file()
fabrics: export symbols required for monitor functionality
Max Gurtovoy (1):
nvme: add NVIDIA plugin for NVMe SNAP controllers
Minwoo Im (10):
Add missing sub-command links from main man page
zns: fix showing system error in report_zones
nvme: set block size to blkdev before re-read partition
nvme: refactor S_ISCHR/S_ISBLK with helpers
nvme-print: fix Namespace ID to decimal format
nvme-topology: fix returning invalid value in scan_subsystems()
zns: print select_all field for Zone Management Send
nvme-status: return negative status if !errno
nvme: remove spurious command show 'rsvd'
nvme-topology: fix build error for unused variable
Nate Roiger (2):
Identify Primary Controller Capabilities support
Address PR comments: Remove obsolete format options; Add JSON output.
Niklas Cassel (1):
nvme-print: fix ZNS MAR/MOR print format
Sagi Grimberg (1):
nvme-topology: have list-subsys print only controllers with attached namespace
Steven Seungcheol Lee (3):
nvme.spec.in: using specific directory for nvme command on %post
Makefile: remove duplicated line for zns.o
nvme: Remove invalid device node from nvme list
Tomasz Zawadzki (4):
add path to nvme list
report scandir errors in legacy_list
print topology for NVMe nodes in kernel and path
skip display of missing controller fields
Zhangyi Huo (1):
feat: clear-error-log support
asavah (1):
fix missing sd-id128 include
dingjian (6):
style: modify a prompt word
chore: smart-log-add add more project support
feat: support io latency histogram
style: rename function
feat: support high latency log
feat: add timstamp support(Optional)
nvme: remove buf allocation check since NULL free is acceptable
Cleaning up all the nvme-cli source filses where buffer allocation
check is ther before free up, NULL free is acceptable perfectly as
Chaitanya mentioned in another patch.
zns: return response with status to errno conversion
Currently ZNS plugin nvme device status code 15 bits
being returned to shell which will take only 8 bits.
Convert the nvme status code to linux standard errno
with the help of status_to_errno function and return.
Gollu Appalanaidu [Thu, 25 Mar 2021 17:58:30 +0000 (23:28 +0530)]
nvme-print: print phase tag field separately in error-log fields
Status Field in error-log 16 bits, 15 bits from q to 15 are represents
status field and 0th bit is phase tag, print phase tag seperately, in
1.4b spec its been clearly called out.
Francisco Munoz [Fri, 26 Mar 2021 22:36:58 +0000 (15:36 -0700)]
Modify lat-stats cmd to cope with optane bucket format
Optane lat-stat thresholds are 8 bytes per bucket. Also
the amout of buckets is smaller when compared to nand ssds.
This change allows to query both types of ssds transparently.
Also added the command line option to print lat-stats in json
and introduced a plugin function to modify read/write bucket
thresholds for specific media versions.
Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>