Keith Busch [Fri, 22 Sep 2017 22:11:02 +0000 (18:11 -0400)]
Version 1.4 Release
Some new features from the NVMe 1.3 Specification are starting to be
incorporated with this release with new field decoding and commands,
including sanitize and directives. Lots of other bug fixes, documentation
updates, and output format. Thank you to everyone who contributed. More
updates from the latest specifcation will be incorporated in the next
release.
Shortlog:
Aaron Miller (1):
fix use-after-free in pci.ids parsing
Baruch Siach (1):
Makefile: allow linker override for cross uuid test
Chaitanya Kulkarni (7):
nvme-cli: add error message for nvme list.
nvme-cli : add support for sanitize command.
nvme-cli : add sanitize command documentation.
nvme-cli : add support for retrieving sanitize log.
nvme-cli : add sanitize-log command documentation.
nvme-cli : wdc-plug-in : return on invalid input device.
nvme-cli : only print help text and return for nvme list -h option.
Charlesworth, Thomas J (1):
nvme-cli: Fix nvme ns desc
Christoph Hellwig (2):
resync nvme.h with the kernel nvme.h
fix build without libuuid
Daniel Verkamp (1):
nvme-cli: generate spec-compliant UUID NQNs
Guan Junxiong (8):
nvme-cli: add fields into identify controller data structure
nvme-cli: show more fields for id-ctrl
nvme-cli: add thermal management fields for smart-log
nvme-cli: add temperature sensor fields in json_smart_log
nvme-cli: add output-format discription for smart-log
nvme-cli/list-ns: fix identifying active or allocated namespaces list
nvme-cli/list: fix when nvme device can not be open
nvme-cli: fix connecting failure due to invalid uuid format of hostid
Guilherme G. Piccoli (1):
nvme-cli: Fix typo in Intel plugin and improve generic help text
Gwendal Grignou (1):
nvme-cli: Describe action 3 of nvme activate
Jeff Lien (2):
NVMe-CLI Fix Sanitize Command Parameter Types
NVMe-CLI Fixed Status Code check for reset type on fw-activate.
Johannes Thumshirn (2):
fabrics: add hostid option to connect command
nvme-cli: add ns-descs subcommand
Jon Derrick (2):
Show help when no or an invalid device is given
Show help for nvme reset and subsystem-reset
Keith Busch (7):
nvme-print: Free only top-level json objects
Formatting update
Regenerate documentation
Show help for get-ns-id
Update docs
Fix app tag and mask setting
Fix app tag field sizes
Kwan (Hingkwan) Huen-SSI (2):
nvme-cli: add nvme directive command support
nvme-cli: add documentation for directive commands
Mandar Thorat (1):
Update nvme.c
Mete Balci (3):
fix for issue 219, show-regs reports AQA.ACQS and AQA.ASQS as bytes
new bit fields (6, 7, and 8) for OACS from NVMe rev 1.3
added new bit field (6) to ONCS from NVMe rev 1.3
Michael Davis (1):
Fixed get_internal_log to parse the entire nlog and allow selection of specific regions to be parsed.
Narasimhan V (1):
Fix typo of flbas in nvme_create_max_ns_test
Nitzan Carmi (1):
nvme-cli/fabrics: Add ctrl-loss-tmo param to connect cmd
Rodrigo R. Galvão (1):
Fix spelling errors
Schremmer, Steven (3):
nvme-cli: id-ctrl: display additional fields
nvme-cli: Get Feature support for Extended Host Id
nvme-cli: Extended Data Structure in resv-report
Scott Bauer (1):
Implement Intel Vendor specific logs
Xiao Liang (1):
nvme-cli/list: change fd returned by open operation from unsigned to signed.
Zou (1):
nvme-cli: add id-ctrl for nvme-huawei plug-in.
jeffreyalien (2):
nvme-cli : Add Namespace Rescan Command
nvme-cli : Add man documentation files for ns-rescan command.
mandarcthorat (2):
Fixing macro definitions to avoid issues when these are used in expressions
Added handling for temperature threshold values below 0C(273K) and removed buffer check for human readable output as Temperature threshold feature does not use Memory Buffer for Attributes
Signed-off-by: Keith Busch <keith.busch@intel.com>
Added handling for temperature threshold values below 0C(273K) and removed buffer check for human readable output as Temperature threshold feature does not use Memory Buffer for Attributes
Changes to be committed:
modified: nvme-print.c
modified: nvme.c
Jeff Lien [Tue, 12 Sep 2017 17:37:05 +0000 (12:37 -0500)]
NVMe-CLI Fixed Status Code check for reset type on fw-activate.
If a device returns a fw-activate status with the More or DNR bit
set, the CLI code will return a message indicating an Admin command
error instead of succesful status. With this patch, the More and
DNR bits will be masked off and not affect the returned message.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Daniel Verkamp [Wed, 30 Aug 2017 22:25:16 +0000 (15:25 -0700)]
nvme-cli: generate spec-compliant UUID NQNs
The gen-hostnqn command previously generated UUID NQNs in a format that
does not match the NVMe specification.
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com>
Guan Junxiong [Thu, 3 Aug 2017 13:38:16 +0000 (21:38 +0800)]
nvme-cli: fix connecting failure due to invalid uuid format of hostid
When we connect or discover a target with --hostid option via the
/etc/nvme/hostid file, we fails this operation because the hostid
is only 35 not 36 bytes which doesn't pass the uuid checking in the
kernel.The last character is overridden with null bytes because fgets
reads at most one less than sizeof of buffer characters.
Signed-off-by: Guan Junxiong <guanjunxiong@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com>
Baruch Siach [Wed, 9 Aug 2017 06:43:12 +0000 (09:43 +0300)]
Makefile: allow linker override for cross uuid test
The test to determine whether libuuid is installed uses the host 'ld' utility.
This breaks when cross compiling, since target libraries are often different
than host libraries.
Use $(LD) instead. This allows to easily use the cross compiler linker.
Guan Junxiong [Wed, 2 Aug 2017 07:51:09 +0000 (15:51 +0800)]
nvme-cli/list: fix when nvme device can not be open
This patch checks the validity of fd returned by open operation on
the nvme divices. For example, when a user who doesn't have the
permission to open the device trys to use nvme list command to list
nvme devices, the fd is returned as -1 and errno indicates permission
denied.
In addition,this patch closes the current open device before
processing the next device.
Signed-off-by: Guan Junxiong <guanjunxiong@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com>
Jeff Lien [Fri, 21 Jul 2017 20:43:56 +0000 (15:43 -0500)]
NVMe-CLI Fix Sanitize Command Parameter Types
The current parameter types will cause the sanitize action value to
be set to 0 and "Invalid Sanitize Action" errors. Setting them to
the correct types resolves the issues.
nvme-cli/list-ns: fix identifying active or allocated namespaces list
The logic of the CNS field of identify namespace list is wrong.
For example, nvme list-ns /dev/nvme0 -n 0 should return active
namespaces list starting with id 1 (including), but currently this
script command returns INVALID_OPCODE if the target doesn't support
listing allocated namespaces or all the allocated attached namespaces
id. So fix it by swaping the CNS flags of active and allocated list.
Signed-off-by: Guan Junxiong <guanjunxiong@huawei.com> Reviewed-by: Sagi Grimberg <sagi at grimberg.me> Signed-off-by: Keith Busch <keith.busch@intel.com>
Christoph Hellwig [Wed, 28 Jun 2017 18:27:57 +0000 (11:27 -0700)]
resync nvme.h with the kernel nvme.h
Copy over the current nvme.h from the for-4.13 block tree, and adjust
a few callers. The biggest tweak is that we can't use the kernel uuid.h
and either need to use libuuid or our own definition.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com>
Guan Junxiong [Wed, 21 Jun 2017 05:09:24 +0000 (13:09 +0800)]
nvme-cli: add output-format discription for smart-log
The nvme smart-log command has implemented output-format option,
but the documentation of the command doesn't reflect this. This
patch synchronizes the documentation with the implemenation.
Signed-off-by: Guan Junxiong <guanjunxiong@huawei.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
Guan Junxiong [Wed, 21 Jun 2017 05:09:22 +0000 (13:09 +0800)]
nvme-cli: add thermal management fields for smart-log
NVMe 1.3 introduce new thermal management temperature related
fields into the smart log page. Those fileds include
two temperature transition counts and two total time.
Johannes Thumshirn [Fri, 23 Jun 2017 07:36:35 +0000 (09:36 +0200)]
nvme-cli: add ns-descs subcommand
NVMe 1.3 defines the "Namespace Identification Descriptor" command in
NVMe Identify NS. This command returns a list of so called Namespace
Identificastion Descriptors which currently can either be a EUI-64,
a NGUID or a UUID.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Keith Busch <keith.busch@intel.com>
Zou [Fri, 16 Jun 2017 07:12:52 +0000 (07:12 +0000)]
nvme-cli: add id-ctrl for nvme-huawei plug-in.
add Vendor unique command id-ctrl for Huawei devices. Signed-off-by: Zou Ming <zouming.zouming@huawei.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
Guan Junxiong [Fri, 2 Jun 2017 07:18:19 +0000 (15:18 +0800)]
nvme-cli: show more fields for id-ctrl
NVMe 1.3 inctrodues new fields such as EDSTT, DSTO, FWUG, HCTMA, MNTMT,
MXTMT, SANICAP into the idenfity controller data structure. The id-ctrl
command should print them or write them into json format. Note that
although KAS field is included in the previous NVMe 1.2.1 spec, this
patch also supports this field.
Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <keith.busch@intel.com>
Guan Junxiong [Fri, 2 Jun 2017 07:18:18 +0000 (15:18 +0800)]
nvme-cli: add fields into identify controller data structure
NVMe 1.3 inctrodues new fields such as EDSTT, DSTO, FWUG, HCTMA, MNTMT, MXTMT, SANICAP
into the idenfity controller data structure. So we add them. Note that KAS field is
included in the previous NVMe 1.2.1 spec, but not itemized in the nvme-cli.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Aaron Miller [Tue, 6 Jun 2017 02:02:50 +0000 (19:02 -0700)]
fix use-after-free in pci.ids parsing
If a device that is not in pci.ids has its name looked up after a device
that *was* present in pci.ids, these pointers are still set even though
they've been free'd, and then get passed to snprintf resulting in a
use-after-free.
Keith Busch [Thu, 18 May 2017 15:17:45 +0000 (11:17 -0400)]
Release v1.3
Tagging v1.3 for release:
* Fixes compiler errors and warnings for some architectures
* Fixes to the security commands
* Updates and fixes to output formats
* New vendor plugin from Huawei
* Minor updates to fabrics and lightnvm
* Fixes for package generation
Signed-off-by: Keith Busch <keith.busch@intel.com>
Johannes Thumshirn [Thu, 11 May 2017 17:48:37 +0000 (19:48 +0200)]
fabrics: add option to override drivers queue depth also for connect-all command
Currently it is not possible to override the fabrics drivers default
queue depth with the nvme userspace utility's 'connect-all' command,
but only when using the 'connect' command.
Add an option to override the drivers default queue depth for NVMe
over fabrics with the 'connect-all' command as we did previouslt with the
'connect' command.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Keith Busch <keith.busch@intel.com>
Tony Asleson [Wed, 17 May 2017 19:59:01 +0000 (14:59 -0500)]
Fix potential device string truncation
While compiling using gcc 7.1.1 I ran into compile errors, eg.
nvme.c: In function ‘scan_dev_filter.part.5’:
nvme.c:797:35: error: ‘%s’ directive output may be truncated writing " \
"up to 255 bytes into a region of size 251 [-Werror=format-truncation=]
snprintf(path, sizeof(path), "%s%s", dev, d->d_name);
This is caused because the buffer on the stack is only 256 bytes and the
dirent.d_name is 256 and the constant string is "/dev/", so 256 + 5,
but I've rounded up to nearest 4/8 byte alignment of 264.
Johannes Thumshirn [Wed, 10 May 2017 09:04:12 +0000 (11:04 +0200)]
fabrics: add option to override drivers queue depth
Currently it is not possible to override the fabrics drivers default queue
depth with the nvme userspace utility, but only when manually writing the
parameters to the /dev/nvme-fabrics character device.
Add an option to override the drivers default queue depth for NVMe over
fabrics.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Keith Busch <keith.busch@intel.com>
Need to include sys/stat.h to fix:
fabrics.c:414:45: error: 'S_IRUSR' undeclared (first use in this function)
fabrics.c:414:53: error: 'S_IWUSR' undeclared (first use in this function)
Yi Zhang [Tue, 18 Apr 2017 09:20:24 +0000 (17:20 +0800)]
nvme-cli: return 0 if disconnect operation with cfg.nqn successfully
disconnect_by_nqn function will return the number of controllers
successfully disconnected, so change ret = 0 if disconnect operation
with nqn successfully.
Thomas Bowen [Tue, 14 Mar 2017 19:58:14 +0000 (12:58 -0700)]
Fixed problem with security-recv binary output not working correctly
Security Receive sent the wrong pointer, specifically a pointer to a
stack location. When using the Dump raw command we would dump stack
contents, not the buffer received from the controller.
Signed-off-by: Thomas Bowen <thomas.r.bowen@intel.com> Signed-off-by: Scott Bauer <Scott.Bauer@intel.com>
Javier González [Wed, 5 Apr 2017 10:10:27 +0000 (12:10 +0200)]
lightnvm: allow to init target on factory mode
Allow to drop the target recovery mechanism when creating a target in
order to start in factory mode. This facilitates development and makes
it possible to evaluate an OCSSD in different states.
Signed-off-by: Javier González <javier@cnexlabs.com>
Logan Gunthorpe [Tue, 28 Mar 2017 19:26:41 +0000 (13:26 -0600)]
fabrics: Fix disconnect_by_device from disconnecting instance 0 on error
I was a bit surprised that running:
nvme disconnect -d /dev/nvme1
actually disconnected nvme0 and I could never disconnect nvme1. Turns
out the code was not expecting a full path and silently used instance
zero if it failed to parse any arguments.
This patch fixes it so that it ignores any path component and fails if
sscanf doesn't match any items.