]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
3 years agoFix JSON report zones output
Brandon Paupore [Tue, 14 Dec 2021 17:49:15 +0000 (11:49 -0600)]
Fix JSON report zones output

Previously multiple JSON objects would be in the output of
zns-report-zones if there were more than 1024 zones requested because of
the chunked requests sent by nvme-cli.

Fix this to output a single JSON object with one zone_list. This is done
by passing around and appending to the zone_list, then outputting all of
it once after receiving all the reports.

Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
3 years agoMerge branch 'pel_fix_nvme_cli'
Daniel Wagner [Fri, 10 Dec 2021 15:15:43 +0000 (16:15 +0100)]
Merge branch 'pel_fix_nvme_cli'

3 years agonvme-cli: Add support Telemetry CRT in PEL
Wen Xiong [Wed, 1 Dec 2021 22:31:07 +0000 (17:31 -0500)]
nvme-cli: Add support Telemetry CRT in PEL

Add "Telemetry CRT" event in PEL.

Signed-off-by: Wen Xiong <wenxiong@linux.ibm.com>
3 years agonvme-cli: Add support set feature event in PEL
Wen Xiong [Wed, 1 Dec 2021 22:29:58 +0000 (17:29 -0500)]
nvme-cli: Add support set feature event in PEL

Add "Set Feature" event in PEL.

Persistent Event Entries:
Event Number: 0
Event Type: Set Feature Event(0xb)
Event Type Revision: 1
Event Header Length: 21
Controller Identifier: 65
Event Timestamp: 564587204146155
Vendor Specific Information Length: 0
Event Length: 16
Set Feature Event Entry:
Set Feature ID  :0x7 (Number of Queues),  value:0x270027
        Number of IO Completion Queues Allocated (NCQA): 40
        Number of IO Submission Queues Allocated (NSQA): 40

Signed-off-by: Wen Xiong <wenxiong@us.ibm.com>
3 years agonvme-cli: Adds readable firmware level in persistent
Wen Xiong [Wed, 1 Dec 2021 22:28:44 +0000 (17:28 -0500)]
nvme-cli: Adds readable firmware level in persistent

For example, In Firmware Commit Event:

Old Firmware Revision: 3617604718875264338
New Firmware Revision: 3833777500989048146

changes to

Old Firmware Revision: 3617604718875264338 (REV.SP42)
New Firmware Revision: 3833777500989048146 (REV.SP45)

Signed-off-by: Wen Xiong <wenxiong@linux.ibm.com
3 years agonvme-cli: Adds event number in persistent event entries
Wen Xiong [Wed, 1 Dec 2021 22:27:25 +0000 (17:27 -0500)]
nvme-cli: Adds event number in persistent event entries

Persistent Event Entries:
Event Number: 0
Event Type: SMART/Health Log Snapshot Event(0x1)
Event Type Revision: 1
Event Header Length: 21
Controller Identifier: 66
Event Timestamp: 44392

Signed-off-by: Wen Xiong <wenxiong@linux.ibm.com>
3 years agonvme-cli: Decode "Supported Events Bitmap" in PEL header
Wen Xiong [Wed, 1 Dec 2021 22:25:58 +0000 (17:25 -0500)]
nvme-cli: Decode "Supported Events Bitmap" in PEL header

"Supported Events Bitmap" in PEL header shows what events
are supported in current nvme devices.

Persistent Event Log for device: nvme0n1
Action for Persistent Event Log: 0
..
..
..
Supported Events Bitmap:
        Support SMART/Health Log Snapshot Event(0x1)
        Support Firmware Commit Event(0x2)
        Support Timestamp Change Event(0x3)
        Support Power-on or Reset Event(0x4)
        Support NVM Subsystem Hardware Error Event(0x5)
        Support Change Namespace Event(0x6)
        Support Format NVM Start Event(0x7)
        Support Format NVM Completion Event(0x8)
        Support Sanitize Start Event(0x9)
        Support Sanitize Completion Event(0xa)
        Support Set Feature Event(0xb)
        Support Set Telemetry CRT  Event(0xc)
        Support Thermal Excursion Event(0xd)

Signed-off-by: Wen Xiong <wenxiong@linux.ibm.com>
3 years agolibnvme: git submodule, subproject updated
Daniel Wagner [Fri, 10 Dec 2021 15:10:54 +0000 (16:10 +0100)]
libnvme: git submodule, subproject updated

Update to "libnvme: Add new events support in PEL"

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge branch 'tp4076'
Daniel Wagner [Fri, 10 Dec 2021 14:58:18 +0000 (15:58 +0100)]
Merge branch 'tp4076'

3 years agolibnvme: git submodule, subproject updated
Steven Suengcheol Lee [Fri, 10 Dec 2021 14:35:14 +0000 (23:35 +0900)]
libnvme: git submodule, subproject updated

zns Add support for zone random write area(zrwa)

Signed-off-by: Steven Suengcheol Lee <sc108.lee@samsung.com>
3 years agozns: Add printing Zone Capacity Changed from zone reset
Steven Seungcheol Lee [Fri, 10 Dec 2021 11:39:40 +0000 (20:39 +0900)]
zns: Add printing Zone Capacity Changed from zone reset

if the Variable Zone Capacity bit is set to ‘1’ in the Zone Operation
Characteristics field in the Zoned Namespace Command Set specific
Identify Namespace data structure, then the zone capacity may change
upon successful completion of a Zone Management Send command
specifying the Zone Send Action of Reset Zone

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agozns: remove duplicate of closing fd & unnecessary function
Steven Seungcheol Lee [Fri, 10 Dec 2021 11:36:36 +0000 (20:36 +0900)]
zns: remove duplicate of closing fd & unnecessary function

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agozns: Add support for zone random write area (zrwa)
Steven Seungcheol Lee [Wed, 8 Dec 2021 06:18:12 +0000 (15:18 +0900)]
zns: Add support for zone random write area (zrwa)

NVMe - TP 4076 Zoned Random Write Area 2021.08.23 - Ratified

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Co-authored-by: Klaus Jensen <k.jensen@samsung.com>
3 years agoMerge branch 'fix/build_errors'
Daniel Wagner [Fri, 10 Dec 2021 14:05:36 +0000 (15:05 +0100)]
Merge branch 'fix/build_errors'

3 years agoMerge pull request #1275 from linux-nvme/set-libnvme-wrap-revision
Daniel Wagner [Fri, 10 Dec 2021 14:01:53 +0000 (15:01 +0100)]
Merge pull request #1275 from linux-nvme/set-libnvme-wrap-revision

build: Sync libnvme wrap revision to the git submodule one

3 years agobuild: Sync libnvme wrap revision to the git submodule one
Daniel Wagner [Fri, 10 Dec 2021 13:15:34 +0000 (14:15 +0100)]
build: Sync libnvme wrap revision to the git submodule one

Stop tracking the HEAD version of libnvme with meson's wrap.  Instead
sync it with the git submodule revision. This avoids all sort of
inconsistencies.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoAdd version check for OpenSSL(1.1.0) required
Steven Seungcheol Lee [Mon, 22 Nov 2021 10:27:08 +0000 (19:27 +0900)]
Add version check for OpenSSL(1.1.0) required

HMAC_CTX_new(), HMAC_CTX_free() are new in OpenSSL 1.1.0.

nvme.c: In function ‘gen_dhchap_key’:
nvme.c:6792:24: error: implicit declaration of function ‘HMAC_CTX_new’; did you mean ‘HMAC_CTX_init’? [-Werror=implicit-function-declaration]
 6792 |   HMAC_CTX *hmac_ctx = HMAC_CTX_new();
      |                        ^~~~~~~~~~~~
      |                        HMAC_CTX_init
nvme.c:6792:24: error: initialization of ‘HMAC_CTX *’ {aka ‘struct hmac_ctx_st *’} from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
nvme.c:6805:3: error: implicit declaration of function ‘HMAC_CTX_free’; did you mean ‘HMAC_CTX_copy’? [-Werror=implicit-function-declaration]
 6805 |   HMAC_CTX_free(hmac_ctx);
      |   ^~~~~~~~~~~~~
      |   HMAC_CTX_copy
cc1: all warnings being treated as errors
make: *** [Makefile:155: nvme.o] Error 1

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agonvme: fix fatal error for sys/random.h
Steven Seungcheol Lee [Mon, 22 Nov 2021 08:34:58 +0000 (17:34 +0900)]
nvme: fix fatal error for sys/random.h

fatal error: sys/random.h: No such file or directory
sys/random.h supported from glibc version 2.25
so add header file existence check
if there is no sys/random.h, try to read /dev/urandom or /dev/random

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: cache errno value, close will overwrite it]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1270 from igaw/ccan-debug-build
Daniel Wagner [Fri, 10 Dec 2021 11:47:01 +0000 (12:47 +0100)]
Merge pull request #1270 from igaw/ccan-debug-build

Ccan debug build

3 years agoMerge pull request #1273 from jeffreyalien/drv-1944
Daniel Wagner [Fri, 10 Dec 2021 11:23:31 +0000 (12:23 +0100)]
Merge pull request #1273 from jeffreyalien/drv-1944

[nvme-cli] Undo revert of ZN350 changes in the master branch

3 years ago[nvme-cli] Undo revert of ZN350 changes in the master branch
Jeff Lien [Thu, 9 Dec 2021 16:35:54 +0000 (10:35 -0600)]
[nvme-cli] Undo revert of ZN350 changes in the master branch

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoMerge pull request #1268 from sc108-lee/fixes
Daniel Wagner [Thu, 9 Dec 2021 15:05:09 +0000 (16:05 +0100)]
Merge pull request #1268 from sc108-lee/fixes

Fixes

3 years agoMerge pull request #1267 from ikegami-t/intel-nvme
Daniel Wagner [Thu, 9 Dec 2021 14:51:06 +0000 (15:51 +0100)]
Merge pull request #1267 from ikegami-t/intel-nvme

MAINT: intel-nvme: Fix CI build stringop-overflow warning for issue #…

3 years agoMerge pull request #1265 from bjpaupor/unique-log-names
Daniel Wagner [Thu, 9 Dec 2021 14:45:11 +0000 (15:45 +0100)]
Merge pull request #1265 from bjpaupor/unique-log-names

Use unique names for VULs, also return 0 on success

3 years agonvme-print: local functions are defined as a static function
Steven Seungcheol Lee [Thu, 9 Dec 2021 13:20:22 +0000 (22:20 +0900)]
nvme-print: local functions are defined as a static function

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoutil/json: fix build error of json_object_add_value_uint64 #1260
Steven Seungcheol Lee [Thu, 9 Dec 2021 11:34:24 +0000 (20:34 +0900)]
util/json: fix build error of json_object_add_value_uint64 #1260

util/json used when system does not have json-c library
json_object_add_value_uint handled with unsigned long long (64bits)
That's why json_object_add_value_uint64 is redefined with it

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agozns: remove unnecessary label, fix wrong goto
Steven Seungcheol Lee [Thu, 9 Dec 2021 08:01:31 +0000 (17:01 +0900)]
zns: remove unnecessary label, fix wrong goto

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agozns: Bug fix(wrong api call from changed_zone_list)
Steven Seungcheol Lee [Thu, 9 Dec 2021 07:44:56 +0000 (16:44 +0900)]
zns: Bug fix(wrong api call from changed_zone_list)

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agobuild: Enable ccan debug code for debug build
Daniel Wagner [Thu, 9 Dec 2021 12:41:02 +0000 (13:41 +0100)]
build:  Enable ccan debug code for debug build

The ccan library has support debugging, let's enable this when
building the debug version of the library.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoplugins: Force types for isalnum and isblank
Daniel Wagner [Thu, 9 Dec 2021 12:48:30 +0000 (13:48 +0100)]
plugins: Force types for isalnum and isblank

The two users of isalnum and isblank hand in unsigned char and not
int as expected by the API. This triggers thye type checker in the
debug build, e.g.

../subprojects/libnvme/ccan/ccan/build_assert/build_assert.h:38:22: error: size of unnamed array is negative
   38 |         (sizeof(char [1 - 2*!(cond)]) - 1)
      |                      ^
../ccan/ccan/str/str.h:189:16: note: in expansion of macro ‘BUILD_ASSERT_OR_ZERO’
  189 |         ((i) + BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(typeof(i), \
      |                ^~~~~~~~~~~~~~~~~~~~
../ccan/ccan/str/str.h:196:32: note: in expansion of macro ‘str_check_arg_’
  196 | #define isalnum(i) str_isalnum(str_check_arg_(i))
      |                                ^~~~~~~~~~~~~~
../plugins/memblaze/memblaze-nvme.c:410:13: note: in expansion of macro ‘isalnum’
  410 |         if (isalnum(*c) == 0) {
      |             ^~~~~~~

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1255 from hreinecke/loop-address
Daniel Wagner [Thu, 9 Dec 2021 09:59:23 +0000 (10:59 +0100)]
Merge pull request #1255 from hreinecke/loop-address

fabrics: do not print 'unrecognized' address family for loop

3 years agoMerge pull request #1256 from sc108-lee/fix/fc28cdc
Daniel Wagner [Thu, 9 Dec 2021 09:54:44 +0000 (10:54 +0100)]
Merge pull request #1256 from sc108-lee/fix/fc28cdc

Fix/fc28cdc

3 years agoMAINT: intel-nvme: Fix CI build stringop-overflow warning for issue #1246
Tokunori Ikegami [Wed, 8 Dec 2021 16:43:45 +0000 (01:43 +0900)]
MAINT: intel-nvme: Fix CI build stringop-overflow warning for issue #1246

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agoMerge pull request #1262 from sc108-lee/fix/zsh_completion
Daniel Wagner [Wed, 8 Dec 2021 16:24:48 +0000 (17:24 +0100)]
Merge pull request #1262 from sc108-lee/fix/zsh_completion

completions: fix zsh completion (wrong string end)

3 years agonvme: extend existing id ctrl parameters as per 2.0
Gollu Appalanaidu [Sun, 13 Jun 2021 14:00:02 +0000 (19:30 +0530)]
nvme: extend existing id ctrl parameters as per 2.0

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
3 years agonvme: add optional copy format support id ctrl field
Gollu Appalanaidu [Fri, 28 May 2021 05:10:40 +0000 (10:40 +0530)]
nvme: add optional copy format support id ctrl field

Add the OCFS field in Identify Controller Structure, as per the
Ratified TP 4065b (Simple Copy Command).

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
3 years agolibnvme: git submodule update
Steven Seungcheol Lee [Tue, 7 Dec 2021 08:21:21 +0000 (17:21 +0900)]
libnvme: git submodule update

Updates
Fix memory leak
nvme: add optional copy format support id ctrl field

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoUse unique names for VULs, also return 0 on success
Brandon Paupore [Thu, 2 Dec 2021 21:40:39 +0000 (15:40 -0600)]
Use unique names for VULs, also return 0 on success

Previously nvme_log_id_to_string returned "WDC Vendor Unique Log ID" if
it was any vendor unique log ID. This causes problems when requesting
JSON output, as only the final vendor unique log ID would be shown.
Instead, append the log id to the string making each unique.

Also, wdc_log_page_directory previously returned whatever the
output_format was. Instead return 0 if the format was valid.

Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
3 years agoMerge pull request #1261 from sc108-lee/add/define
Hannes Reinecke [Mon, 29 Nov 2021 07:23:17 +0000 (08:23 +0100)]
Merge pull request #1261 from sc108-lee/add/define

Makefile: Add missing define (LIBJSONC_14)

3 years agoMerge pull request #1263 from hreinecke/discovery-fix
Hannes Reinecke [Mon, 29 Nov 2021 07:22:08 +0000 (08:22 +0100)]
Merge pull request #1263 from hreinecke/discovery-fix

libnvme: git submodule update

3 years agolibnvme: git submodule update
Hannes Reinecke [Mon, 22 Nov 2021 16:45:19 +0000 (17:45 +0100)]
libnvme: git submodule update

Pull in changes to fixup endless loop during discovery.

3 years agocompletions: fix zsh completion (wrong string end)
Steven Seungcheol Lee [Fri, 26 Nov 2021 05:15:33 +0000 (14:15 +0900)]
completions: fix zsh completion (wrong string end)

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMakefile: Add missing define (LIBJSONC_14)
Steven Seungcheol Lee [Fri, 26 Nov 2021 04:54:24 +0000 (13:54 +0900)]
Makefile: Add missing define (LIBJSONC_14)

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMerge pull request #1259 from sc108-lee/doc_update
Hannes Reinecke [Thu, 25 Nov 2021 07:43:34 +0000 (08:43 +0100)]
Merge pull request #1259 from sc108-lee/doc_update

doc: Documentation update (fix doc build error #1257)

3 years agodoc: Documentation update (fix doc build error #1257)
Steven Seungcheol Lee [Thu, 25 Nov 2021 05:21:51 +0000 (14:21 +0900)]
doc: Documentation update (fix doc build error #1257)

nvme-check-dhchap-key, nvme-gen-dhchap-key the line of === under title
    need to be written same length as title
    -> fix [asciidoc: FAILED: manpage document title is mandatory]

nvme-connect-all, nvme-connect, nvme-discover new options are added

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agofabrics: do not print 'unrecognized' address family for loop
Hannes Reinecke [Tue, 23 Nov 2021 07:19:20 +0000 (08:19 +0100)]
fabrics: do not print 'unrecognized' address family for loop

fabrics implementations like 'loop' do not have a transport address,
and consequently the address family value doesn't make any sense here.
So do not try to translate the address family to a printable string
if the address itself is empty.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #1254 from hreinecke/loop-fix
Hannes Reinecke [Mon, 22 Nov 2021 16:51:57 +0000 (17:51 +0100)]
Merge pull request #1254 from hreinecke/loop-fix

libnvme: git submodule update

3 years agolibnvme: git submodule update
Hannes Reinecke [Mon, 22 Nov 2021 16:45:19 +0000 (17:45 +0100)]
libnvme: git submodule update

Pull in changes to fixup loop device handling.

3 years agoMerge pull request #1250 from jeffreyalien/master
Daniel Wagner [Fri, 19 Nov 2021 07:51:25 +0000 (08:51 +0100)]
Merge pull request #1250 from jeffreyalien/master

[nvme-cli] Improve formatting for WDC plugin command - vs-smart-add-log output

3 years agoMerge pull request #1251 from hreinecke/zns-update
Hannes Reinecke [Fri, 19 Nov 2021 06:57:10 +0000 (07:57 +0100)]
Merge pull request #1251 from hreinecke/zns-update

plugins/zns: update to match new calling convention

3 years agoplugins/zns: update to match new calling convetion
Hannes Reinecke [Fri, 19 Nov 2021 06:52:03 +0000 (07:52 +0100)]
plugins/zns: update to match new calling convetion

Pull in the latest libnvme changes to update the zns calling convention
and update the zns plugin accordingly.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years ago[nvme-cli] Improve formatting for vs-smart-add-log output
Jeff Lien [Tue, 9 Nov 2021 22:32:48 +0000 (16:32 -0600)]
[nvme-cli] Improve formatting for vs-smart-add-log output

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoMerge pull request #1235 from hreinecke/auth.v5
Hannes Reinecke [Thu, 18 Nov 2021 14:58:45 +0000 (15:58 +0100)]
Merge pull request #1235 from hreinecke/auth.v5

In-band authentication support

3 years agonvme-connect: Add 'dhchap-secret' and 'dhchap-ctrl-secret' arguments
Hannes Reinecke [Wed, 11 Aug 2021 07:58:59 +0000 (09:58 +0200)]
nvme-connect: Add 'dhchap-secret' and 'dhchap-ctrl-secret' arguments

Add 'dhchap-secret' and 'dhchap-ctrl-secret' arguments for nvme-connect
to enable NVMe In-Band authentication.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoAdd 'check-dhchap-key' function
Hannes Reinecke [Mon, 21 Dec 2020 08:27:34 +0000 (09:27 +0100)]
Add 'check-dhchap-key' function

Add a function to validate a given DH-HMAC-CHAP key in transport
encoding for NVMe in-band authentication.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoAdd 'gen-dhchap-key' command
Hannes Reinecke [Thu, 17 Dec 2020 08:43:50 +0000 (09:43 +0100)]
Add 'gen-dhchap-key' command

Add command 'gen-dhchap-key' to generate an DH-HMAC-CHAP host key
for NVMe in-band authentication.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agolibnvme: git submodule update
Hannes Reinecke [Thu, 18 Nov 2021 14:10:11 +0000 (15:10 +0100)]
libnvme: git submodule update

Update libnvme to pull in authentication functions.

3 years agoMerge pull request #1247 from hreinecke/timeout
Hannes Reinecke [Thu, 18 Nov 2021 13:04:09 +0000 (14:04 +0100)]
Merge pull request #1247 from hreinecke/timeout

Update to add 'result' and 'timeout' arguments

3 years agoUpdate to add 'result' and 'timeout' arguments
Hannes Reinecke [Thu, 18 Nov 2021 13:00:34 +0000 (14:00 +0100)]
Update to add 'result' and 'timeout' arguments

With the latest libnvme update the ioctl wrapper functions have
been sanitized to always include a 'timeout' and 'result' argument.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #1238 from igaw/meson-install-files
Daniel Wagner [Thu, 18 Nov 2021 09:47:20 +0000 (10:47 +0100)]
Merge pull request #1238 from igaw/meson-install-files

meson build and configuration updates

3 years agobuild: Don't use external script to set version
Daniel Wagner [Thu, 18 Nov 2021 09:40:59 +0000 (10:40 +0100)]
build: Don't use external script to set version

The meson documentation points out the the version string should be a
fixed string. Our trick with trying to figure out the version is not
working in all cases, e.g. 'meson dist' will create a wrong file name.

The idea is to update the version string when a new development cycle
starts and mark the release with a tag. This is what other projects
do as well. Let's follow their common practice.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Update json-c.wrap
Daniel Wagner [Thu, 18 Nov 2021 09:13:20 +0000 (10:13 +0100)]
build: Update json-c.wrap

The json-c wrap was updated to fix a deprecation warnings issued by
meson.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoworkflows: Install libjson-c-dev
Daniel Wagner [Wed, 17 Nov 2021 13:17:38 +0000 (14:17 +0100)]
workflows: Install libjson-c-dev

A workaround to support older json-c version (0.13) has been
added. Let's build against the system library.

While at it also update the build name to 'nvme-cli CI'.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Lower json-c requirement to 0.13
Daniel Wagner [Wed, 17 Nov 2021 13:01:22 +0000 (14:01 +0100)]
build: Lower json-c requirement to 0.13

A workaround has been added to avoid asking for a newer json-c
version. Let's drop back to 0.13.

See 50c32d73278d ("Compability for older json-c releases")

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoscripts: Replace gen-hostnqn workaround with 'nvme gen-hostnqn'
Daniel Wagner [Fri, 12 Nov 2021 15:29:20 +0000 (16:29 +0100)]
scripts: Replace gen-hostnqn workaround with 'nvme gen-hostnqn'

The script was introduced to workaround the short commings 'nvme
gen-hostnqn'. In the meantime these have been address. Instead
removing the script completly keep it around for backwards
compatibiliy and just use 'nvme gen-hostnqn'.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Install additional files incl documentation
Daniel Wagner [Fri, 12 Nov 2021 11:30:09 +0000 (12:30 +0100)]
build: Install additional files incl documentation

Install additional files such as dracut, systemd and udev scipts.
Also add support for building and installing documentation.

Introduce a build option '-Ddocs=[all,man,html]' which builds (if
asciidoctor is availalbe) and installs the docs.

meson doesn't support pre compiled sources updated in the source
tree. This is a design decision. That means the man pages
(Documentation/*.1) and the html pages (Documentation/*.html) can't be
updated so easily as with Makefile.

The workaround provide a shell script which updates the in tree
pre compiled documentation

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1245 from hreinecke/discovery
Hannes Reinecke [Wed, 17 Nov 2021 20:32:44 +0000 (21:32 +0100)]
Merge pull request #1245 from hreinecke/discovery

TP8013 & 8014 support

3 years agofabrics: decode discover log page entry flags
Hannes Reinecke [Wed, 17 Nov 2021 09:38:47 +0000 (10:38 +0100)]
fabrics: decode discover log page entry flags

TP8014 defines a new discovery log page entry field 'eflags', which
carries information about the returned entries.
This patch decodes the new field.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: call nvme_ctrl_set_discovery_ctrl()
Hannes Reinecke [Tue, 16 Nov 2021 13:57:05 +0000 (14:57 +0100)]
fabrics: call nvme_ctrl_set_discovery_ctrl()

When creating a discovery connection the user might be using the
unique discovery NQN, so we should be calling nvme_ctrl_set_discovery_ctrl()
to mark the connection as a discovery connection.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: allow 'nqn' as argument to connect and discover
Hannes Reinecke [Tue, 16 Nov 2021 08:46:57 +0000 (09:46 +0100)]
fabrics: allow 'nqn' as argument to connect and discover

With TP8013 a discovery controller can provide a unique subsystem
NQN, so we should be able to pass in that NQN when calling 'nvme discover'.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agolibnvme: git submodule update
Hannes Reinecke [Wed, 17 Nov 2021 17:36:33 +0000 (18:36 +0100)]
libnvme: git submodule update

Update libnvme to pull in map file updates.

3 years agoMerge pull request #1237 from hreinecke/config
Hannes Reinecke [Wed, 17 Nov 2021 14:49:20 +0000 (15:49 +0100)]
Merge pull request #1237 from hreinecke/config

Update and document configuration file access

3 years agonvme: document 'config-file' commandline option
Hannes Reinecke [Mon, 15 Nov 2021 11:29:23 +0000 (12:29 +0100)]
nvme: document 'config-file' commandline option

The 'config-file' commandline option is not documented in the
man pages. And we should reference the config file as a 'ghost'
file in the rpm spec to ensure it gets removed together with the
nvme-cli package.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agonvme: add option 'dump-config' to 'connect' and 'discover'
Hannes Reinecke [Mon, 15 Nov 2021 11:11:57 +0000 (12:11 +0100)]
nvme: add option 'dump-config' to 'connect' and 'discover'

Add an option 'dump-config' to 'nvme connect' and 'nvme discover'
to print out the resulting JSON configuration to stdout.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: use nvmf_default_config()
Hannes Reinecke [Wed, 17 Nov 2021 14:30:01 +0000 (15:30 +0100)]
fabrics: use nvmf_default_config()

Use nvmf_default_config() to initialize the fabrics configuration
with default values.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agolibnvme: git submodule update
Hannes Reinecke [Wed, 17 Nov 2021 13:57:51 +0000 (14:57 +0100)]
libnvme: git submodule update

Update libnvme to pull in nvmf_default_config().

3 years agoMerge pull request #1243 from hreinecke/compat
Hannes Reinecke [Wed, 17 Nov 2021 11:17:33 +0000 (12:17 +0100)]
Merge pull request #1243 from hreinecke/compat

Compability for older json-c releases

3 years agoCompability for older json-c releases
Hannes Reinecke [Wed, 17 Nov 2021 10:00:04 +0000 (11:00 +0100)]
Compability for older json-c releases

commit 0b63a8b7cfb7 ("Check json-c libversion, recover commit d127537")
broke building on older releases when using 'make'.
As the original issue was about json-c not being able to parse full 64
numbers this patch separates out 32 and 64 json objects and adds a warning
if an overflow occurs on older json-c releases.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #1242 from hreinecke/version-update
Hannes Reinecke [Wed, 17 Nov 2021 10:02:27 +0000 (11:02 +0100)]
Merge pull request #1242 from hreinecke/version-update

libnvme: git submodule update

3 years agolibnvme: git submodule update
Hannes Reinecke [Wed, 17 Nov 2021 09:42:35 +0000 (10:42 +0100)]
libnvme: git submodule update

Update to libnvme version to pull in TP8013&8014 support.

3 years agoMerge pull request #1240 from igaw/update-submodule
Daniel Wagner [Tue, 16 Nov 2021 22:08:03 +0000 (23:08 +0100)]
Merge pull request #1240 from igaw/update-submodule

libnvme: git submodule update

3 years agoworkflows: Don't install libjson-c-dev
Daniel Wagner [Tue, 16 Nov 2021 22:06:02 +0000 (23:06 +0100)]
workflows: Don't install libjson-c-dev

ubuntu-latest ships an old version of json-c (0.13). Let's use the
version from meson's wrapdb which is bit newer (0.15).

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Update json-c dependencies
Daniel Wagner [Tue, 16 Nov 2021 21:25:45 +0000 (22:25 +0100)]
build: Update json-c dependencies

With commit 0b63a8b7cfb7 ("Check json-c libversion, recover commit
d127537") with increased the minimum version of json-c. Let's update
the meson wrapper.

While at it also update the min version in meson.build to 0.14.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agolibnvme: git submodule update
Daniel Wagner [Tue, 16 Nov 2021 16:41:13 +0000 (17:41 +0100)]
libnvme: git submodule update

Update to latest libnvme version.

3 years agoMerge pull request #1223 from igaw/merge-nvme-cli-monolithic
Daniel Wagner [Tue, 16 Nov 2021 16:33:41 +0000 (17:33 +0100)]
Merge pull request #1223 from igaw/merge-nvme-cli-monolithic

Merge nvme cli monolithic

3 years agoRename aps to apws for nvme_id_psd
Daniel Wagner [Tue, 16 Nov 2021 15:55:26 +0000 (16:55 +0100)]
Rename aps to apws for nvme_id_psd

libnvme fixed the definition for apws. Adapt nvme-cli accordingly.

See 5d14afb8dbae ("types: fix wrong bits nvme_id_psd apw[178:176],
aps[183:182]") in libnvme.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoAdd documentation files for get-latency-monitor-log
Jeff Lien [Fri, 22 Oct 2021 21:50:52 +0000 (16:50 -0500)]
Add documentation files for get-latency-monitor-log

3 years agoUpdate documentation files for vs-smart-add-log change
Jeff Lien [Fri, 22 Oct 2021 17:47:08 +0000 (12:47 -0500)]
Update documentation files for vs-smart-add-log change

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoAdd namespace id parm to vs-smart-add-log wdc plugin cmd
Jeff Lien [Fri, 22 Oct 2021 16:18:28 +0000 (11:18 -0500)]
Add namespace id parm to vs-smart-add-log wdc plugin cmd

[dwagner: ported from nvme-cli-monolithic]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoUpdate WDC plugin version to 1.15.3
Jeff Lien [Thu, 30 Sep 2021 15:01:10 +0000 (10:01 -0500)]
Update WDC plugin version to 1.15.3

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
[dwagner: ported from nvme-cli-monolithic]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoAdd capability for unique plugin version
Jeff Lien [Fri, 18 Jun 2021 15:03:33 +0000 (10:03 -0500)]
Add capability for unique plugin version

[dwagner: ported from nvme-cli-monolithic]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoAdd support for C3/Latency Monitor Log page parsing This support is for the WDC plugin
Jeff Lien [Thu, 23 Sep 2021 17:23:16 +0000 (12:23 -0500)]
Add support for C3/Latency Monitor Log page parsing This support is for the WDC plugin

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
[dwagner: ported from nvme-cli-monolithic]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoZNS report zones command fix for large number of zones When there are a large number...
Jeff Lien [Wed, 29 Sep 2021 14:50:47 +0000 (09:50 -0500)]
ZNS report zones command fix for large number of zones When there are a large number of zones, the buffer required to contain the data becomes extremely large and the linux os is unable to handle that on all systems. This change will break up the transfer of the zone data into smaller chunks - 1024 zone entries at a time and 64k bytes total.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
[dwagner: ported from nvme-cli-monolithic]
Signed-off-by: Daniel Wagner <wagner@suse.de>
3 years agozns: report zones add verbose option functionality
Steven Seungcheol Lee [Thu, 16 Sep 2021 07:51:22 +0000 (16:51 +0900)]
zns: report zones add verbose option functionality

Addtional data will be printed for ZA, ZAI on report-zones
Zone Attributes (ZA), Zone Attributes Information (ZAI)

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: updated context]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoadd json support for zns report zones
Brandon Paupore [Thu, 23 Sep 2021 19:03:02 +0000 (14:03 -0500)]
add json support for zns report zones

Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
[dwagner: added definition for json_array_add_value_string]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme-print: print generic ns chardev in verbose mode
Minwoo Im [Sat, 18 Sep 2021 01:17:15 +0000 (10:17 +0900)]
nvme-print: print generic ns chardev in verbose mode

Generic device (e.g., /dev/ng0n1) is mapped to a block device (e.g.,
/dev/nvme0n1).  This chardev can be taken in case that block device is
failed to initialize from the kernel due to some reasons (e.g.,
metadata initialization failed).  This generic node information can be
shown in the verbose list mode with HIDDEN block device (nvme0n1 in the
below example).

root@localhost:~# nvme list -v
NVM Express Subsystems

Subsystem        Subsystem-NQN                                                                                    Controllers
---------------- ------------------------------------------------------------------------------------------------ ----------------
nvme-subsys0     nqn.2019-08.org.qemu:subsys0                                                                     nvme0

NVM Express Controllers

Device   SN                   MN                                       FR       TxPort Address        Subsystem    Namespaces
-------- -------------------- ---------------------------------------- -------- ------ -------------- ------------ ----------------
nvme0    foo                  QEMU NVMe Ctrl                           1.0      pcie   0000:00:06.0   nvme-subsys0 nvme0n1, nvme0n2

NVM Express Namespaces

Device       Generic      NSID     Usage                      Format           Controllers
------------ ------------ -------- -------------------------- ---------------- ----------------
nvme0n1      ng0n1            1          0.00   B /   0.00   B      1   B +  0 B   nvme0
nvme0n2      ng0n2            2        268.44  MB / 268.44  MB      4 KiB +  0 B   nvme0

The nvme0n1 is failed to initialize and it shows 0.00 B size which is
invalid.  In this case, we can take /dev/ng0n1 alternatively from the
application through generic I/O path.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
[dwagner: - ported from nvme-cli-monolithic
          - fixed indention]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agofix list controller documentation
Gollu Appalanaidu [Wed, 8 Sep 2021 08:56:04 +0000 (14:26 +0530)]
fix list controller documentation

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
3 years agoadd identify endurance group list (cns 0x19) support
Gollu Appalanaidu [Wed, 8 Sep 2021 08:49:36 +0000 (14:19 +0530)]
add identify endurance group list (cns 0x19) support

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: ported from monolitic, removed nvme-ioctl.h/nvme.h change,
          part of libnvme]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agozns: fix(Add missing fields rrl, frl, lbafe)
Steven Seungcheol Lee [Mon, 6 Sep 2021 11:01:15 +0000 (20:01 +0900)]
zns: fix(Add missing fields rrl, frl, lbafe)

Based on NVMe-Zoned-Namespace-Command-Set-Specification-1.1a-2021.07.26-Ratified

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagmer: dropped nvme.h changes, part of libnvme]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoadd lockdown command support
Gollu Appalanaidu [Thu, 9 Sep 2021 09:22:03 +0000 (14:52 +0530)]
add lockdown command support

Signed-off-by: Karthik Balan karthik.b82@samsung.com
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: dropped nvme-ioctl.c changes, part of libnvme]
Signed-off-by: Daniel Wagner <dwagner@suse.de>