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.
Keith Busch [Wed, 15 Mar 2017 15:33:35 +0000 (11:33 -0400)]
nvme-cli: Release v1.2
Changes in this release:
New vendor pluging from Western Digital.
Better memory usage on program tear down. Will be more important if
we have an interactive mode in the future.
Minor code reorganization to keep vendor uniqueness out of common code.
Conditionally compile without uuid support if library is not
installed. This is mainly to silence the complaints, as having libuuid
is very useful for fabrics.
Documentation updates and fixes.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Tue, 14 Mar 2017 15:49:42 +0000 (11:49 -0400)]
nvme-cli/format: use existing LBAF if none requested
We previously default to LBAF 0 if the user didn't specify one. If a
specific LBAF is not explicitly requested, most people expect format
to not change their currently in use LBAF. This patch uses the current
format if we have a namespace to query.
https://github.com/linux-nvme/nvme-cli/issues/164
Signed-off-by: Keith Busch <keith.busch@intel.com>
Christoph Hellwig [Mon, 13 Mar 2017 23:10:52 +0000 (17:10 -0600)]
remove json_add_smart_log
This is the json variant of the Intel additional smart log, but it
appears to be entirely unused. If we want to bring it back it should
be moved to intel-nvme.c, though.
Roland Dreier [Thu, 2 Mar 2017 18:06:21 +0000 (10:06 -0800)]
fabrics: Handle space-padded TRSVCID and TRADDR fields
The TRSVCID and TRADDR fields in the discovery log page are defined
as ASCII strings, which according to the NVMe standard means they
should be space-padded rather than NUL-terminated.
The current nvme-cli code will print all the spaces and possibly some
garbage from the next field. For example this causes "connect-all"
to write strings that get rejected with "malformed IP address passed."
Fix this by only writing the contents of these fields until the last
non-space character, and limiting the length to the size of the field.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Chaitanya Kulkarni [Wed, 1 Mar 2017 02:14:09 +0000 (18:14 -0800)]
nvme-cli: Western Digital/HGST plug-in.
This patch adds support for Vendor unique commands for
Western Digital/HGST devices. Following commands are
supported in current version of this extension:-
Chaitanya Kulkarni [Wed, 1 Mar 2017 02:14:07 +0000 (18:14 -0800)]
nvme-cli: id-ctrl: Add vendor fields in JSON id-ctrl.
As a part of the id-ctrl command vendor specific callback is issued.
This patch allows the vendor-specific callback to print the extended
vendor unique (ctrl->vs) information from identify controller
data structure in the JSON format. It also enables id-ctrl command
to print vendor specific fields along with generic id-ctrl fields
in one JSON object. This modifies Intel plug-in which is the only
one uses extended id-ctrl (cs->vs) information in current
implementation.
Chaitanya Kulkarni [Sun, 26 Feb 2017 07:34:42 +0000 (23:34 -0800)]
nvme-cli: smart-log: Allow negative values for temp sensors.
HGST devices allowed to produce valid negative values for
"Temperature Sensor 1" of the smart-log command. Change the
temperature sensor value from unsigned to signed so that
negative values will be printed correctly.
Chaitanya Kulkarni [Fri, 24 Feb 2017 02:39:37 +0000 (18:39 -0800)]
nvme-cli: json_add_smart_log(): Fix memory leak for JSON.
This patch fixes the following memory leak for json_add_smart_log()
when used by the external function:-
==8637== HEAP SUMMARY:
==8637== in use at exit: 1,807 bytes in 56 blocks
==8637== total heap usage: 101 allocs, 45 frees, 6,577 bytes allocated
==8637==
==8637== LEAK SUMMARY:
==8637== definitely lost: 24 bytes in 1 blocks
==8637== indirectly lost: 1,783 bytes in 55 blocks
==8637== possibly lost: 0 bytes in 0 blocks
==8637== still reachable: 0 bytes in 0 blocks
==8637== suppressed: 0 bytes in 0 blocks
Fix:-
==8667== HEAP SUMMARY:
==8667== in use at exit: 0 bytes in 0 blocks
==8667== total heap usage: 101 allocs, 152 frees, 6,577 bytes allocated
==8667==
Chaitanya Kulkarni [Fri, 24 Feb 2017 02:39:32 +0000 (18:39 -0800)]
nvme-cli: id-ns: Fix memory leak for JSON.
This patch fixes the following memory leak when id-ns command
executed with JSON option:-
==7642==
==7642== HEAP SUMMARY:
==7642== in use at exit: 3,297 bytes in 120 blocks
==7642== total heap usage: 182 allocs, 62 frees, 9,204 bytes allocated
==7642==
==7642== LEAK SUMMARY:
==7642== definitely lost: 24 bytes in 1 blocks
==7642== indirectly lost: 3,273 bytes in 119 blocks
==7642== possibly lost: 0 bytes in 0 blocks
==7642== still reachable: 0 bytes in 0 blocks
==7642== suppressed: 0 bytes in 0 blocks
==7642== Rerun with --leak-check=full to see details of leaked memory
==7642==
Fix:-
==7949==
==7949== HEAP SUMMARY:
==7949== in use at exit: 0 bytes in 0 blocks
==7949== total heap usage: 182 allocs, 182 frees, 9,204 bytes allocated
==7949==
Matias Bjørling [Wed, 15 Feb 2017 14:57:32 +0000 (15:57 +0100)]
lightnvm: default to -1 on lun begin and end
The default behavior when initializing a target without lun end and
begin is to use only the first lun of the OCSSD. Going forward, the
user shall either explicit specific the begin and end, or if not defined
for kernel 4.11 and newer, the full SSD is initialized.
Andy Lutomirski [Thu, 1 Sep 2016 15:27:48 +0000 (08:27 -0700)]
get-features: Don't try to read the data buffer for sel == 3
When sel == 3, the controller returns capabilities in the completion
entry and does not produce a feature value blob. Stop allocating
space for the blob and displaying it -- the result is garbage.
Sagi Grimberg [Thu, 12 Jan 2017 11:13:29 +0000 (13:13 +0200)]
nvme.spec/debian: Auto generate host nqn as part of install
The installation will generate a hostnqn and store it in
/etc/nvme/hostnqn file (in case it doesn't exist).
This file will be removed upon uninstallation (purge on for debian).
Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Sagi Grimberg [Thu, 12 Jan 2017 11:13:28 +0000 (13:13 +0200)]
nvme-cli: Add nvme hostnqn generation option
Add option to generate a NVMe qualified name of a given host
(in the form of: nqn.2014-08.org.nvmexpress:NVMf:uuid:<some_uuid>).
This hostnqn will be used for fabrics discovery and connect functions.
Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Keith Busch [Wed, 21 Dec 2016 22:24:31 +0000 (17:24 -0500)]
Release v1.1
This fixes multiple compiler warnings for 32-bit and other environments
from v1.0, adds more documentation to fabrics, removes the libudev
dependency entirely from this project, adds a framework for unit testing
devices, and fixes usage for user defined install paths.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Logan Gunthorpe [Mon, 19 Dec 2016 05:14:13 +0000 (22:14 -0700)]
Fix bash completion script
The bash completion script has never worked correctly for me.
After reviewing the code, it didn't seem to make too much sense to me
either. Thus, I've rewrote parts of it so that it works. I've also done
a _quick_ audit of all the main commands to make sure they
have the correct arguments available.
Keith Busch [Fri, 16 Dec 2016 23:35:15 +0000 (18:35 -0500)]
fabrics: show number of controllers disconnected
Multiple controllers may have the same nqn, so we iterate multiple
times and don't want to return the status of just the last one to try to
disconnect. This patch has the status show the number of controllers that
were disconnected based on that nqn as that should be more informative.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Thu, 15 Dec 2016 23:46:05 +0000 (18:46 -0500)]
nvme-cli: fabrics: remove libudev dependency
I get a lot of complaints about portability of the nvme-cli regarding the
libudev dependency. This patch removes the dependency from the fabrics
disconnect command when using the target nqn method. Tested on nvme
loop target.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Mike Frysinger [Fri, 16 Dec 2016 17:08:02 +0000 (12:08 -0500)]
Documentation: allow parent PREFIX to override
The current Documentation/Makefile always sets PREFIX to /usr/local.
If the parent Makefile sets it to something else, then it still gets
clobbered. Change the Makefile to look like the parent and allow the
cascading logic to work.
Mike Frysinger [Fri, 16 Dec 2016 00:10:28 +0000 (19:10 -0500)]
change default CFLAGS settings into the default
The way compiler settings are appended to CFLAGS breaks custom flags
that people are using to build. So if someone does:
$ export CFLAGS='-O0 -ggdb'
$ make
The build will force -O2 instead.
Shift these defaults into a default setting rather than always appending.
Aaron Miller [Fri, 9 Dec 2016 23:38:35 +0000 (15:38 -0800)]
Fix right trim() in JSON output
Was always trimming from the end of the format buffer, not the end of
the snprintf output. Also need to remove the initial decrement as
snprintf will leave fmt_sz pointing at the terminating NUL.
Aaron Miller [Tue, 6 Dec 2016 21:50:21 +0000 (13:50 -0800)]
Output JSON device list in an array
When printing as an object with product name as key, multiple cards with
the same product name can be present as the same key, and most JSON
parsers will only see one.
Keith Busch [Tue, 6 Dec 2016 22:36:32 +0000 (15:36 -0700)]
Fix segfault listing models
The models strings may not exist in the place this program thinks it
does. Check if the file is valid before reading from it, and return an
apporpriate string accordingly.
https://github.com/linux-nvme/nvme-cli/issues/140
Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Mon, 10 Oct 2016 23:11:19 +0000 (17:11 -0600)]
Make program have single exit location
All errors are returned rather than exiting the program. This requires
more return code error checking, but it makes it predictable where the
program may end and required if we ever implement an interactive mode.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Sagi Grimberg [Thu, 17 Nov 2016 15:35:13 +0000 (10:35 -0500)]
Fix Debian rules
Usually when building a package we don't want to run tests
that require nvme devices. So until we can classify to tests
that have requirements to not run unless some env variables
are set we need this rule.
Keith Busch [Tue, 15 Nov 2016 23:15:25 +0000 (18:15 -0500)]
Release version 1.0
Been long enough, and lots of updates accumlated. Thank you to everyone
who contributed this round!
Just some highlights in this release:
* Bug fixes on some of the lesser used parameters and commands
* Support for fabrics discover and connect to targets
* More 3rd party extensions have been added
* New JSON output formats on some of the show routines
* Documenation updates and fixes
* Compiler warnings for some configurations
Signed-off-by: Keith Busch <keith.busch@intel.com>