]> www.infradead.org Git - users/hch/nvme-cli.git/log
users/hch/nvme-cli.git
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

8 years agofabrics.c style cleanup using checkpatch.pl
Jay Freyensee [Mon, 12 Sep 2016 20:56:22 +0000 (13:56 -0700)]
fabrics.c style cleanup using checkpatch.pl

Way too many over-80-char lines driving me nuts...

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
8 years agonvme-cli: change nqntype to subtype, per spec
Jay Freyensee [Wed, 7 Sep 2016 22:50:57 +0000 (15:50 -0700)]
nvme-cli: change nqntype to subtype, per spec

Fabrics spec has no field called 'nqntype', rather
it's 'subtype'.

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
8 years agonvme-cli: match treq value names to spec
Jay Freyensee [Wed, 7 Sep 2016 20:51:13 +0000 (13:51 -0700)]
nvme-cli: match treq value names to spec

spec uses "not specified" as one of the values for treq,
just like other discovery parameters (like rdma_prtype).

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
8 years agoadd 'return err' code to consider NVME I/O error situation in host (e.g., bash)
Yongseok Oh [Tue, 6 Sep 2016 03:07:41 +0000 (12:07 +0900)]
add 'return err' code to consider NVME I/O error situation in host (e.g., bash)

8 years agofix inappropriate size of resv10 [] array field in the nvme_reservation_status based...
Yongseok Oh [Tue, 6 Sep 2016 02:55:55 +0000 (11:55 +0900)]
fix inappropriate size of resv10 [] array field in the nvme_reservation_status based NVMe 1.21 spec.
Add cdw10 field to convey Number of Dwords (NUMD) for the Reservation Report command

8 years agoRelease version v0.9 v0.9
Keith Busch [Wed, 31 Aug 2016 17:15:54 +0000 (11:15 -0600)]
Release version v0.9

New extensions, fabrics support, a bug fixes. The 'list' command
is liberated from its udev dependency, and no longer requires
CONFIG_IO_STRICT_DEVMEM be disabled.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agonvme-cli/fabrics: Add nr_io_queues parameter to connect command
Steve Wise [Mon, 29 Aug 2016 15:53:02 +0000 (08:53 -0700)]
nvme-cli/fabrics: Add nr_io_queues parameter to connect command

Added 'nr-io-queues' to 'connect' command so users can specify the number
of io queues to allocate.

usage examples:

nvme connect --transport=rdma --nr-io-queues=8 --trsvcid=4420 --traddr=10.0.1.14 --nqn=test-nvme
nvme connect -t rdma -i 8 -s 4420 -a 10.0.1.14 -n test-nvme

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
8 years agoSimplify list command
Keith Busch [Tue, 30 Aug 2016 20:33:54 +0000 (14:33 -0600)]
Simplify list command

Use scandir with an appropriate filter to find all our nvme namespaces
and handle allocating all the dirent's. Makes the implementation a
little simpler.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoRemove version from list
Keith Busch [Tue, 30 Aug 2016 14:49:19 +0000 (08:49 -0600)]
Remove version from list

We can't reliably map controller registers due to kernel memory
protections added in kernel commit 90a545e98, so we are removing its
dependency for the 'list' command to run.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge pull request #111 from iori-yja/purge_readdir_r
Keith Busch [Mon, 29 Aug 2016 14:32:25 +0000 (08:32 -0600)]
Merge pull request #111 from iori-yja/purge_readdir_r

purge `readdir_r` -- which is deprecated in recent glibc.

8 years agofix invalid opcode for nvme_resv_release() function
Yongseok Oh [Mon, 29 Aug 2016 08:04:18 +0000 (17:04 +0900)]
fix invalid opcode for nvme_resv_release() function

8 years agopurge `readdir_r` -- which is deprecated in recent glibc.
Iori YONEJI [Mon, 29 Aug 2016 14:22:18 +0000 (23:22 +0900)]
purge `readdir_r` -- which is deprecated in recent glibc.

This commit allows nvme-cli to be built with recent gcc/glibc.

8 years agoDecode error log status field
Keith Busch [Fri, 26 Aug 2016 16:38:41 +0000 (10:38 -0600)]
Decode error log status field

For easier readibility.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix linking order
Jon Derrick [Thu, 25 Aug 2016 15:19:13 +0000 (11:19 -0400)]
Fix linking order

Linking to libraries needs to be last to resolve all missing symbols at
the final stage rather than just linking to object being compiled.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agonvme-cli/fabrics: Added hostnqn parameter to connect command
Roy Shterman [Wed, 24 Aug 2016 06:53:06 +0000 (09:53 +0300)]
nvme-cli/fabrics: Added hostnqn parameter to connect command

Added user-defined 'hostnqn' to 'connect' command
so users could use the allowed_hosts attribute on the target and still
connect to target with nvme-cli tool.

usage examples:
nvme connect -t <TRANSPORT> -a <ADDRESS> -s <SERVICE_ID> -n <NQN> -q <USER-DEFINED_HOSTNQN>

Signed-off-by: Roy Shterman <roysh@mellanox.com>
8 years agoMerge pull request #108 from ScottyBauer/master
Keith Busch [Wed, 24 Aug 2016 16:30:32 +0000 (10:30 -0600)]
Merge pull request #108 from ScottyBauer/master

nvme-cli: Implement list command that doesn't rely on libudev

Thanks for the update!

8 years agonvme-cli: Implement list command that doesn't rely on libudev
Scott Bauer [Mon, 22 Aug 2016 23:19:24 +0000 (17:19 -0600)]
nvme-cli: Implement list command that doesn't rely on libudev

The previous list command required libudev. We can accomplish the same
thing with standard functions. Libudev is still required for some code
in fabrics.c, but the depencency has been removed from nvme.c.

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
8 years agofabrics: Take the hostnqn parameter from a conf file if not given
Sagi Grimberg [Tue, 16 Aug 2016 09:46:27 +0000 (12:46 +0300)]
fabrics: Take the hostnqn parameter from a conf file if not given

In order to allow persistent hostnqns, take the hostnqn parameter
for /etc/nvme/hostnqn if exists.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
8 years agofabrics: Allow discover params to come from a conf file
Sagi Grimberg [Tue, 16 Aug 2016 09:46:26 +0000 (12:46 +0300)]
fabrics: Allow discover params to come from a conf file

Allow the user to just run "nvme discover" or "nvme connect-all"
in case it finds a default /etc/nvme/nvmf_disc conf file.

We allow multiple discovery addresses by iterating over the
lines of the file and executing a discover (with or without
connect) for each line. We allow newlines and '#' prefixed comments.

The return value is or'ed on all discover attempts.

In order to minimize some parsing code, I just convert the
file line into an (argc, argv) pair and feed it to argconfig_parse()
which dictates that the file lines are identical to what one would
pass nvme discover <params>. I'm open to better ideas.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
8 years agofabrics: stringify discover output.
Sagi Grimberg [Tue, 16 Aug 2016 09:46:25 +0000 (12:46 +0300)]
fabrics: stringify discover output.

Just so we have a nice readable output.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
8 years agofabrics: Allow ipv6 address resolution
Sagi Grimberg [Tue, 16 Aug 2016 09:46:24 +0000 (12:46 +0300)]
fabrics: Allow ipv6 address resolution

While we're at it, make the adrfam condition
a proper switch-case statement.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
8 years agoRevert "fabrics: Allow ipv6 address resolution"
Keith Busch [Tue, 16 Aug 2016 15:58:30 +0000 (09:58 -0600)]
Revert "fabrics: Allow ipv6 address resolution"

This reverts commit 6136d06f825be042b203579111c718bddf7c8670.

8 years agointel-nvme: Remove newline from filename
Keith Busch [Mon, 15 Aug 2016 17:31:42 +0000 (11:31 -0600)]
intel-nvme: Remove newline from filename

The filename shouldn't have the special character.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agofabrics: Allow ipv6 address resolution
Sagi Grimberg [Mon, 8 Aug 2016 11:57:57 +0000 (14:57 +0300)]
fabrics: Allow ipv6 address resolution

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
8 years agoMerge branch 'master' of https://github.com/linux-nvme/nvme-cli
Keith Busch [Mon, 8 Aug 2016 15:54:48 +0000 (09:54 -0600)]
Merge branch 'master' of https://github.com/linux-nvme/nvme-cli

8 years agoFix f/w log on big endian
Keith Busch [Fri, 5 Aug 2016 21:10:51 +0000 (15:10 -0600)]
Fix f/w log on big endian

The driver handles the endian conversion already, so doing this from
user-space was resulting in the wrong value for big-endian machines.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge pull request #103 from jpfreyen/master
Keith Busch [Thu, 4 Aug 2016 23:36:17 +0000 (17:36 -0600)]
Merge pull request #103 from jpfreyen/master

major discovery fix for nvme-over-fabrics, minor documentation tweak on lbads

8 years agonvme-cli: user-defined hostnqn option for discover
Jay Freyensee [Thu, 28 Jul 2016 19:23:59 +0000 (12:23 -0700)]
nvme-cli: user-defined hostnqn option for discover

The nvme-cli will always use the default hostnqn
in /dev/nvme-fabrics  for the discovery query, even though
both the NVMe Target and NVMe Host rdma implementations allow
user-defined hostnqn naming.

For example, this is the current, somewhat broken behavior if you
used your own hostnqn provision naming on the NVMe kernel target:

nvme discover /dev/nvme-fabrics  -t rdma --traddr=192.168.1.3 --trsvcid=4420

in dmesg:
[591910.025779] nvme nvme0: Connect Invalid Data Parameter, hostnqn "nqn.2014-08.org.nvmexpress:NVMf:uuid:a2d7752c-a31b-477a-a003-31a5e1c424a9"

New, fixed behavior introduced by this patch:

[root@fedora23-fabrics-host1 nvme-cli]# nvme discover  -t rdma --traddr=192.168.1.3 --trsvcid=4420 --hostnqn=host1-rogue-nqn

Discovery Log Number of Records 1, Generation counter 10
=====Discovery Log Entry 0======
trtype:  ipv4
adrfam:  rdma
nqntype: 2
treq:    0
portid:  1
trsvcid: 4420
subnqn:  nullside-nqn
traddr:  192.168.1.3
rdma_prtype: 0
rdma_qptype: 0
rdma_cms:    0
rdma_pkey: 0x0000
[root@fedora23-fabrics-host1 nvme-cli]#

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: Roy Shterman <roysh@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
8 years agoprint "lbads" out, per spec
Jay Freyensee [Sat, 23 Jul 2016 01:24:11 +0000 (18:24 -0700)]
print "lbads" out, per spec

NVMe specfication lists the 'ds' field printed in nvme-cli
as 'lbads'.  Change to be consistent with the spec.

Signed-off-by: Jay Freyensee <james_p_freyensee@linux.intel.com>
8 years agoUse different error code when command not found
Keith Busch [Mon, 1 Aug 2016 21:25:38 +0000 (15:25 -0600)]
Use different error code when command not found

A failed system call returns -1 with errno set, so lets differentiate
a failed system call from not finding a command at all. This suppresses
large help messages on any generic system call failure.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix install bash completions
Keith Busch [Tue, 26 Jul 2016 21:37:26 +0000 (15:37 -0600)]
Fix install bash completions

The install didn't match the rpm spec. This patch changes the install
directory to match systems that build rpms.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge pull request #101 from samiWaheed/master
Keith Busch [Wed, 13 Jul 2016 14:58:06 +0000 (08:58 -0600)]
Merge pull request #101 from samiWaheed/master

Added an option to display NVM PCIe registers in human readable format

8 years agoMerge pull request #102 from hrasiq/master
Keith Busch [Wed, 13 Jul 2016 14:57:52 +0000 (08:57 -0600)]
Merge pull request #102 from hrasiq/master

Fix read/write memory corruption issues