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>
Keith Busch [Fri, 11 Nov 2016 15:24:23 +0000 (10:24 -0500)]
get-feature updates
This fixes some of the printing options. We don't want to print text if
the request is to display the buffer in raw binary, and we don't want
to do a binary output if there is no buffer to write.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Gwendal Grignou [Thu, 13 Oct 2016 21:25:33 +0000 (14:25 -0700)]
Fix compilation errors:
While compiling nvme-cli for ChromeOS, the compiler founds minor issues
in the code:
- unsigned and sizet_t can never be negative.
- use fabs instead of llabs when argument is a double.
Christoph Hellwig [Wed, 12 Oct 2016 08:45:51 +0000 (10:45 +0200)]
fine tune the nvme-discover manpage
- remove the device argument, which as far as I can tell does not
exist.
- mention the /etc/nvme/hostnqn file, the default host nqn and explain
host nqns a bit more
- mention the loopback transport
- be a bit more specific about IP addressing as a concept separate from
the RDMA transport
- improve the introduction a bit.
Jay Freyensee [Fri, 7 Oct 2016 19:09:20 +0000 (12:09 -0700)]
nvme-cli: tweak discover man pages w/argconfig fix
With Sagi's fix to argconfig.c, the nvme-discover man
pages need to be tweaked to show the true intent of
using discovery.conf, a default with multiple discover
command-lines.
Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Jay Freyensee [Fri, 7 Oct 2016 18:46:16 +0000 (11:46 -0700)]
nvme-cli: have cfg var get set more than 1 execution
Without this fix, the struct config cfg variable only
gets set one time when argconfig_parse() is called. Any other
time it is attempted to be set, it acts as a read-only value
and continues to use the initial value it was set with.
This poses a problem for the discovery feature, discovery.conf file
as it is desired to make the file multiple line instead of a single
line, such as:
-t rdma -a 192.168.69.33 -s 4420 -q host2-proper-nqn
-t rdma -a 192.168.1.4 -s 4420 -q host2-proper-nqn
-t rdma -a 192.168.69.33 -s 99 -q host2-proper-nqn
I've tried the fix with a few existing commands and nothing
appears to be broken, but I haven't done an exhaustive test.
Reported-by: Jay Freyensee <james_p_freyensee@linux.intel.com> Originally-by: Sagi Grimberg <sagi@lightbits.io> Tested-by: Jay Freyensee <james_p_freyensee@linux.intel.com>