]> www.infradead.org Git - users/hch/nvme-cli.git/log
users/hch/nvme-cli.git
7 years agonvme-cli: telemetry-log add controller initiated log gathering
Scott Bauer [Mon, 5 Feb 2018 21:26:23 +0000 (14:26 -0700)]
nvme-cli: telemetry-log add controller initiated log gathering

If the controller has a controller initiated log (0x8) available,
we can now retrieve it.

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agoMerge pull request #297 from minwooim/v1.6/iekey_to_no_argu
Keith Busch [Mon, 5 Feb 2018 21:11:33 +0000 (14:11 -0700)]
Merge pull request #297 from minwooim/v1.6/iekey_to_no_argu

nvme-cli: convert iekey into a no_argument parameter

7 years agoMerge branch 'master' into v1.6/iekey_to_no_argu
Keith Busch [Mon, 5 Feb 2018 21:11:21 +0000 (14:11 -0700)]
Merge branch 'master' into v1.6/iekey_to_no_argu

7 years agoMerge pull request #296 from minwooim/v1.6/return_neg_val_get_nsid
Keith Busch [Mon, 5 Feb 2018 21:09:49 +0000 (14:09 -0700)]
Merge pull request #296 from minwooim/v1.6/return_neg_val_get_nsid

nvme-cli: make return negative value in nvme_get_nsid() when not blkdev

7 years agoMerge pull request #295 from minwooim/v1.6/update_doc
Keith Busch [Mon, 5 Feb 2018 21:08:57 +0000 (14:08 -0700)]
Merge pull request #295 from minwooim/v1.6/update_doc

nvme-cli: update documentations to sync up with subcommands

7 years agoMerge pull request #294 from minwooim/v1.6/move_print_to_nvme_print
Keith Busch [Mon, 5 Feb 2018 21:08:40 +0000 (14:08 -0700)]
Merge pull request #294 from minwooim/v1.6/move_print_to_nvme_print

nvme-cli: move print-function to nvme-print

7 years agoMerge pull request #293 from minwooim/v1.6/fix_leaks_in_commands
Keith Busch [Mon, 5 Feb 2018 21:08:04 +0000 (14:08 -0700)]
Merge pull request #293 from minwooim/v1.6/fix_leaks_in_commands

nvme-cli: fix leaks in subcommands

7 years agoMerge pull request #292 from minwooim/v1.6/add_print_cname_effects_log
Keith Busch [Mon, 5 Feb 2018 21:07:12 +0000 (14:07 -0700)]
Merge pull request #292 from minwooim/v1.6/add_print_cname_effects_log

nvme-cli: add print for command name to effects-log

7 years agoMerge pull request #291 from minwooim/v1.6/bpid_cdw10_fw_commit
Keith Busch [Mon, 5 Feb 2018 21:06:02 +0000 (14:06 -0700)]
Merge pull request #291 from minwooim/v1.6/bpid_cdw10_fw_commit

nvme-cli: make it have bpid in cdw10 for fw-commit

7 years agoMerge pull request #290 from minwooim/v1.6/add_cs_field_to_json_error_log
Keith Busch [Mon, 5 Feb 2018 21:04:23 +0000 (14:04 -0700)]
Merge pull request #290 from minwooim/v1.6/add_cs_field_to_json_error_log

nvme-cli: add command specific field to json output of error-log

7 years agoflush: Use device NSID if issuing through block device
Keith Busch [Mon, 5 Feb 2018 20:19:40 +0000 (13:19 -0700)]
flush: Use device NSID if issuing through block device

Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agoNVMe-CLI Fix fw_log Command json output
Jeff Lien [Mon, 5 Feb 2018 16:35:59 +0000 (10:35 -0600)]
NVMe-CLI Fix fw_log Command json output

Currently, the json output for the fw_log command slot number
is zero based while the normal output is one based.  This patch
will change the json output to one based.  It will also only
print the revisions for the valid slots.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
[fixed whitespace formatting]
Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agoMerge pull request #303 from pborzenkov/intel-smart
Keith Busch [Mon, 5 Feb 2018 16:14:54 +0000 (09:14 -0700)]
Merge pull request #303 from pborzenkov/intel-smart

nvme-cli: fix typo in Intel SMART json output

7 years agonvme-cli: fix typo in Intel SMART json output
Pavel Borzenkov [Mon, 5 Feb 2018 11:22:06 +0000 (14:22 +0300)]
nvme-cli: fix typo in Intel SMART json output

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
7 years agonvme-cli: update documentations to sync up with subcommands
Minwoo Im [Tue, 30 Jan 2018 10:36:49 +0000 (19:36 +0900)]
nvme-cli: update documentations to sync up with subcommands

Update all documentations to sync up with built-in plugin subcommands.
Not only options supported by subcommands, But few descriptions have not
been updated with implementations.

Sync-up documentation with subcommands implementations.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: convert iekey into a no_argument parameter
Minwoo Im [Tue, 30 Jan 2018 10:11:42 +0000 (19:11 +0900)]
nvme-cli: convert iekey into a no_argument parameter

IEKEY(Ignore Existing Key) option is used widely in Reservation Acquire,
Reservation Register, and Reservation Release in a type of bool(1-bit).

Only resv_release() uses iekey field as a required_argument parameter.
It seems unnecessary because it will not be checked if this parameter
is given or not by a following condition because default value is 0.

        if (cfg.iekey > 1)

So remove unnecessary if-statement and convert this field to a
no_argument type option.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: make return negative value in nvme_get_nsid() when not blkdev
Minwoo Im [Tue, 30 Jan 2018 10:10:27 +0000 (19:10 +0900)]
nvme-cli: make return negative value in nvme_get_nsid() when not blkdev

If caller invokes get_nsid() with character device without checking
whether a given device is block device or not, ENOTBLK is returned from
nvme_get_nsid() which is a positive value, so that caller may treat this
value as a valid nsid.

Make it return a negative vaelue with -ENOTBLK and add error checking to
callers.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: move print-function to nvme-print
Minwoo Im [Fri, 26 Jan 2018 15:36:19 +0000 (00:36 +0900)]
nvme-cli: move print-function to nvme-print

Code clean-up by moving print-functions for list and list-subsys
commands to nvme-print.c with no functional changes.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix leaks in subcommands
Minwoo Im [Fri, 26 Jan 2018 15:36:01 +0000 (00:36 +0900)]
nvme-cli: fix leaks in subcommands

Fix leaks(a single memory leak, file descriptors leaks) in subcommands
by adding explicit close for opened things.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: add print for command name to effects-log
Minwoo Im [Fri, 26 Jan 2018 15:35:44 +0000 (00:35 +0900)]
nvme-cli: add print for command name to effects-log

Commands Supported and Effects log page describes commands supported and
effects of commands. It would be better if command names are printed out
with their opcodes.

So, Add the command names following NVMe 1.3a specification to
effects-log command to both normal mode and json mode.

Example of commands output
========
Admin Command Set
ACS0     [Delete I/O Submission Queue     ] 00000001
ACS1     [Create I/O Submission Queue     ] 00000001
ACS2     [Get Log Page                    ] 00000001
ACS4     [Delete I/O Completion Queue     ] 00000001
ACS5     [Create I/O Completion Queue     ] 00000001
ACS6     [Identify                        ] 00000001
ACS8     [Abort                           ] 00000001
ACS9     [Set Features                    ] 00000001
ACS10    [Get Features                    ] 00000001
ACS12    [Asynchronous Event Request      ] 00000001
ACS16    [Firmware Commit                 ] 00000001
ACS17    [Firmware Image Download         ] 00000001
ACS128   [Format NVM                      ] 00020003
ACS129   [Security Send                   ] 00020003
ACS130   [Security Receive                ] 00010001

NVM Command Set
IOCS0    [Flush                           ] 00010001
IOCS1    [Write                           ] 00000003
IOCS2    [Read                            ] 00000001
IOCS4    [Write Uncorrectable             ] 00000003
IOCS5    [Compare                         ] 00000001
IOCS8    [Write Zeroes                    ] 00000003
IOCS9    [Dataset Management              ] 00010003
=======

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: make it have bpid in cdw10 for fw-commit
Minwoo Im [Tue, 30 Jan 2018 09:56:46 +0000 (18:56 +0900)]
nvme-cli: make it have bpid in cdw10 for fw-commit

_bpid_ was added as a parameter in commit d52c9988 without any being
used.
Make it have inside of cdw10 before submitting a command.

Fixes: d52c9988 ("nvme-cli: update Firmware Commit with boot partition
feature")
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: add command specific field to json output of error-log
Minwoo Im [Tue, 30 Jan 2018 09:55:27 +0000 (18:55 +0900)]
nvme-cli: add command specific field to json output of error-log

Add command specific field to json output of error-log command.
This field was added in commit 662c1618 without considering json output
format.

Fixes: 662c1618("nvme-cli: add print for command specific info field of
error log page")
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agoMerge pull request #289 from tim-oleksii/master
Keith Busch [Mon, 29 Jan 2018 16:13:31 +0000 (09:13 -0700)]
Merge pull request #289 from tim-oleksii/master

nvme-cli: Fixed incosistency of error handling in intel plugin

7 years agonvme-cli: Fixed incosistency of error handling in intel plugin
Oleksii Timofieiev [Mon, 29 Jan 2018 16:10:04 +0000 (19:10 +0300)]
nvme-cli: Fixed incosistency of error handling in intel plugin
Signed-off-by: Oleksii Timofieiev <tim.oleksii@gmail.com>
7 years agoUse '-' for compounded word telemetry-log subcommand
Keith Busch [Thu, 25 Jan 2018 17:31:55 +0000 (10:31 -0700)]
Use '-' for compounded word telemetry-log subcommand

Just for consistency.

Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agoUse NSID all for error log
Keith Busch [Thu, 25 Jan 2018 17:29:39 +0000 (10:29 -0700)]
Use NSID all for error log

At least some controllers return error if using 0 for the namespace. This
is essentially reverting to the previous behavior before 3ec5ae78c.

Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agonvme-cli: Implement nvme_get_log13
Scott Bauer [Mon, 22 Jan 2018 20:35:34 +0000 (13:35 -0700)]
nvme-cli: Implement nvme_get_log13

This fixes a portion of 722c71bb:
nvme/vendor: Add get log LSP/LSO fields from 1.3 spec

This fixes up the code so it can use the same interface
log we've had for awhile. People who wish to pass log
specific parameters can use the new API.

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agoMerge pull request #286 from tim-oleksii/master
Keith Busch [Wed, 24 Jan 2018 17:28:36 +0000 (10:28 -0700)]
Merge pull request #286 from tim-oleksii/master

nvme-cli: wdc: Removed superfluous output in WDC plugin

7 years agonvme-cli: handle long commands in help message by adjusting minimal padding
Oleksii Timofieiev [Wed, 24 Jan 2018 10:49:13 +0000 (13:49 +0300)]
nvme-cli: handle long commands in help message by adjusting minimal padding
Signed-off-by: Oleksii Timofieiev <tim.oleksii@gmail.com>
7 years agonvme-cli: wdc: Removed superfluous output in WDC plugin
Oleksii Timofieiev [Tue, 23 Jan 2018 10:16:22 +0000 (13:16 +0300)]
nvme-cli: wdc: Removed superfluous output in WDC plugin

Signed-off-by: Oleksii Timofieiev <tim.oleksii@gmail.com>
7 years agoMerge pull request #283 from tim-oleksii/master
Keith Busch [Mon, 22 Jan 2018 18:40:40 +0000 (11:40 -0700)]
Merge pull request #283 from tim-oleksii/master

nvme-cli: Add support of unsigned long long to json routines

7 years agoNVMe-CLI WDC-Plugin Update drive essentials code with review comments.
Jeff Lien [Fri, 19 Jan 2018 18:00:53 +0000 (12:00 -0600)]
NVMe-CLI WDC-Plugin Update drive essentials code with review comments.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
7 years agonvme-cli: Add support of unsigned long long to json routines
Oleksii Timofieiev [Sat, 20 Jan 2018 10:34:44 +0000 (13:34 +0300)]
nvme-cli: Add support of unsigned long long to json routines
Signed-off-by: Oleksii Timofieiev <tim.oleksii@gmail.com>
7 years agoMerge pull request #279 from minwooim/for-1.6
Keith Busch [Fri, 19 Jan 2018 02:54:34 +0000 (19:54 -0700)]
Merge pull request #279 from minwooim/for-1.6

nvme-cli: memblaze: update memblaze plugin

7 years agoNVMe-CLI WDC-Plugin Add clear-pcie-corr documentation.
Jeff Lien [Thu, 18 Jan 2018 21:01:38 +0000 (15:01 -0600)]
NVMe-CLI WDC-Plugin Add clear-pcie-corr documentation.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
7 years agoNVMe-CLI WDC-Plugin Add clear-pcie-corr command
Jeff Lien [Thu, 18 Jan 2018 21:01:00 +0000 (15:01 -0600)]
NVMe-CLI WDC-Plugin Add clear-pcie-corr command

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
[Merged to account for recent API changes]
Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agoNVMe-CLI WDC-Plugin Add drive-essentials documentation
Jeff Lien [Thu, 18 Jan 2018 19:22:22 +0000 (13:22 -0600)]
NVMe-CLI WDC-Plugin Add drive-essentials documentation

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
7 years agoNVMe-CLI WDC-Plugin Add drive-essentials command
Jeff Lien [Thu, 18 Jan 2018 19:21:38 +0000 (13:21 -0600)]
NVMe-CLI WDC-Plugin Add drive-essentials command

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
7 years agoMerge branch 'v1.6/update_memblaze' of https://github.com/minwooim/nvme-cli into...
Minwoo Im [Fri, 19 Jan 2018 00:25:19 +0000 (09:25 +0900)]
Merge branch 'v1.6/update_memblaze' of https://github.com/minwooim/nvme-cli into for-1.6

7 years agonvme-cli: memblaze: add error return after parse_and_open()
Minwoo Im [Thu, 18 Jan 2018 09:16:31 +0000 (18:16 +0900)]
nvme-cli: memblaze: add error return after parse_and_open()

Add returning error when it fails.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: memblaze: fix memory leak in memblaze-nvme.c
Minwoo Im [Thu, 18 Jan 2018 09:12:58 +0000 (18:12 +0900)]
nvme-cli: memblaze: fix memory leak in memblaze-nvme.c

Once _buf_ is allocted by posix_memalign(), all return statement
should check if _buf_ is allocated and, if so, free it.

Make it jump to free: to free _buf_ if allocted.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agoMerge pull request #276 from minwooim/v1.6/update_wdc
Keith Busch [Thu, 18 Jan 2018 08:41:27 +0000 (01:41 -0700)]
Merge pull request #276 from minwooim/v1.6/update_wdc

nvme-cli: wdc: update wdc plugin

7 years agoMerge pull request #275 from minwooim/v1.6/fix_memory_leak
Keith Busch [Thu, 18 Jan 2018 08:40:49 +0000 (01:40 -0700)]
Merge pull request #275 from minwooim/v1.6/fix_memory_leak

nvme-cli: fix memory leak in nvme.c

7 years agoMerge pull request #274 from minwooim/v1.6/handle_error_for_malloc
Keith Busch [Thu, 18 Jan 2018 08:39:31 +0000 (01:39 -0700)]
Merge pull request #274 from minwooim/v1.6/handle_error_for_malloc

nvme-cli: add error handling for a failure of malloc

7 years agoMerge pull request #278 from ScottyBauer/implement_telemetry3
Keith Busch [Thu, 18 Jan 2018 02:24:33 +0000 (19:24 -0700)]
Merge pull request #278 from ScottyBauer/implement_telemetry3

nvme-cli: Implement get_telemetry_log from 1.3 spec

7 years agoMerge pull request #277 from minwooim/v1.6/update_lnvm
Keith Busch [Thu, 18 Jan 2018 02:01:41 +0000 (19:01 -0700)]
Merge pull request #277 from minwooim/v1.6/update_lnvm

nvme-cli: lnvm: Make it return error status when argconfig_parse fails

7 years agonvme/vendor: Add get log LSP/LSO fields from 1.3 spec
Scott Bauer [Tue, 16 Jan 2018 17:46:50 +0000 (10:46 -0700)]
nvme/vendor: Add get log LSP/LSO fields from 1.3 spec

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
[Fixed param descriptions and short opt]
Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agonvme-cli: Implement get_telemetry_log from 1.3 spec
Scott Bauer [Wed, 17 Jan 2018 17:39:20 +0000 (10:39 -0700)]
nvme-cli: Implement get_telemetry_log from 1.3 spec

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
7 years agonvme-cli: lnvm: Make it return error status when argconfig_parse fails
Minwoo Im [Wed, 17 Jan 2018 15:26:16 +0000 (00:26 +0900)]
nvme-cli: lnvm: Make it return error status when argconfig_parse fails

The return value of argconfig_parse() should be returned if it fails.
Make lnvm commands return when it fails.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix memory leak in passthru()
Minwoo Im [Wed, 17 Jan 2018 12:28:56 +0000 (21:28 +0900)]
nvme-cli: fix memory leak in passthru()

If _metadata_ is allocated with metadata_len in fail case of
posix_memalign() for _data_, it should be freed properly.

Add freeing _metadata_ if _data_ is failed to be allocated.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: wdc: fix mismatch in document for smart-add-log
Minwoo Im [Wed, 17 Jan 2018 11:49:41 +0000 (20:49 +0900)]
nvme-cli: wdc: fix mismatch in document for smart-add-log

Fix mistype in document for smart-add-log in _wdc_ plugin.
Human readable output mode is nor supported by this command.

Replace it with normal.

Reported in github issue #270.

Reported-by: Oleksii Timofieiev <tim.oleksii@gmail.com>
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: wdc: add const to descriptions
Minwoo Im [Wed, 17 Jan 2018 11:42:43 +0000 (20:42 +0900)]
nvme-cli: wdc: add const to descriptions

Add const to descriptions.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix memory leak in dir_receive()
Minwoo Im [Wed, 17 Jan 2018 11:29:41 +0000 (20:29 +0900)]
nvme-cli: fix memory leak in dir_receive()

Fix memory leak for _buf_.

==10014== HEAP SUMMARY:
==10014==     in use at exit: 16 bytes in 1 blocks
==10014==   total heap usage: 52 allocs, 51 frees, 15,638 bytes
allocated
==10014==
==10014== Searching for pointers to 1 not-freed blocks
==10014== Checked 70,656 bytes
==10014==
==10014== 16 bytes in 1 blocks are definitely lost in loss record 1 of 1
==10014==    at 0x4C2FFC6: memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10014==    by 0x4C300D1: posix_memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10014==    by 0x402733: dir_receive (nvme.c:3531)
==10014==    by 0x4192A7: handle_plugin (plugin.c:150)
==10014==    by 0x401890: main (nvme.c:3825)
==10014==
==10014== LEAK SUMMARY:
==10014==    definitely lost: 16 bytes in 1 blocks
==10014==    indirectly lost: 0 bytes in 0 blocks
==10014==      possibly lost: 0 bytes in 0 blocks
==10014==    still reachable: 0 bytes in 0 blocks
==10014==         suppressed: 0 bytes in 0 blocks
==10014==
==10014== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix memory leak in sec_recv()
Minwoo Im [Wed, 17 Jan 2018 11:26:37 +0000 (20:26 +0900)]
nvme-cli: fix memory leak in sec_recv()

Fix memory leak for _sec_buf_.

==7670== HEAP SUMMARY:
==7670==     in use at exit: 4,096 bytes in 1 blocks
==7670==   total heap usage: 31 allocs, 30 frees, 8,046 bytes allocated
==7670==
==7670== Searching for pointers to 1 not-freed blocks
==7670== Checked 70,656 bytes
==7670==
==7670== 4,096 bytes in 1 blocks are definitely lost in loss record 1 of
1
==7670==    at 0x4C2FFC6: memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7670==    by 0x4C300D1: posix_memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7670==    by 0x4056F3: sec_recv (nvme.c:3391)
==7670==    by 0x419587: handle_plugin (plugin.c:150)
==7670==    by 0x401890: main (nvme.c:3799)
==7670==
==7670== LEAK SUMMARY:
==7670==    definitely lost: 4,096 bytes in 1 blocks
==7670==    indirectly lost: 0 bytes in 0 blocks
==7670==      possibly lost: 0 bytes in 0 blocks
==7670==    still reachable: 0 bytes in 0 blocks
==7670==         suppressed: 0 bytes in 0 blocks
==7670==
==7670== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix memory leak in dir_send()
Minwoo Im [Wed, 17 Jan 2018 11:25:14 +0000 (20:25 +0900)]
nvme-cli: fix memory leak in dir_send()

Fix memory leak for _buf_.

==9566== HEAP SUMMARY:
==9566==     in use at exit: 1,024 bytes in 1 blocks
==9566==   total heap usage: 52 allocs, 51 frees, 16,681 bytes allocated
==9566==
==9566== Searching for pointers to 1 not-freed blocks
==9566== Checked 70,656 bytes
==9566==
==9566== 1,024 bytes in 1 blocks are definitely lost in loss record 1 of
1
==9566==    at 0x4C2FFC6: memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9566==    by 0x4C300D1: posix_memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9566==    by 0x402174: dir_send (nvme.c:2535)
==9566==    by 0x419317: handle_plugin (plugin.c:150)
==9566==    by 0x401890: main (nvme.c:3818)
==9566==
==9566== LEAK SUMMARY:
==9566==    definitely lost: 1,024 bytes in 1 blocks
==9566==    indirectly lost: 0 bytes in 0 blocks
==9566==      possibly lost: 0 bytes in 0 blocks
==9566==    still reachable: 0 bytes in 0 blocks
==9566==         suppressed: 0 bytes in 0 blocks
==9566==
==9566== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix memory leak in sec_send()
Minwoo Im [Wed, 17 Jan 2018 11:18:29 +0000 (20:18 +0900)]
nvme-cli: fix memory leak in sec_send()

Fix memory leak for _sec_buf_.

==9303== HEAP SUMMARY:
==9303==     in use at exit: 0 bytes in 1 blocks
==9303==   total heap usage: 31 allocs, 30 frees, 3,915 bytes allocated
==9303==
==9303== Searching for pointers to 1 not-freed blocks
==9303== Checked 70,664 bytes
==9303==
==9303== 0 bytes in 1 blocks are definitely lost in loss record 1 of 1
==9303==    at 0x4C2FFC6: memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9303==    by 0x4C300D1: posix_memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9303==    by 0x405A4C: sec_send (nvme.c:2415)
==9303==    by 0x419527: handle_plugin (plugin.c:150)
==9303==    by 0x401890: main (nvme.c:3812)
==9303==
==9303== LEAK SUMMARY:
==9303==    definitely lost: 0 bytes in 1 blocks
==9303==    indirectly lost: 0 bytes in 0 blocks
==9303==      possibly lost: 0 bytes in 0 blocks
==9303==    still reachable: 0 bytes in 0 blocks
==9303==         suppressed: 0 bytes in 0 blocks
==9303==
==9303== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix memory leak in set_feature()
Minwoo Im [Wed, 17 Jan 2018 11:15:17 +0000 (20:15 +0900)]
nvme-cli: fix memory leak in set_feature()

Fix memory leak for _buf_.

==9183== HEAP SUMMARY:
==9183==     in use at exit: 1,024 bytes in 1 blocks
==9183==   total heap usage: 52 allocs, 51 frees, 16,576 bytes allocated
==9183==
==9183== Searching for pointers to 1 not-freed blocks
==9183== Checked 70,688 bytes
==9183==
==9183== 1,024 bytes in 1 blocks are definitely lost in loss record 1 of 1
==9183==    at 0x4C2FFC6: memalign (in
                          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9183==    by 0x4C300D1: posix_memalign (in
                          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9183==    by 0x407721: set_feature (nvme.c:2305)
==9183==    by 0x419407: handle_plugin (plugin.c:150)
==9183==    by 0x401890: main (nvme.c:3813)
==9183==
==9183== LEAK SUMMARY:
==9183==    definitely lost: 1,024 bytes in 1 blocks
==9183==    indirectly lost: 0 bytes in 0 blocks
==9183==      possibly lost: 0 bytes in 0 blocks
==9183==    still reachable: 0 bytes in 0 blocks
==9183==         suppressed: 0 bytes in 0 blocks
==9183==
==9183== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix memory leak in fw_download()
Minwoo Im [Wed, 17 Jan 2018 11:08:24 +0000 (20:08 +0900)]
nvme-cli: fix memory leak in fw_download()

Fix memory leak for _fw_buf_ without any free.

==8786== HEAP SUMMARY:
==8786==     in use at exit: 0 bytes in 1 blocks
==8786==   total heap usage: 31 allocs, 30 frees, 3,810 bytes allocated
==8786==
==8786== Searching for pointers to 1 not-freed blocks
==8786== Checked 70,664 bytes
==8786==
==8786== 0 bytes in 1 blocks are definitely lost in loss record 1 of 1
==8786==    at 0x4C2FFC6: memalign (in
                           /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8786==    by 0x4C300D1: posix_memalign (in
                           /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8786==    by 0x406963: fw_download (nvme.c:1767)
==8786==    by 0x419407: handle_plugin (plugin.c:150)
==8786==    by 0x401890: main (nvme.c:3810)
==8786==
==8786== LEAK SUMMARY:
==8786==    definitely lost: 0 bytes in 1 blocks
==8786==    indirectly lost: 0 bytes in 0 blocks
==8786==      possibly lost: 0 bytes in 0 blocks
==8786==    still reachable: 0 bytes in 0 blocks
==8786==         suppressed: 0 bytes in 0 blocks
==8786==
==8786== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix memory leak in ns_descs()
Minwoo Im [Wed, 17 Jan 2018 11:01:57 +0000 (20:01 +0900)]
nvme-cli: fix memory leak in ns_descs()

Memory has been allocated before parsing command options by
parse_and_open() and validate_output_format().
Make it after the setup of options.

_nsdescs_ changes to (void *) for usability.

_nsdescs_ has been allocated without any free.
Add free statement for _nsdescs_. Please refer below memory leak.

==8533== HEAP SUMMARY:
==8533==     in use at exit: 4,096 bytes in 1 blocks
==8533==   total heap usage: 31 allocs, 30 frees, 7,906 bytes allocated
==8533==
==8533== Searching for pointers to 1 not-freed blocks
==8533== Checked 70,624 bytes
==8533==
==8533== 4,096 bytes in 1 blocks are definitely lost in loss record 1 of 1
==8533==    at 0x4C2FFC6: memalign (in
                           /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8533==    by 0x4C300D1: posix_memalign (in
                           /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8533==    by 0x409D2D: ns_descs (nvme.c:1466)
==8533==    by 0x419567: handle_plugin (plugin.c:150)
==8533==    by 0x401890: main (nvme.c:3803)
==8533==
==8533== LEAK SUMMARY:
==8533==    definitely lost: 4,096 bytes in 1 blocks
==8533==    indirectly lost: 0 bytes in 0 blocks
==8533==      possibly lost: 0 bytes in 0 blocks
==8533==    still reachable: 0 bytes in 0 blocks
==8533==         suppressed: 0 bytes in 0 blocks
==8533==
==8533== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: fix memory leak in list_ctrl()
Minwoo Im [Wed, 17 Jan 2018 10:46:12 +0000 (19:46 +0900)]
nvme-cli: fix memory leak in list_ctrl()

Fix memory leak of _cntlist_ cause a memory leak below.

==7724== HEAP SUMMARY:
==7724==     in use at exit: 4,096 bytes in 1 blocks
==7724==   total heap usage: 31 allocs, 30 frees, 7,871 bytes allocated
==7724==
==7724== Searching for pointers to 1 not-freed blocks
==7724== Checked 70,624 bytes
==7724==
==7724== 4,096 bytes in 1 blocks are definitely lost in loss record 1 of 1
==7724==    at 0x4C2FFC6: memalign (in
                          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7724==    by 0x4C300D1: posix_memalign (in
                          /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7724==    by 0x408354: list_ctrl (nvme.c:573)
==7724==    by 0x419587: handle_plugin (plugin.c:150)
==7724==    by 0x401890: main (nvme.c:3799)
==7724==
==7724== LEAK SUMMARY:
==7724==    definitely lost: 4,096 bytes in 1 blocks
==7724==    indirectly lost: 0 bytes in 0 blocks
==7724==      possibly lost: 0 bytes in 0 blocks
==7724==    still reachable: 0 bytes in 0 blocks
==7724==         suppressed: 0 bytes in 0 blocks

==7724== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: add error handling for a failure of malloc
Minwoo Im [Wed, 17 Jan 2018 10:24:19 +0000 (19:24 +0900)]
nvme-cli: add error handling for a failure of malloc

Make it return ENOMEM when malloc of metadat is failed with some error
message.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agoMerge pull request #268 from minwooim/v1.6/fix_typo_in_get_feature_test
Keith Busch [Mon, 15 Jan 2018 08:18:48 +0000 (01:18 -0700)]
Merge pull request #268 from minwooim/v1.6/fix_typo_in_get_feature_test

nvme-cli: tests: fix typo in get_feature_test

7 years agonvme-cli: tests: fix typo in get_feature_test
Minwoo Im [Sun, 14 Jan 2018 08:37:25 +0000 (17:37 +0900)]
nvme-cli: tests: fix typo in get_feature_test

Comment and function name typo will directly reflect document which
will be generated by Makefile.

Fix typos like below.
    1. Typo in feature lists in the global comment.
    2. Mandetory -> Mandatory

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agoMerge pull request #262 from minwooim/v1.6/intel_smart_log_add
Keith Busch [Sun, 14 Jan 2018 01:37:05 +0000 (18:37 -0700)]
Merge pull request #262 from minwooim/v1.6/intel_smart_log_add

nvme-cli: intel: fix smart-log-add documentation

7 years agoMerge pull request #263 from minwooim/v1.6/intel_add_return_fd
Keith Busch [Sun, 14 Jan 2018 01:36:32 +0000 (18:36 -0700)]
Merge pull request #263 from minwooim/v1.6/intel_add_return_fd

nvme-cli: intel: add check for fd after open to intel commands

7 years agoMerge pull request #264 from minwooim/v1.6/intel_add_const_to_desc
Keith Busch [Sun, 14 Jan 2018 01:36:10 +0000 (18:36 -0700)]
Merge pull request #264 from minwooim/v1.6/intel_add_const_to_desc

nvme-cli: intel: add const to descriptions of subcommand option

7 years agoMerge pull request #266 from minwooim/v1.6/effects_log_update
Keith Busch [Sun, 14 Jan 2018 01:35:40 +0000 (18:35 -0700)]
Merge pull request #266 from minwooim/v1.6/effects_log_update

nvme-cli: add support for options to effect-log subcommand

7 years agoMerge pull request #267 from minwooim/v1.6/remove_nsid_in_error_log
Keith Busch [Sun, 14 Jan 2018 01:34:38 +0000 (18:34 -0700)]
Merge pull request #267 from minwooim/v1.6/remove_nsid_in_error_log

nvme-cli: tests: remove nsid parameter in a testcase of error-log

7 years agoMerge pull request #261 from javigon/master
Keith Busch [Sun, 14 Jan 2018 01:22:24 +0000 (18:22 -0700)]
Merge pull request #261 from javigon/master

lightnvm: enable to set OP on target creation

7 years agonvme-cli: tests: remove nsid parameter in a testcase of error-log
Minwoo Im [Sat, 13 Jan 2018 17:03:06 +0000 (02:03 +0900)]
nvme-cli: tests: remove nsid parameter in a testcase of error-log

Remove nsid parameter in a testcase of error-log subcommand.

This parameter has been removed by a commit 98ffd4b on the master branch
of linux-nvme/nvme-cli.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: update documentation of effects-log
Minwoo Im [Sat, 13 Jan 2018 12:22:53 +0000 (21:22 +0900)]
nvme-cli: update documentation of effects-log

Update documentation of effects-log subcommand with descriptions of
option. Also add an example of --raw-binary option to the document.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: add support for options to effects-log subcommand
Minwoo Im [Sat, 13 Jan 2018 12:20:52 +0000 (21:20 +0900)]
nvme-cli: add support for options to effects-log subcommand

Add support for options below to to effects-log subcommand.
    --output-format=<fmt>, -o <fmt>    normal|json|binary
    --human-readable, -H
    --raw-binary, -b

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: intel: add const to descriptions of subcommand option
Minwoo Im [Fri, 12 Jan 2018 13:27:17 +0000 (22:27 +0900)]
nvme-cli: intel: add const to descriptions of subcommand option

Add const to descriptions of subcommand option.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: intel: add check for fd after open to intel commands
Minwoo Im [Fri, 12 Jan 2018 13:21:06 +0000 (22:21 +0900)]
nvme-cli: intel: add check for fd after open to intel commands

Make it return negative error value when file open is failed to intel
commands.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: intel: fix smart-log-add documentation
Minwoo Im [Fri, 12 Jan 2018 13:10:26 +0000 (22:10 +0900)]
nvme-cli: intel: fix smart-log-add documentation

tim-oleksii has reported that intel smart-log-add help differs from man
page.

Update man, html, and txt documentation to follow output of below
command.
    ./nvme intel smart-log-add

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agolightnvm: enable to set OP on target creation
Javier González [Mon, 30 Oct 2017 13:01:07 +0000 (14:01 +0100)]
lightnvm: enable to set OP on target creation

On target creation, allow to define the over-provision (OP). Since OP
area has a direct impact on write amplification, users can optimize the
OCSSD behavior for their workloads.

Support in the kernel has been upstreamed in 4.16

Signed-off-by: Javier González <javier@cnexlabs.com>
7 years agoMerge pull request #259 from minwooim/v1.6/intel_smart_log_add_doc_update
Keith Busch [Thu, 11 Jan 2018 21:42:12 +0000 (14:42 -0700)]
Merge pull request #259 from minwooim/v1.6/intel_smart_log_add_doc_update

nvme-cli: intel: update smart-log-add command documentation

7 years agoMerge pull request #258 from minwooim/v1.6/lnvm_id_ns
Keith Busch [Thu, 11 Jan 2018 21:42:01 +0000 (14:42 -0700)]
Merge pull request #258 from minwooim/v1.6/lnvm_id_ns

nvme-cli: lnvm: update ns-id subcommand

7 years agoMerge pull request #257 from minwooim/v1.6/add_bps_field_to_cap
Keith Busch [Thu, 11 Jan 2018 21:41:12 +0000 (14:41 -0700)]
Merge pull request #257 from minwooim/v1.6/add_bps_field_to_cap

nvme-cli: add BPS bit field to CAP controller register

7 years agoMerge pull request #255 from minwooim/v1.6/add_sanitize_log_json_print
Keith Busch [Thu, 11 Jan 2018 21:40:35 +0000 (14:40 -0700)]
Merge pull request #255 from minwooim/v1.6/add_sanitize_log_json_print

nvme-cli: add support for json output format of sanitize-log command

7 years agoMerge pull request #254 from minwooim/v1.6/remove_nsid_in_error_log
Keith Busch [Thu, 11 Jan 2018 21:39:50 +0000 (14:39 -0700)]
Merge pull request #254 from minwooim/v1.6/remove_nsid_in_error_log

nvme-cli: Remove nsid param in error-log

7 years agoMerge pull request #256 from minwooim/v1.6/update_alias_desc_readme_md
Keith Busch [Thu, 11 Jan 2018 21:39:12 +0000 (14:39 -0700)]
Merge pull request #256 from minwooim/v1.6/update_alias_desc_readme_md

nvme-cli: update subcommand alias description in README.md

7 years agonvme-cli: intel: update smart-log-add command documentation
Minwoo Im [Wed, 10 Jan 2018 16:35:09 +0000 (01:35 +0900)]
nvme-cli: intel: update smart-log-add command documentation

Update smart-log-add command documentation in intel plugin with
output-format parameter description.

In github issue #175, tim-oleksii reported that descriptions of
output-format whose implementation was added in Pull request #178 was
not added in documentation.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: update error-log documentation
Minwoo Im [Wed, 10 Jan 2018 15:52:17 +0000 (00:52 +0900)]
nvme-cli: update error-log documentation

Update error-log documentation with removing nsid parameter.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: lnvm: add human-readable print format to ns-id subcommand
Minwoo Im [Wed, 10 Jan 2018 15:17:25 +0000 (00:17 +0900)]
nvme-cli: lnvm: add human-readable print format to ns-id subcommand

Add human-readable print format to _ns-id_ subcommand of lnvm.
-H option had been used nowhere. Make it possible to see in this format.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: lnvm: add check for fd after open operation
Minwoo Im [Wed, 10 Jan 2018 15:15:56 +0000 (00:15 +0900)]
nvme-cli: lnvm: add check for fd after open operation

Make it return negative error value when file open operation is failed.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: lnvm: remove unnecessary force parameter of ns-id in lnvm
Minwoo Im [Wed, 10 Jan 2018 15:13:33 +0000 (00:13 +0900)]
nvme-cli: lnvm: remove unnecessary force parameter of ns-id in lnvm

If identify geometry is failed, then nvme-cli is not to print out
information of namespace.
Also no one uses this _force_ flag in this subcommand.
So, remove this unnecessary parameter.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: lnvm: add whitespace between words in a description
Minwoo Im [Wed, 10 Jan 2018 15:11:57 +0000 (00:11 +0900)]
nvme-cli: lnvm: add whitespace between words in a description

Add an whitespace between words in a description for ns-id of lightnvm
subcommand.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: add BPS bit field to CAP controller register
Minwoo Im [Fri, 15 Dec 2017 16:12:06 +0000 (01:12 +0900)]
nvme-cli: add BPS bit field to CAP controller register

NVMe 1.3 spec introduced BPS(Boot Partition Support) bit field in CAP of
controller register.
Add this bit field to "struct nvme_bar_cap" by changing
"css_nssrs_dstrd" field to "bps_css_nssrs_dstrd".
Also add a print for BPS bit field to print CAP properly when show-regs
command with human-readable.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agoUpdate subcommand alias description in README.md
Minwoo Im [Wed, 10 Jan 2018 12:09:36 +0000 (21:09 +0900)]
Update subcommand alias description in README.md

Update description of alias for subcommand.

7 years agonvme-cli: add support for json output format of sanitize-log command
Minwoo Im [Wed, 10 Jan 2018 11:59:29 +0000 (20:59 +0900)]
nvme-cli: add support for json output format of sanitize-log command

Add support for json output format of sanitize-log command.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: Remove unnecessary nsid field in error-log
Minwoo Im [Wed, 10 Jan 2018 11:04:45 +0000 (20:04 +0900)]
nvme-cli: Remove unnecessary nsid field in error-log

Error information log page is global to controller.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agoMerge pull request #251 from minwooim/v1.6/update_print_sanitize
Keith Busch [Mon, 8 Jan 2018 15:59:44 +0000 (08:59 -0700)]
Merge pull request #251 from minwooim/v1.6/update_print_sanitize

nvme-cli: update print for sanitize-log command with output-format

7 years agoMerge pull request #250 from minwooim/v1.6/make_sanitize_desc_const
Keith Busch [Mon, 8 Jan 2018 15:57:03 +0000 (08:57 -0700)]
Merge pull request #250 from minwooim/v1.6/make_sanitize_desc_const

nvme-cli: make sanitize description const

7 years agoMerge pull request #249 from minwooim/v1.6/add_log_page_field_to_error_log
Keith Busch [Mon, 8 Jan 2018 15:55:30 +0000 (08:55 -0700)]
Merge pull request #249 from minwooim/v1.6/add_log_page_field_to_error_log

nvme-cli: add print for command specific info field of error log page

7 years agonvme-cli: add print for command specific info field of error log page
Minwoo Im [Sun, 7 Jan 2018 07:33:09 +0000 (16:33 +0900)]
nvme-cli: add print for command specific info field of error log page

Add print line for Command Specific Information[39:32] in Error
Information Log Entry.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: update print for sanitize-log command with output-format
Minwoo Im [Sun, 7 Jan 2018 07:30:47 +0000 (16:30 +0900)]
nvme-cli: update print for sanitize-log command with output-format

Update print for sanitize-log command with normal and binary
output-format. Also move origin print code to nvme-print.c. with
human-readable option.

Make sanitize-log command call nvme_sanitize_log() so that
it looks more consistent with other XXX-log commands.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agonvme-cli: make sanitize description const
Minwoo Im [Sun, 7 Jan 2018 07:23:59 +0000 (16:23 +0900)]
nvme-cli: make sanitize description const

Make description in sanitize() const.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agoFix verbose decoding for coalescing aggregation time
Keith Busch [Fri, 5 Jan 2018 23:48:57 +0000 (16:48 -0700)]
Fix verbose decoding for coalescing aggregation time

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

Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agoAllow hierarchy of similiarly named plugins
Keith Busch [Wed, 3 Jan 2018 23:03:36 +0000 (16:03 -0700)]
Allow hierarchy of similiarly named plugins

For historical reasons, we allow the user to write their command line
executing "vendor" plugin "command" as one of two ways:

  nvme vendor command

And

  nvme vendor-command

This was conflicting if a hierarchy of vendor additions exists, like
"vendor-oem".

So, this patch fixes that by first searching the entire builtin vendor
plugins before searching for matching substrings.

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