]> www.infradead.org Git - users/hch/nvme-cli.git/log
users/hch/nvme-cli.git
8 years agoAdd memblaze get/set feature support
Wenwei Tao [Thu, 7 Jul 2016 09:38:32 +0000 (17:38 +0800)]
Add memblaze get/set feature support

Signed-off-by: Wenwei Tao <wenwei.tao@memblaze.com>
8 years agoAdd memblaze vendor specific SMART Log support
Wenwei Tao [Fri, 1 Jul 2016 09:46:13 +0000 (17:46 +0800)]
Add memblaze vendor specific SMART Log support

Signed-off-by: Wenwei Tao <wenwei.tao@memblaze.com>
8 years agoMerge pull request #100 from samiWaheed/master
Keith Busch [Wed, 6 Jul 2016 17:09:16 +0000 (11:09 -0600)]
Merge pull request #100 from samiWaheed/master

Display NVMe command status in both string and hex format (write_zeroes & write_uncor)

8 years agoDisplay NVMe command status in both string and hex format for write_uncorr and write_...
root [Wed, 6 Jul 2016 16:58:01 +0000 (09:58 -0700)]
Display NVMe command status in both string and hex format for write_uncorr and write_zeroes commands

8 years agoMerge pull request #99 from samiWaheed/master
Keith Busch [Wed, 6 Jul 2016 15:06:51 +0000 (09:06 -0600)]
Merge pull request #99 from samiWaheed/master

Enhanced error reporting for invalid commands and/or extensions.

8 years agoMerge pull request #98 from safl/master
Keith Busch [Wed, 6 Jul 2016 15:03:09 +0000 (09:03 -0600)]
Merge pull request #98 from safl/master

plugin-lnvm: Fixes to argument parsing.

8 years agoEnhanced error reporting for invalid commands and/or extensions. List reason why...
root [Tue, 5 Jul 2016 17:06:07 +0000 (10:06 -0700)]
Enhanced error reporting for invalid commands and/or extensions.  List reason why command line failed before displaying the usage message

8 years agoplugin-lnvm: Added check for mandatory arg in lnvm_factory_init.
Simon A. F. Lund [Tue, 5 Jul 2016 15:32:55 +0000 (17:32 +0200)]
plugin-lnvm: Added check for mandatory arg in lnvm_factory_init.

8 years agoplugin-lnvm: Fixed argument parsing in lnvm_init.
Simon A. F. Lund [Tue, 5 Jul 2016 15:29:21 +0000 (17:29 +0200)]
plugin-lnvm: Fixed argument parsing in lnvm_init.

The option 'mediamgr-name' had "no_argument" causing parsing failure,
changed to "required_argument".

Added check that option 'device-name' is provided since it is mandatory.

8 years agoplugin-lnvm: Fixed argument parsing in lnvm_create_tgt.
Simon A. F. Lund [Tue, 5 Jul 2016 15:08:29 +0000 (17:08 +0200)]
plugin-lnvm: Fixed argument parsing in lnvm_create_tgt.

The options lun-begin and lun-end had "no_argument" causing parsing failure,
changed to "required_argument".

The options lun-begin and lun-end parsed to invalid destination (cfg.tgt_type),
changed to cfg.lun_begin and cfg.lun_end respectfully.

8 years agoRelease nvme-cli v0.8 v0.8
Keith Busch [Mon, 27 Jun 2016 18:22:40 +0000 (12:22 -0600)]
Release nvme-cli v0.8

Lots of updates in this release!

 * Code re-organized to support new extensions. While these are called
   "plugins", they currently have to be built into the executable. Support
   for dynamically loadable plugins is under consideration.

 * LightNVM is added as a built-in plugin.

 * Intel vendor specific commands and structure decodings are supported
   in a new intel plugin.

 * Support for NVMe-over-Fabrics

 * New output format "json" for a subset of commands that decode returned
   structures.

 * Lots of various documentation and minor code fixes.

Seems stable, so tagging a release.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge pull request #94 from samiWaheed/master
Keith Busch [Mon, 27 Jun 2016 16:38:53 +0000 (10:38 -0600)]
Merge pull request #94 from samiWaheed/master

Added "-s" option to the set-feature command to save the specified feature

8 years agoChanged save variable from bool to int
root [Mon, 27 Jun 2016 16:28:33 +0000 (09:28 -0700)]
Changed save variable from bool to int
Added "--save/-s" option to man page and documentation
Modified set-feature documentation (Removed invalid command line options, removed references to get-feature, and corrected examples to use set-feature instead of get-feature

8 years agoAdded "-s" option to the set-feature command to save the specified feature
root [Fri, 24 Jun 2016 22:00:49 +0000 (15:00 -0700)]
Added "-s" option to the set-feature command to save the specified feature

8 years agoMerge pull request #93 from samiWaheed/master
Keith Busch [Wed, 22 Jun 2016 20:46:48 +0000 (14:46 -0600)]
Merge pull request #93 from samiWaheed/master

Minor fixes to printed output of set/get feature

8 years agoIn set_feature: print value instead of status
root [Wed, 22 Jun 2016 20:37:26 +0000 (13:37 -0700)]
In set_feature:  print value instead of status
In nvme_feature_show_fields:  Correct printed output of Arbitration Burst

8 years agoMerge pull request #92 from samiWaheed/master
Keith Busch [Tue, 21 Jun 2016 22:54:22 +0000 (16:54 -0600)]
Merge pull request #92 from samiWaheed/master

Enhanced both reset and subsystem-reset to return an error message

8 years agoEnhanced both reset and subsystem-reset to return an error message on older kernels...
root [Tue, 21 Jun 2016 22:31:29 +0000 (15:31 -0700)]
Enhanced both reset and subsystem-reset to return an error message on older kernels with no ioctl support
Added "zeroes based" to the block count documentation for write-uncorr and write-zeroes

8 years agoUpdate help on IO command parameters
Keith Busch [Mon, 20 Jun 2016 23:03:43 +0000 (17:03 -0600)]
Update help on IO command parameters

The block count has always been 0's based, but you'd never know that
without reading the code.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agodoc: mention 'list' requires udev
Keith Busch [Mon, 20 Jun 2016 15:01:41 +0000 (09:01 -0600)]
doc: mention 'list' requires udev

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agofabrics: compile when libudev not installed
Keith Busch [Thu, 16 Jun 2016 18:32:43 +0000 (12:32 -0600)]
fabrics: compile when libudev not installed

libudev is optional to use this repository. Packages can require it if
desired, but others downloading the repo should still be able to use
most of the functionality this tool provides without it.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix documentation
Keith Busch [Fri, 10 Jun 2016 17:19:38 +0000 (11:19 -0600)]
Fix documentation

Documentation fixes:

  Added the intel specific man pages
  Fixed the execlp man page name
  Fixed the help text in some of the intel commands.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAdd intel vendor unique log support
Keith Busch [Fri, 10 Jun 2016 16:36:23 +0000 (10:36 -0600)]
Add intel vendor unique log support

This adds retrieval for Intel vendor specific logs.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAdd some developer documentation to the README
Keith Busch [Thu, 9 Jun 2016 16:37:09 +0000 (10:37 -0600)]
Add some developer documentation to the README

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoUse simpler plugin definition
Keith Busch [Thu, 9 Jun 2016 15:57:45 +0000 (09:57 -0600)]
Use simpler plugin definition

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMake building plug-ins easier
Keith Busch [Thu, 9 Jun 2016 15:22:40 +0000 (09:22 -0600)]
Make building plug-ins easier

This adds a level to the code generation to handle defining and
registering plug-ins.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAdd Intel IO statistics log page
Keith Busch [Wed, 8 Jun 2016 23:24:57 +0000 (17:24 -0600)]
Add Intel IO statistics log page

Defined as per public P3xxx data sheet.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAdd Intel temperature statistics
Keith Busch [Wed, 8 Jun 2016 18:43:31 +0000 (12:43 -0600)]
Add Intel temperature statistics

Defined as per public P3xxx datasheet.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAdd intel marketing log page
Keith Busch [Wed, 8 Jun 2016 18:33:35 +0000 (12:33 -0600)]
Add intel marketing log page

Added as defined by public Intel datasheet on P3xxx series.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoExecute plugin when name is combined with command
Keith Busch [Wed, 8 Jun 2016 18:13:55 +0000 (12:13 -0600)]
Execute plugin when name is combined with command

Let a user specify plug-in sub commands in the same string. For example,
this patch will have the following two mean the same thing:

  # nvme intel id-ctrl
  # nvme intel-id-ctrl

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMake lnvm sub-commands an extension
Keith Busch [Tue, 7 Jun 2016 18:35:08 +0000 (12:35 -0600)]
Make lnvm sub-commands an extension

We want to keep the nvme top level commands strictly to spec. Anything
outside the spec can go in an extension.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAdd intel vendor specific id-ctrl decoding
Keith Busch [Tue, 7 Jun 2016 18:13:22 +0000 (12:13 -0600)]
Add intel vendor specific id-ctrl decoding

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAdd vendor specific callback to id-ctrl print
Keith Busch [Tue, 7 Jun 2016 18:05:44 +0000 (12:05 -0600)]
Add vendor specific callback to id-ctrl print

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAnd intel vendor specific extensions
Keith Busch [Tue, 7 Jun 2016 17:53:49 +0000 (11:53 -0600)]
And intel vendor specific extensions

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMake help and version generic commands
Keith Busch [Tue, 7 Jun 2016 22:38:40 +0000 (16:38 -0600)]
Make help and version generic commands

Plugins don't need to implement these.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMove program execution to plugin handler
Keith Busch [Tue, 7 Jun 2016 23:02:51 +0000 (17:02 -0600)]
Move program execution to plugin handler

The command list definition is moved to a header file that generates the
structures and prototypes when compiled. This makes it easy to define
new extensions that are not part of the NVMe standard.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoExecute sub-commands out of plugin structure
Keith Busch [Tue, 7 Jun 2016 19:45:44 +0000 (13:45 -0600)]
Execute sub-commands out of plugin structure

This encasulates sub-commands into a structure. This is the beginning
to support extensions and plugins.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAdd json output format
Keith Busch [Mon, 6 Jun 2016 20:49:07 +0000 (14:49 -0600)]
Add json output format

Adds new control option for json ouput support. The new option has
parameters for json, binary and normal output options.

The older control flag for raw binary still exists and can be used to
override the output format.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoSeperate kernel uapi from user structures
Keith Busch [Thu, 2 Jun 2016 22:08:31 +0000 (16:08 -0600)]
Seperate kernel uapi from user structures

This pulls in the latest kernel's exported uapi. Including it here
so that it can be used when the kernel headers are either outdated or
not installed.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoUse pattern rule for compiling objects
Keith Busch [Wed, 8 Jun 2016 15:59:41 +0000 (09:59 -0600)]
Use pattern rule for compiling objects

All the object files had the same pattern, though some of the targets
were missing the correct dependency list. This fixes them all with a
pattern rule.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoUse int type for CFG_NONE
Keith Busch [Tue, 7 Jun 2016 16:25:50 +0000 (10:25 -0600)]
Use int type for CFG_NONE

GNU long option requires flag be an int pointer. We were potentially
corrupting other parameters when using the 8-byte type.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMove parsing to top directory
Keith Busch [Tue, 7 Jun 2016 22:26:56 +0000 (16:26 -0600)]
Move parsing to top directory

We've diverged significantly from the argconfig program that nvme-cli
inherited, so no point in trying to keep it separate. Move it to the
top-level directory to make build rules easier.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoprint friendly name for trtype and adrfam
Ming Lin [Tue, 7 Jun 2016 21:33:20 +0000 (14:33 -0700)]
print friendly name for trtype and adrfam

Without this patch:
=====Discovery Log Entry 0======
trtype:  1
adrfam:  1

With this patch:
=====Discovery Log Entry 0======
trtype:  ipv4
adrfam:  rdma

Signed-off-by: Ming Lin <ming.l@samsung.com>
8 years agoimplement the connect-all command
Christoph Hellwig [Tue, 7 Jun 2016 15:19:27 +0000 (17:19 +0200)]
implement the connect-all command

Connects to all controllers pointed to by the discovery service.
Includes following referrals.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Ming Lin <ming.l@samsung.com>
Tested-by: Ming Lin <ming.l@samsung.com>
8 years agoImplement disconnect command
Ming Lin [Tue, 7 Jun 2016 15:19:26 +0000 (17:19 +0200)]
Implement disconnect command

Example usage:

Disconnect by NQN,
nvme disconnect -n nqn.testiqn

or by device name,
nvme disconnect -d nvme0

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
Tested-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jay Freyensee <james.p.freyensee@intel.com>
8 years agoImplement connect command
Ming Lin [Tue, 7 Jun 2016 15:19:25 +0000 (17:19 +0200)]
Implement connect command

Example usage:

root@host: nvme connect -t rdma -a 192.168.2.2 -p 1023 -n nqn.testiqn

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
Tested-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jay Freyensee <james.p.freyensee@intel.com>
8 years agoAdd option to save discovery raw log to a file
Ming Lin [Tue, 7 Jun 2016 15:19:24 +0000 (17:19 +0200)]
Add option to save discovery raw log to a file

root@host:~# nvme discover -t rdma -a 192.168.2.2 -p 1023 -r disc.raw
Discovery log is saved to disc.raw

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
Tested-by: Sagi Grimberg <sagi@grimberg.me>
8 years agoImplement discover command
Ming Lin [Tue, 7 Jun 2016 15:19:23 +0000 (17:19 +0200)]
Implement discover command

Example output:

root@host:~# nvme discover -t rdma -a 192.168.2.2 -p 1023
Discovery Log Number of Records 1, Generation counter 3
=====Discovery Log Entry 0======
trtype:  1
adrfam:  1
nqntype: 2
treq:    0
portid:  1
trsvcid: 1023

subnqn:  nqn.testiqn
traddr:  192.168.2.2

rdma_prtype: 0
rdma_qptype: 0
rdma_cms:    0
rdma_pkey: 0x0000

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
Tested-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jay Freyensee <james.p.freyensee@intel.com>
8 years agoAdds parser library
Ming Lin [Tue, 7 Jun 2016 15:19:22 +0000 (17:19 +0200)]
Adds parser library

This is imported from the Linux kernel 4.5.

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-and-tested-by: Sagi Grimberg <sagi@grimberg.me>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
8 years agoAdds nvme_discovery_log()
Ming Lin [Tue, 7 Jun 2016 15:19:21 +0000 (17:19 +0200)]
Adds nvme_discovery_log()

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-and-tested-by: Sagi Grimberg <sagi@grimberg.me>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
8 years agoAdd macro helpers to common.h
Ming Lin [Tue, 7 Jun 2016 15:19:20 +0000 (17:19 +0200)]
Add macro helpers to common.h

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-and-tested-by: Sagi Grimberg <sagi@grimberg.me>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
8 years agoAdd NVMeoF definition to nvme.h
Ming Lin [Tue, 7 Jun 2016 15:19:19 +0000 (17:19 +0200)]
Add NVMeoF definition to nvme.h

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-and-tested-by: Sagi Grimberg <sagi@grimberg.me>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
8 years agoSupport Get Log Page extended Number of Dwords
Ming Lin [Tue, 7 Jun 2016 15:19:18 +0000 (17:19 +0200)]
Support Get Log Page extended Number of Dwords

This supports 32 bits(rather than 12 bits) extended Number of Dwords
in nvme_get_log().

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-and-tested-by: Sagi Grimberg <sagi@grimberg.me>
Tested-by: Armen Baloyan <armenx.baloyan@intel.com>
8 years agoMakefile: introduce OBJS variable
Christoph Hellwig [Tue, 7 Jun 2016 15:19:17 +0000 (17:19 +0200)]
Makefile: introduce OBJS variable

Instead of listing all the objects twice.

Signed-off-by: Christoph Hellwig <hch@lst.de>
8 years agoMerge pull request #91 from ColinIanKing/master
Keith Busch [Mon, 6 Jun 2016 14:21:09 +0000 (08:21 -0600)]
Merge pull request #91 from ColinIanKing/master

 Fix leak of mbuffer on error exit path

8 years ago Fix leak of mbuffer on error exit path
Colin Ian King [Fri, 3 Jun 2016 18:27:52 +0000 (19:27 +0100)]
 Fix leak of mbuffer on error exit path

building with clang scan-build picked up a memory leak:
nvme.c:2176:3: warning: Potential leak of memory pointed to by 'mbuffer'
   fprintf(stderr, "failed to read data buffer from input file\n");
   ^~~~~~~

instead of returning, jump to free_and_return which performs the
correct cleanup.  Also fix the indentation of the return at the end of
the function.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
8 years agoGenarate lnvm documentation
Keith Busch [Thu, 2 Jun 2016 19:34:41 +0000 (13:34 -0600)]
Genarate lnvm documentation

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoMerge pull request #90 from ColinIanKing/master
Keith Busch [Thu, 2 Jun 2016 18:42:52 +0000 (12:42 -0600)]
Merge pull request #90 from ColinIanKing/master

minor fix and code clean up

8 years agoRemove extraneous and unused mode parameter from show_nvme_id_ctrl_power
Colin Ian King [Thu, 2 Jun 2016 18:31:38 +0000 (19:31 +0100)]
Remove extraneous and unused mode parameter from show_nvme_id_ctrl_power

mode is not used, so we may as well remove it

Signed-off-by: Colin Ian King <colin.king@canonical.com>
8 years agoMerge pull request #87 from MatiasBjorling/for-keith
Keith Busch [Thu, 2 Jun 2016 18:29:12 +0000 (12:29 -0600)]
Merge pull request #87 from MatiasBjorling/for-keith

Add LightNVM adminstration and diagnose support

8 years agoFix null pointer dereference on strlen()
Colin Ian King [Thu, 2 Jun 2016 18:25:54 +0000 (19:25 +0100)]
Fix null pointer dereference on strlen()

If string is NULL, then the proceeding strlen() on the string
will lead to a NULL pointer dereference error (segmentation fault).
Fix this by swapping the order of the comparisons, first check for
a NULL pointer; if that's not true then do the strlen check.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
8 years agoMerge pull request #89 from ColinIanKing/master
Keith Busch [Thu, 2 Jun 2016 18:23:00 +0000 (12:23 -0600)]
Merge pull request #89 from ColinIanKing/master

Fix segmentation fault using nvme show-regs with no device name

8 years agoFix segmentation fault using nvme show-regs with no device name
Colin Ian King [Thu, 2 Jun 2016 18:11:52 +0000 (19:11 +0100)]
Fix segmentation fault using nvme show-regs with no device name

Add check_arg_dev() to check if a device name has been provided
and use this in show_registers to avoid the following segfault:

Segmentation fault (core dumped)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
8 years agoAdd documentation for LightNVMcommands
Matias Bjørling [Thu, 2 Jun 2016 14:17:51 +0000 (16:17 +0200)]
Add documentation for LightNVMcommands

Adds detailed documentation on each of these commands:

 - lnvm-list
 - lnvm-info
 - lnvm-id-ns
 - lnvm-init
 - lnvm-create
 - lnvm-remove
 - lnvm-factory
 - lnvm-diag-bbtbl
 - lnvm-diag-set-bbtbl

8 years agoAdd support for updating the bad block table
Matias Bjørling [Tue, 24 May 2016 15:35:34 +0000 (17:35 +0200)]
Add support for updating the bad block table

Introduce lnvm-diag-set-bbtbl. It takes the channel, lun, plane, block
and the value to update and sends it to the device. Afterwards, the
status can be retrieved with lnvm-diag-get-bbtbl.

8 years agoAdd LightNVM adminstration and diagnose support
Matias Bjørling [Mon, 23 May 2016 12:44:00 +0000 (14:44 +0200)]
Add LightNVM adminstration and diagnose support

Add support for identify geometry, get bad block interface and
administration interface for LightNVM. This patch adds the following
commands:

 - (lnvm-id-ns) Identify geometry of a LightNVM device.
 - (lnvm-diag-bbtbl) Retrieve bad block table from LightNVM device.
 - (lnvm-info) Get information about modules loaded, and available
               devices.
 - (lnvm-init) Initialize LightNVM device with a media manager.
 - (lnvm-create) Create targets on top of registered devices.
 - (lnvm-remove) Remove a registered target.
 - (lnvm-factory) Factory initialize a LightNVM device.

Signed-off-by: Matias Bjørling <m@bjorling.me>
8 years agoMerge pull request #76 from maksim-teqniksoft/add-completion-to-packages
Keith Busch [Wed, 1 Jun 2016 15:07:41 +0000 (09:07 -0600)]
Merge pull request #76 from maksim-teqniksoft/add-completion-to-packages

Install bash autocompletion by default

8 years agoMerge pull request #88 from morbidrsa/for-keith
Keith Busch [Wed, 1 Jun 2016 14:13:20 +0000 (08:13 -0600)]
Merge pull request #88 from morbidrsa/for-keith

bash completion: Remove shebang line

8 years agobash completion: Remove shebang line
Johannes Thumshirn [Wed, 1 Jun 2016 10:12:59 +0000 (12:12 +0200)]
bash completion: Remove shebang line

Remove shebang line from bash completion file as rpmlint on openSUSE/SLE
complains about a script ment to be sourced not executed containing a shebang
line.

[   38s] nvme-cli.x86_64: W: sourced-script-with-shebang /etc/bash_completion.d/nvme /usr/bin/env
[   38s] This text file contains a shebang, but is meant to be sourced, not executed.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
8 years agoRelease v0.7 v0.7
Keith Busch [Mon, 23 May 2016 19:52:45 +0000 (13:52 -0600)]
Release v0.7

Just a few minor updates and documentation fixes. There is also a new
option for passthrough commands that can be used to help detect data
over/under run.

Tagging a stable release so we can consider features that bring in other
transports and third party extensions.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAlign and clear user buffers
Keith Busch [Tue, 17 May 2016 22:59:29 +0000 (16:59 -0600)]
Align and clear user buffers

Avoid the bounce buffers a kernel may allocate by using aligned memory,
and clear the memory in case the user's input doesn't fill the entire
buffer.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAlign passthrough buffers
Keith Busch [Tue, 17 May 2016 17:07:34 +0000 (11:07 -0600)]
Align passthrough buffers

Some versions of the kernel will create bounce buffers instead of using
directly if the user buffer is not aligned.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoFix create-ns man page size option
Keith Busch [Mon, 16 May 2016 16:49:21 +0000 (12:49 -0400)]
Fix create-ns man page size option

It's -s, not -n.

Issue: https://github.com/linux-nvme/nvme-cli/issues/86
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoPre-fill user buffers on passthrough commands
Keith Busch [Sat, 14 May 2016 17:07:53 +0000 (13:07 -0400)]
Pre-fill user buffers on passthrough commands

Reported that user data may be shorter than the buffer length, and need
to pad the data with a fixed byte value.

Also requested that we provied a way to prefill data in buffers so we
can know if a device is corrupting memory.

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoUse correct power scale bits
Keith Busch [Sat, 14 May 2016 16:51:31 +0000 (12:51 -0400)]
Use correct power scale bits

The active and idle power scales occupy the upper 2 bits of their byte
fields. Shift the scales to use these bits when decoding their values.

Issue: https://github.com/linux-nvme/nvme-cli/issues/85
Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoDecode all firmware activate reset codes
Keith Busch [Tue, 10 May 2016 23:59:18 +0000 (17:59 -0600)]
Decode all firmware activate reset codes

Signed-off-by: Keith Busch <keith.busch@intel.com>
8 years agoAdd all error codes from 1.2 spec
Keith Busch [Tue, 10 May 2016 23:46:56 +0000 (17:46 -0600)]
Add all error codes from 1.2 spec

This adds enums and prints for all error codes. Since the names are
getting longer, all the prints have white space code shift to align
the same.

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoMerge pull request #79 from minggr/master
keithbusch [Fri, 22 Apr 2016 21:34:34 +0000 (15:34 -0600)]
Merge pull request #79 from minggr/master

Rename nvme_log() to nvme_get_log()

9 years agoMerge pull request #82 from hrasiq/ppc64-fixes
keithbusch [Fri, 22 Apr 2016 21:32:42 +0000 (15:32 -0600)]
Merge pull request #82 from hrasiq/ppc64-fixes

fix data_size and metadata_size types

9 years agofix data_size and metadata_size types
Heitor Ricardo Alves de Siqueira [Fri, 22 Apr 2016 19:21:33 +0000 (16:21 -0300)]
fix data_size and metadata_size types

The data_size and metadata_size fields in the config struct are declared as
__u32, but should actually be __u64. The current types cause issues in the
argument parsing functions depending on machine architecture and endianness. In
ppc64, using __u32 causes "data size not provided" errors due to the way writes
are being done by argconfig_parse() at src/argconfig.c. Changing the types to
__u64 should fix this behaviour and is in accordance to the CFG_LONG_SUFFIX
flag.

Signed-off-by: Heitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
9 years agoRelease 0.6 v0.6
Keith Busch [Thu, 14 Apr 2016 21:11:41 +0000 (15:11 -0600)]
Release 0.6

Fixes a couple missing namespace parameteters to newer sub-commands,
and various printing updates.

9 years agoMerge pull request #80 from samiWaheed/master
keithbusch [Thu, 14 Apr 2016 17:18:08 +0000 (11:18 -0600)]
Merge pull request #80 from samiWaheed/master

Master

9 years agoFix nsid print in show_error_log
Sami Waheed [Thu, 14 Apr 2016 17:14:42 +0000 (10:14 -0700)]
Fix nsid print in show_error_log

nsid in error log page could be set to 0xffffffff and should be printed
as unsigned instead of int

9 years agoRename nvme_log() to nvme_get_log()
Ming Lin [Fri, 8 Apr 2016 06:18:09 +0000 (23:18 -0700)]
Rename nvme_log() to nvme_get_log()

This kills off the old nvme_get_log() and rename
nvme_log() to nvme_get_log().

Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
9 years agoUse nsid parameter for security commands
Keith Busch [Thu, 7 Apr 2016 16:13:25 +0000 (10:13 -0600)]
Use nsid parameter for security commands

Controllers optionally may use nsid.

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoMerge pull request #75 from asciiprod/debian-fixes
keithbusch [Wed, 6 Apr 2016 16:56:50 +0000 (10:56 -0600)]
Merge pull request #75 from asciiprod/debian-fixes

sync with actual debian package

9 years agoFix namespace attachment
Keith Busch [Tue, 29 Mar 2016 19:49:47 +0000 (13:49 -0600)]
Fix namespace attachment

The nsid was dropped from the command.

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoCode reuse: Namespace identification
Keith Busch [Tue, 29 Mar 2016 18:16:30 +0000 (12:16 -0600)]
Code reuse: Namespace identification

Combining common code into single function.

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoUse enum instead of hard-coded values
Keith Busch [Fri, 18 Mar 2016 17:57:02 +0000 (11:57 -0600)]
Use enum instead of hard-coded values

Define constants to make clear what a device is doing.

Noticing that one identify mode was never used, so adding an option.

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoNamespace attach controller list endian fix
Keith Busch [Fri, 18 Mar 2016 16:59:56 +0000 (10:59 -0600)]
Namespace attach controller list endian fix

Convert for host endian.

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoCode reuse: parsing options and arguments
Keith Busch [Fri, 18 Mar 2016 15:32:04 +0000 (09:32 -0600)]
Code reuse: parsing options and arguments

A common code pattern is to parse the options, then open the first
non-option argument as the device parameter.

This patch combines that pattern in a reusable single function. The
savings is not significant, but every little bit helps.

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoCode reuse: character device check
Keith Busch [Fri, 18 Mar 2016 14:52:06 +0000 (08:52 -0600)]
Code reuse: character device check

Moving character device sanity check to common function to reduce
duplication.

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoMerge pull request #77 from seehearfeel/master
keithbusch [Mon, 28 Mar 2016 13:41:08 +0000 (07:41 -0600)]
Merge pull request #77 from seehearfeel/master

Fix the bug of Model Number and display the info of Serial Number

9 years agoFix the bug of Model Number and display the info of Serial Number
seehearfeel [Sat, 26 Mar 2016 13:14:43 +0000 (21:14 +0800)]
Fix the bug of Model Number and display the info of Serial Number

OK, I see, thanks for your suggestion.

I have modified the related code of Serial Number, Model Number and Firmware Revision,
other fields are not be changed because the length can not be properly figured out by
the print format specifier, (int)sizeof(field) is too big and (int)strlen(field) is random.
In addition, fix a minor spelling mistake "Namepace" to "Namespace".

Please review, thanks!

9 years agoFix the bug of Model Number and display the info of Serial Number
seehearfeel [Tue, 22 Mar 2016 11:23:15 +0000 (19:23 +0800)]
Fix the bug of Model Number and display the info of Serial Number

According to the NVMe Specification, there is an error when display Model Number.
In addition, currently it does not display the info of Serial Number, so add it.

9 years agoInstall bash autocompletion by default
Maksim Salau [Sat, 19 Mar 2016 20:08:24 +0000 (23:08 +0300)]
Install bash autocompletion by default

9 years agosync with actual debian package
Markus Schade [Fri, 18 Mar 2016 10:27:49 +0000 (11:27 +0100)]
sync with actual debian package
drop all patches as they have all been fixed upstream

9 years agoRelease v0.5 v0.5
Keith Busch [Thu, 17 Mar 2016 23:33:48 +0000 (17:33 -0600)]
Release v0.5

The v0.4 breakage should all be resolved now. Tagging release v0.5,
and back to stability.

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoAdd reset and subsystem reset commands
Keith Busch [Thu, 17 Mar 2016 22:30:26 +0000 (16:30 -0600)]
Add reset and subsystem reset commands

Signed-off-by: Keith Busch <keith.busch@intel.com>
9 years agoPrint format consistency
Keith Busch [Thu, 17 Mar 2016 21:40:49 +0000 (15:40 -0600)]
Print format consistency

Use same format for both get and set features when displaying results.

Signed-off-by: Keith Busch <keith.busch@intel.com>