]> www.infradead.org Git - users/hch/nvme-cli.git/log
users/hch/nvme-cli.git
8 years agoAdd error checking on all file opens
Keith Busch [Fri, 16 Dec 2016 00:06:36 +0000 (19:06 -0500)]
Add error checking on all file opens

I'm missing a few of these, which is causing erroneous errors to be
printed when requesting help, or providing a bad file handle.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoDecode an reservation errors code to strings
Yongseok Oh [Wed, 14 Dec 2016 03:05:55 +0000 (12:05 +0900)]
Decode an reservation errors code to strings

If reservation conflict happens with reservation related commands (e.g.,
resv_register, resv_acquire, and resv_release), show the error as a string.

[fixed compile error; reword commit message]
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge branch 'apage43-jsonfixes'
Keith Busch [Mon, 12 Dec 2016 16:26:19 +0000 (11:26 -0500)]
Merge branch 'apage43-jsonfixes'

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix right trim() in JSON output
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.

8 years agoOutput JSON device list in an array
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.

8 years agoFix handling of Firmware field in JSON output
Aaron Miller [Fri, 9 Dec 2016 23:11:28 +0000 (15:11 -0800)]
Fix handling of Firmware field in JSON output

This was not checking the sizeof() of the .fr field and could read past
the end of it.

8 years agoAllow bi-directional commands
Keith Busch [Tue, 6 Dec 2016 23:03:25 +0000 (18:03 -0500)]
Allow bi-directional commands

The spec allows bi-directional commands so let's let a user submit
one. The kernel does not support this at the moment, but maybe it will
someday.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix segfault listing models
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>
8 years agoRemove intel specific log from top-level commands
Keith Busch [Tue, 29 Nov 2016 22:42:40 +0000 (15:42 -0700)]
Remove intel specific log from top-level commands

Vendor specific plugins should be used for vendor specific logs, and
Intel already provides one.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMake code alignment great again
Keith Busch [Tue, 29 Nov 2016 22:37:56 +0000 (15:37 -0700)]
Make code alignment great again

Some of these config options got mis-aligned somewhere along the way.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMake program have single exit location
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>
8 years agoFix suffix shift overflow
Karsten Weiss [Tue, 6 Dec 2016 17:40:28 +0000 (12:40 -0500)]
Fix suffix shift overflow

From: Karsten Weiss <k.weiss@science-computing.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix intel read stats log page
Keith Busch [Tue, 6 Dec 2016 16:34:15 +0000 (11:34 -0500)]
Fix intel read stats log page

Need to use the parameter. Was mistakenly using the defined string,
which makes no sense.

Reported-by: Karsten Weiss <k.weiss@science-computing.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix 48-bit conversion for 32-bit arch
Keith Busch [Tue, 6 Dec 2016 15:37:52 +0000 (10:37 -0500)]
Fix 48-bit conversion for 32-bit arch

The cast to 'long' was the wrong type for 32-bit.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix 32-bit warning on print
Keith Busch [Tue, 6 Dec 2016 15:28:15 +0000 (10:28 -0500)]
Fix 32-bit warning on print

Use the arch specific print format macros.

https://github.com/linux-nvme/nvme-cli/issues/143

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoShow negative temperatures in smart log.
Keith Busch [Tue, 29 Nov 2016 15:25:27 +0000 (10:25 -0500)]
Show negative temperatures in smart log.

Issue: https://github.com/linux-nvme/nvme-cli/issues/141
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoUpdate man pages
Keith Busch [Thu, 17 Nov 2016 16:45:01 +0000 (11:45 -0500)]
Update man pages

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd a disconnect man page
Christoph Hellwig [Thu, 17 Nov 2016 16:26:27 +0000 (17:26 +0100)]
add a disconnect man page

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoadd a full blown connect man page
Christoph Hellwig [Thu, 17 Nov 2016 16:26:26 +0000 (17:26 +0100)]
add a full blown connect man page

Mostly based on the wording in connect-all.

Signed-off-by: Christoph Hellwig <hch@lst.de>
[Removed older/duplicate option]
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoupdate discover and connect-all man pages
Christoph Hellwig [Thu, 17 Nov 2016 16:26:25 +0000 (17:26 +0100)]
update discover and connect-all man pages

Document the --host-traddr option, and add the missing description of
the --raw command to the connect-all man page.

Signed-off-by: Christoph Hellwig <hch@lst.de>
[Removed old/duplicate option entry]
Signed-off-by: Keith Busch <keith.busch@intel.com>
Conflicts:
Documentation/nvme-connect-all.txt
Documentation/nvme-discover.txt

8 years agonvmecli-tests : update the list of dependencies
chaitany kulkarni [Thu, 17 Nov 2016 08:48:17 +0000 (00:48 -0800)]
nvmecli-tests : update the list of dependencies

README file is updated with complete list of dependencies
required to setup the environment for unitttests.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@hgst.com>
8 years agoFix Debian rules
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.

Reviewed-by: Christoph Hellwig <hch@lst.de>
8 years agoUnittest framework based on nvme-cli.
Chaitanya Kulkarni [Thu, 27 Oct 2016 06:48:37 +0000 (23:48 -0700)]
Unittest framework based on nvme-cli.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@hgst.com>
8 years agoRelease version 1.0 v1.0
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>
8 years agoUpdate documentation
Keith Busch [Tue, 15 Nov 2016 23:11:06 +0000 (18:11 -0500)]
Update documentation

Fill in missing options in the IO commands.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoRemove accidental print
Keith Busch [Tue, 15 Nov 2016 17:24:54 +0000 (12:24 -0500)]
Remove accidental print

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoUpdate nvme-write-uncor documentation.
Keith Busch [Fri, 11 Nov 2016 15:26:33 +0000 (10:26 -0500)]
Update nvme-write-uncor documentation.

Eluded to the write-zeroes by mistake.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoget-feature updates
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>
8 years agoRe-add host-traddr option to connect-all manpage
Keith Busch [Thu, 27 Oct 2016 16:31:28 +0000 (12:31 -0400)]
Re-add host-traddr option to connect-all manpage

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoUpdate documentation for discover
Keith Busch [Thu, 27 Oct 2016 16:19:30 +0000 (12:19 -0400)]
Update documentation for discover

Previous commit mistakenly added the host-traddr option to
connect-all. This is for discover.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix coding alignment
Keith Busch [Thu, 27 Oct 2016 16:18:05 +0000 (12:18 -0400)]
Fix coding alignment

Line wrapping argconfig options makes it harder to read.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoHost-traddr documentation updates
Keith Busch [Thu, 27 Oct 2016 16:00:00 +0000 (12:00 -0400)]
Host-traddr documentation updates

Changed the parameter to use '-' instead of '_' to match consistency of
other options.

Added the option to the connect and connect all manpages.

Replaced the 's' option to 'w' (wwn) as 's' was already in use.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoDocument timeout value usage
Keith Busch [Wed, 26 Oct 2016 19:41:29 +0000 (15:41 -0400)]
Document timeout value usage

Add to man page and clarify value is in milliseconds.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agonvme-cli: endian swap mmio access
Christoph Hellwig [Wed, 26 Oct 2016 15:01:16 +0000 (17:01 +0200)]
nvme-cli: endian swap mmio access

PCIe is always defined as little endian, so swap the data read from the
register to native endian.

Use the opportunity to also apply the no 64-bit access workaround to
all of the register accesses and not just some and dump struct nvme_reg.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agonvme-cli: Add support for Fibre-channel host address
Duane Grigsby [Mon, 24 Oct 2016 15:30:32 +0000 (08:30 -0700)]
nvme-cli: Add support for Fibre-channel host address

   Example:
nvme connect-all --transport=fc --traddr=pn-0x200100110d9f4100:nn-0x200100110d9f4100 \
--host_traddr=nn-0x20000024ff5ba062:pn-0x21000024ff5ba062

nvme connect --transport=fc --nqn=nqn.2014-08.org.nvmexpress:nvm-subsystem \
--traddr=pn-0x200100110d9f4100:nn-0x200100110d9f4100 --host_traddr=nn-0x20000024ff5ba062:pn-0x21000024ff5ba062

Signed-off-by: Darren Trapp <darren.trapp@cavium.com>
8 years agoregenerate man pages
Keith Busch [Fri, 21 Oct 2016 16:03:57 +0000 (12:03 -0400)]
regenerate man pages

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agonvme-cli: fix nvme-connect-all using hostnqn
Jay Freyensee [Fri, 21 Oct 2016 15:50:05 +0000 (08:50 -0700)]
nvme-cli: fix nvme-connect-all using hostnqn

The example in the man pages:

nvme connect-all --transport=rdma --traddr=192.168.1.3 \
--hostnqn=host1-rogue-nqn

fails because nvme-cli fails to actually use hostnqn upon
connect.  This patch fixes that.

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
8 years agonvme-cli: follow-on doc tweaks to nvme-connect-all
Jay Freyensee [Fri, 21 Oct 2016 15:50:04 +0000 (08:50 -0700)]
nvme-cli: follow-on doc tweaks to nvme-connect-all

Minor massaging and typo fixes.

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
8 years agonvme-cli: follow-on discovery tweaks from thread
Jay Freyensee [Fri, 21 Oct 2016 15:50:03 +0000 (08:50 -0700)]
nvme-cli: follow-on discovery tweaks from thread

Follow-on doc patch tweaks from discovery documentation discussion.

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
8 years agoMerge pull request #133 from weber-wenbo-wang/master
Keith Busch [Tue, 18 Oct 2016 14:49:08 +0000 (08:49 -0600)]
Merge pull request #133 from weber-wenbo-wang/master

Add more memblaze specific smart info for FW 500

8 years agoAdd more memblaze specific smart info for FW 500
Wenbo Wang [Tue, 18 Oct 2016 07:09:28 +0000 (15:09 +0800)]
Add more memblaze specific smart info for FW 500

8 years agoMerge pull request #131 from gwendalcr/fix_compil
Keith Busch [Fri, 14 Oct 2016 14:33:08 +0000 (08:33 -0600)]
Merge pull request #131 from gwendalcr/fix_compil

Fix compilation errors

8 years agoFix compilation errors:
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.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
8 years agoMan page updates
Keith Busch [Wed, 12 Oct 2016 19:17:14 +0000 (15:17 -0400)]
Man page updates

Fix the connect-all manpage header section and regenerate all the
manpages.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd documentation for the connect-all command
Christoph Hellwig [Wed, 12 Oct 2016 08:45:51 +0000 (10:45 +0200)]
add documentation for the connect-all command

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agofine tune the nvme-discover manpage
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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoconsolidate reporting bugs information
Christoph Hellwig [Wed, 12 Oct 2016 08:45:51 +0000 (10:45 +0200)]
consolidate reporting bugs information

Add the Linux-nvme list to the main reporting bugs section and remove
the separate ones in the connect and discovery pages.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoAdd json format to list command
Keith Busch [Mon, 10 Oct 2016 20:29:07 +0000 (14:29 -0600)]
Add json format to list command

Updating man page with new options.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoargconfig: use strtoul for unsigned types
Keith Busch [Mon, 10 Oct 2016 19:50:27 +0000 (13:50 -0600)]
argconfig: use strtoul for unsigned types

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoReturn all errors on list command
Keith Busch [Mon, 10 Oct 2016 18:06:38 +0000 (12:06 -0600)]
Return all errors on list command

Negative errors mean the command failed and we shouldn't try displaying
information if getting it wasn't succcessful.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge pull request #130 from jpfreyen/master
Keith Busch [Fri, 7 Oct 2016 19:33:39 +0000 (13:33 -0600)]
Merge pull request #130 from jpfreyen/master

fix to argconfig.c for nvme-discover

8 years agonvme-cli: tweak discover man pages w/argconfig fix
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>
8 years agonvme-cli: have cfg var get set more than 1 execution
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>
8 years agoFix nvme-models in makefile
Keith Busch [Wed, 5 Oct 2016 23:23:28 +0000 (19:23 -0400)]
Fix nvme-models in makefile

From: Scott Bauer <scott.bauer@intel.com>

We're not sure why our system tested ok without this...

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge branch 'isdct-nvme-log' of https://github.com/ScottyBauer/nvme-cli
Keith Busch [Wed, 5 Oct 2016 23:07:13 +0000 (19:07 -0400)]
Merge branch 'isdct-nvme-log' of https://github.com/ScottyBauer/nvme-cli

8 years agoJSONify SMART-add command, and rework json for fw-info-slots
Scott Bauer [Tue, 20 Sep 2016 20:36:16 +0000 (14:36 -0600)]
JSONify SMART-add command, and rework json for fw-info-slots

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
8 years agoImplement json output for list that matches 'isdtc show -output json --intelssd'
Scott Bauer [Mon, 19 Sep 2016 17:27:43 +0000 (11:27 -0600)]
Implement json output for list that matches 'isdtc show -output json --intelssd'

    New command:
    nvme list -output-format json|normal
OR
    nvme list

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
8 years agoCommit new man pages
Keith Busch [Fri, 30 Sep 2016 20:00:55 +0000 (14:00 -0600)]
Commit new man pages

This time actually adding the new man pages for fabrics.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge pull request #127 from narasimhan-v/latency_script_fix
Keith Busch [Fri, 30 Sep 2016 15:14:51 +0000 (09:14 -0600)]
Merge pull request #127 from narasimhan-v/latency_script_fix

latency script fixup

8 years agolatency script fixup
Narasimhan V [Fri, 30 Sep 2016 12:38:30 +0000 (18:08 +0530)]
latency script fixup

This patch adds functionality to
*) Calculate and display the average latency
*) Make sure count is not 0

Fixes
*) in case of write, grep latency in case of dd command would
always fail. Fixed it.

Signed-off-by: Narasimhan V <sim@linux.vnet.ibm.com>
8 years agoMerge pull request #125 from yongseokoh/fix_id_ctrl
Keith Busch [Thu, 29 Sep 2016 15:57:45 +0000 (09:57 -0600)]
Merge pull request #125 from yongseokoh/fix_id_ctrl

Modified: print the subnqn (NVM Subsystem NVMe Qualified Name) field …

8 years agoChange uuid_be type to __u8
Keith Busch [Thu, 29 Sep 2016 14:56:05 +0000 (10:56 -0400)]
Change uuid_be type to __u8

From: Christoph Hellwig <hch@infradead.org>

This removes the linux header dependency for compiling.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoRegenerate man pages
Keith Busch [Thu, 29 Sep 2016 14:54:36 +0000 (10:54 -0400)]
Regenerate man pages

New text files added for fabrics documentation, so committing the
generated manpages.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agonvme-cli: Add discover connect cmds to main list
Jay Freyensee [Wed, 28 Sep 2016 23:49:44 +0000 (16:49 -0700)]
nvme-cli: Add discover connect cmds to main list

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
8 years agonvme-cli: Add nvme-connect.txt shell for fill in
Jay Freyensee [Wed, 28 Sep 2016 23:49:43 +0000 (16:49 -0700)]
nvme-cli: Add nvme-connect.txt shell for fill in

nvme-discover documentation refers to nvme-connect,
so add a starter file for nvme-connect for fill
in by a generous soul :-).

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
8 years agonvme-cli: Tweak discover summary to match docs
Jay Freyensee [Wed, 28 Sep 2016 23:49:42 +0000 (16:49 -0700)]
nvme-cli: Tweak discover summary to match docs

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
8 years agonvme-cli: Documentation for nvme-discover
Jay Freyensee [Wed, 28 Sep 2016 23:49:41 +0000 (16:49 -0700)]
nvme-cli: Documentation for nvme-discover

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
8 years agoModified: print the subnqn (NVM Subsystem NVMe Qualified Name) field for both normal...
Yongseok Oh [Wed, 28 Sep 2016 02:08:38 +0000 (11:08 +0900)]
Modified: print the subnqn (NVM Subsystem NVMe Qualified Name) field for both normal and jason formats upon the id_ctrl() command. Also, sn, mn, and fr fields are printed as the jason format.

8 years agoMerge pull request #124 from jpfreyen/master
Keith Busch [Tue, 27 Sep 2016 14:25:24 +0000 (08:25 -0600)]
Merge pull request #124 from jpfreyen/master

nvme-cli: change 'r' to 'c' for connect flag

8 years agonvme-cli: change 'r' to 'c' for connect flag
Jay Freyensee [Fri, 23 Sep 2016 16:49:50 +0000 (09:49 -0700)]
nvme-cli: change 'r' to 'c' for connect flag

To make things a tad easier for human usage understanding,
refine the single letter short option of 'r' to 'c' for the
'connect' command as 'r' is already used by 'discover'.

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
8 years agoadd missing endianess conversions in lnvm_do_set_bbtbl
Christoph Hellwig [Fri, 23 Sep 2016 03:23:09 +0000 (20:23 -0700)]
add missing endianess conversions in lnvm_do_set_bbtbl

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd missing endianess conversions in __lnvm_do_set_bbtbl
Christoph Hellwig [Fri, 23 Sep 2016 03:23:08 +0000 (20:23 -0700)]
add missing endianess conversions in __lnvm_do_set_bbtbl

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd missing endianess conversions in __lnvm_do_get_bbtbl
Christoph Hellwig [Fri, 23 Sep 2016 03:23:07 +0000 (20:23 -0700)]
add missing endianess conversions in __lnvm_do_get_bbtbl

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd missing endianess conversions in json_smart_log
Christoph Hellwig [Fri, 23 Sep 2016 03:23:06 +0000 (20:23 -0700)]
add missing endianess conversions in json_smart_log

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd missing endianess conversions in json_nvme_id_ctrl
Christoph Hellwig [Fri, 23 Sep 2016 03:23:05 +0000 (20:23 -0700)]
add missing endianess conversions in json_nvme_id_ctrl

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd missing endianess conversions in json_nvme_id_ns
Christoph Hellwig [Fri, 23 Sep 2016 03:23:04 +0000 (20:23 -0700)]
add missing endianess conversions in json_nvme_id_ns

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd missing endianess conversions in print_list_item
Christoph Hellwig [Fri, 23 Sep 2016 03:23:03 +0000 (20:23 -0700)]
add missing endianess conversions in print_list_item

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agofix num_ctrls endianess in nvme_ns_attachment
Christoph Hellwig [Fri, 23 Sep 2016 03:23:02 +0000 (20:23 -0700)]
fix num_ctrls endianess in nvme_ns_attachment

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agointel: use correct endianess helpers in show_temp_stats
Christoph Hellwig [Fri, 23 Sep 2016 03:23:01 +0000 (20:23 -0700)]
intel: use correct endianess helpers in show_temp_stats

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agofabrics: use correct endianess helper in print_discovery_log
Christoph Hellwig [Fri, 23 Sep 2016 03:23:00 +0000 (20:23 -0700)]
fabrics: use correct endianess helper in print_discovery_log

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd missing endianess annoations for lightnvm data structures
Christoph Hellwig [Fri, 23 Sep 2016 03:22:59 +0000 (20:22 -0700)]
add missing endianess annoations for lightnvm data structures

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoadd support for checking endianess annotations using sparse
Christoph Hellwig [Fri, 23 Sep 2016 03:22:58 +0000 (20:22 -0700)]
add support for checking endianess annotations using sparse

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agovarious trivial sparse fixes
Christoph Hellwig [Fri, 23 Sep 2016 03:22:57 +0000 (20:22 -0700)]
various trivial sparse fixes

Use NULL instead of 0 for pointers, mark symbols static as needed
and provide proper ANSI C prototypes for all functions.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agouse abort() instead of __builtin_abort
Christoph Hellwig [Fri, 23 Sep 2016 03:22:56 +0000 (20:22 -0700)]
use abort() instead of __builtin_abort

This is more portable to different compilers, but should otherwise have
the same effect.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agodynamically allocate log page buffers
Christoph Hellwig [Fri, 23 Sep 2016 03:22:55 +0000 (20:22 -0700)]
dynamically allocate log page buffers

A device can report large logs.  Better dynamically allocate the buffer we
pass to the kernel instead of doing a gigantic stack allocation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agouse nvme.h from Linux
Christoph Hellwig [Fri, 23 Sep 2016 03:22:54 +0000 (20:22 -0700)]
use nvme.h from Linux

We still need various defintions of our own, but this cuts down the number
significantly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agofix linux/nvme.h for use with nvme-cli
Christoph Hellwig [Fri, 23 Sep 2016 03:22:53 +0000 (20:22 -0700)]
fix linux/nvme.h for use with nvme-cli

Rename a few fields or constants to be closer to the standards and a few more.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoimport linux/nvme.h
Christoph Hellwig [Fri, 23 Sep 2016 03:22:52 +0000 (20:22 -0700)]
import linux/nvme.h

We'll want to use this for structures as much as possible in the future to
keep a single header file for defintions from the NVMe specification.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agonvme-cli/fabrics: Add reconnect-delay param to connect cmd
Steve Wise [Tue, 20 Sep 2016 15:02:12 +0000 (08:02 -0700)]
nvme-cli/fabrics: Add reconnect-delay param to connect cmd

Added 'reconnect-delay' to 'connect' command so users can specify the
delay time, in seconds, before reconnecting due to a keep alive timeout.

usage examples:

nvme connect --reconnect-delay=30 --transport=rdma --traddr=10.0.1.14 --nqn=test-nvme
nvme connect -r 30 -t rdma -a 10.0.1.14 -n test-nvme

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Jay Freyensee <james_p_freyensee at linux.intel.com>
8 years agonvme-cli/fabrics: Add keep-alive-tmo param to connect cmd
Steve Wise [Tue, 20 Sep 2016 15:01:54 +0000 (08:01 -0700)]
nvme-cli/fabrics: Add keep-alive-tmo param to connect cmd

Added 'keep-alive-tmo' to 'connect' command so users can specify the
keep alive timeout period.

usage examples:

nvme connect --keep-alive-tmo=30 --transport=rdma --traddr=10.0.1.14 --nqn=test-nvme
nvme connect -k 30 -t rdma -a 10.0.1.14 -n test-nvme

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Jay Freyensee <james_p_freyensee at linux.intel.com>
8 years agonvme-format: Add optional reset parameter
Keith Busch [Thu, 22 Sep 2016 16:11:25 +0000 (12:11 -0400)]
nvme-format: Add optional reset parameter

Reset after format shouldn't be necessary, but some controllers require
it. This patch adds a parameter a user can set to trigger an automatic
controller reset after a successful format.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge pull request #119 from ScottyBauer/id-ctrl-stack-fix
Keith Busch [Thu, 22 Sep 2016 16:05:31 +0000 (10:05 -0600)]
Merge pull request #119 from ScottyBauer/id-ctrl-stack-fix

Fix stack-based overflow in id-ctrl json output.

8 years agoFix stack-based overflow in id-ctrl json output.
Scott Bauer [Thu, 22 Sep 2016 15:50:54 +0000 (09:50 -0600)]
Fix stack-based overflow in id-ctrl json output.

Fixes:

==15224==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffcf55 at pc 0x7ffff6ecb9f5 bp 0x7fffffffcd80 sp 0x7fffffffc510
WRITE of size 22 at 0x7fffffffcf55 thread T0
    #0 0x7ffff6ecb9f4 in __interceptor_vsprintf (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x619f4)
    #1 0x7ffff6ecbcc9 in __interceptor_sprintf (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x61cc9)
    #2 0x420357 in json_nvme_id_ctrl /home/sbauer/nvme_code/nvme-cli/nvme-print.c:1266
    #3 0x4072f1 in __id_ctrl /home/sbauer/nvme_code/nvme-cli/nvme.c:935
    #4 0x40742f in id_ctrl /home/sbauer/nvme_code/nvme-cli/nvme.c:950
    #5 0x42fa63 in handle_plugin /home/sbauer/nvme_code/nvme-cli/plugin.c:140
    #6 0x410c46 in main /home/sbauer/nvme_code/nvme-cli/nvme.c:2729
    #7 0x7ffff6ac182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #8 0x402268 in _start (/home/sbauer/nvme_code/nvme-cli/nvme+0x402268)

Address 0x7fffffffcf55 is located in stack of thread T0 at offset 117 in frame
    #0 0x42011f in json_nvme_id_ctrl /home/sbauer/nvme_code/nvme-cli/nvme-print.c:1254

  This frame has 3 object(s):
    [32, 41) 'fr'
    [96, 117) 'sn' <== Memory access at offset 117 overflows this variable
    [160, 201) 'mn'

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
8 years agoMerge pull request #116 from ScottyBauer/json_error_on_failure
Keith Busch [Mon, 19 Sep 2016 16:21:58 +0000 (10:21 -0600)]
Merge pull request #116 from ScottyBauer/json_error_on_failure

json: Print to stderr and abort() instead of returning NULL and faulting

8 years agojson: Print to stderr and abort() instead of returning NULL and faulting.
Scott Bauer [Mon, 19 Sep 2016 15:47:15 +0000 (09:47 -0600)]
json: Print to stderr and abort() instead of returning NULL and faulting.

No one who uses the JSON API is checking for return values.
Instead of littering the json code with if-else chains,
we will error on any memory allocation failure. Even though
incredibly unlikely malloc will return NULL it's easier to
check for it and print an error instead of faulting.

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
8 years agoPrint passthrough status to stderr
Keith Busch [Thu, 15 Sep 2016 21:19:27 +0000 (15:19 -0600)]
Print passthrough status to stderr

Don't send it to stdout in case the data is being redirected.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoSkip partitions
Keith Busch [Wed, 14 Sep 2016 19:23:57 +0000 (13:23 -0600)]
Skip partitions

We don't need to list partitions as it is redundant information with
the original namespace data.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge pull request #114 from andy00ff00/master
Keith Busch [Tue, 13 Sep 2016 15:51:44 +0000 (09:51 -0600)]
Merge pull request #114 from andy00ff00/master

fix dsm short-form switches for ctx-attrs and cdw11

8 years agofix dsm short-form switches for ctx-attrs and cdw11
Andy Green [Tue, 13 Sep 2016 15:43:54 +0000 (16:43 +0100)]
fix dsm short-form switches for ctx-attrs and cdw11

8 years agoMerge pull request #113 from jpfreyen/master
Keith Busch [Mon, 12 Sep 2016 22:10:16 +0000 (16:10 -0600)]
Merge pull request #113 from jpfreyen/master

getting discovery fields up-to-par with standard