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>
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>
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Keith Busch [Wed, 3 Jan 2018 15:37:02 +0000 (08:37 -0700)]
Release v1.5
It's been a while since the previous release, and we've accumulated
enough updates to warrant a new tag. Shortlog below.
There are printing fixes and improvements to output, documentation
updates, enhancements to vendor plugins, updates for the NVMe 1.3
Specification, a new command for listing subsystems, a new way to alias
sub-commands in case old ones need to be deprecated, fabrics fixes,
and resource leak fixes. Thank you to everyone who contributed!
Andrew Maier (2):
Nitpicked a printing alignment issue with the id-ns vendor specific field
Updated the human readable printing for the SGLS field in the id-ctrl command to be compliant with NVMe 1.3
David Manouchehri (1):
Avoid unnecessary abbreviation.
Guan Junxiong (2):
nvme-cli: add support to get properties for NVMe over Fabric
nvme-cli: support to set the property for NVMe over Fabric
James Smart (2):
nvme-cli: add duplicate_connect parameter support
nvme-cli: add duplicate_connect parameter support
Jeff Lien (2):
NVMe-CLI : WDC-Plugin Updated Smart Log Command
NVMe-CLI : WDC-Plugin Documentation for Updated Smart Log Command
Johannes Thumshirn (2):
fabrics: also set queue_size and nr_io_queues on connect-all connects
nvme: Introduce new 'list-subsys' command
Keith Busch (28):
Add AEN decoder helper to get-log
Regen documentation
Merge pull request #228 from primeos/nixos
intel-nvme: Fix compiler errors and warnings
Merge pull request #229 from steve-gh/master
Add command effects log page
Increase default format timeout
Revert "nvme-cli: add duplicate_connect parameter support"
Merge pull request #230 from liangxiao1/upstream
Fix typo in previous commit
Fix long suffix parse on 32-bit machines
Merge pull request #232 from Manouchehri/verbose
nvme/flush: explicitely close file descriptor
Merge pull request #233 from cleandever/master
Add 'DEAC' support to write-zeroes command
Rebuild documentation
Regenerate documentation
Update get-feature help text
Improve code alignment on intel plugin
Update intel internal log man page.
nvme-cli/intel: Return if arg parsing returns error
nvme: add options for write command directives
Update documentation
Merge pull request #238 from Eideticom/andrew-dev
Reorder command list
Documentation fixes
Update documentation to use aliases
Merge pull request #243 from ScottyBauer/fix_mem_leak
Michael Weiss (2):
Add Nix(OS) install instructions to the README
Fix the Markdown code for the Alpine install instructions
Minwoo Im (11):
nvme-cli: make address print format more human-readable
nvme-cli: fix wrong bitmask in number of rpmb units.
nvme-cli: make command description const
nvme-cli: resync nvme.h with the kernel's
nvme-cli: update show_registers_cc() to use nvme.h
nvme-cli: replace values of all namespaces with NVME_NSID_ALL
nvme-cli: add prints for new HMB identify fields of TP 4002
nvme-cli: add support alias command with Firmware Activate
nvme-cli: update Firmware Commit with boot partition feature
nvme-cli: add command specific status of Firmware Commit
nvme-cli: add prints of boot partition feature to show-regs
Scott Bauer (1):
nvme-cli: Fix small mem leak.
Steve (2):
Include sizing data in json output that's already included in the non-json results.
Cleanup variable definitions
Xiao Liang (1):
nvme/id-ns: do not try to get namespace id from non-block device.
cleandever (1):
Fix memory leak
jeffreyalien (1):
nvme-cli : wdc-plugin Add support for WDC SN100 and SN200 devices.
Signed-off-by: Keith Busch <keith.busch@intel.com>