]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
3 years agoMerge pull request #1287 from ikegami-t/nvme-connet
Daniel Wagner [Fri, 17 Dec 2021 17:36:08 +0000 (18:36 +0100)]
Merge pull request #1287 from ikegami-t/nvme-connet

Print device name on connect

3 years agoPrint device name on connect
Tokunori Ikegami [Fri, 17 Dec 2021 17:01:02 +0000 (02:01 +0900)]
Print device name on connect

Commit 0ad49ad ("Print device name on connect")
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agoMerge pull request #1286 from igaw/add-ctrl-metadata-and-ns-metadata
Daniel Wagner [Fri, 17 Dec 2021 16:47:40 +0000 (17:47 +0100)]
Merge pull request #1286 from igaw/add-ctrl-metadata-and-ns-metadata

Add ctrl metadata and ns metadata

3 years agonvme-print: Add Controller Metadata and Namespace Metadata
Daniel Wagner [Fri, 17 Dec 2021 15:45:10 +0000 (16:45 +0100)]
nvme-print: Add Controller Metadata and Namespace Metadata

Port and extent the libnvme part from the commit b8a403b ("Add NVMe MI
Features: Controller Metadata (0x7E) and Namespace Metadata (0x7F).")
from the nvme-cli monolithic branch.

While at it add the missing definitions.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme-print: Resort nvme_features_ids usage
Daniel Wagner [Fri, 17 Dec 2021 15:10:39 +0000 (16:10 +0100)]
nvme-print: Resort nvme_features_ids usage

The order is not matching the definion order of the spec. Let's make
it consistent and order them according the value.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1285 from igaw/wrapdb-openssl-zlib
Daniel Wagner [Fri, 17 Dec 2021 14:38:24 +0000 (15:38 +0100)]
Merge pull request #1285 from igaw/wrapdb-openssl-zlib

build: wrapdb for OpenSSL and zlib, detect libhugetblfs

3 years agobuild: Change wording from 'required' to 'available'
Daniel Wagner [Wed, 15 Dec 2021 13:25:19 +0000 (14:25 +0100)]
build: Change wording from 'required' to 'available'

The help text is added to config.h which is a bit missleading. The
flag indicates if the library/header/feature is available not if it is
required.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Use compiler.find_library for libhugetlbfs
Daniel Wagner [Wed, 15 Dec 2021 13:22:02 +0000 (14:22 +0100)]
build: Use compiler.find_library for libhugetlbfs

libhugetlbfs is not detected via dependency() because the library
neither provides a pkg-config() nor a cmake helper. Use
compiler.find_library to figure out if the library is available.

We do not use the has_header feature of compiler.find_library()
function as this would update our minimum version for meson to
0.50.0. Instead open code it by using compiler.has_header().

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Add wrapdb support for zlib
Daniel Wagner [Wed, 15 Dec 2021 12:29:54 +0000 (13:29 +0100)]
build: Add wrapdb support for zlib

The meson wrapdb library supports also zlib. Let's add it as fallback
option to the build.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Add wrapdb support for OpenSSL
Daniel Wagner [Wed, 15 Dec 2021 12:18:06 +0000 (13:18 +0100)]
build: Add wrapdb support for OpenSSL

The meson wrapdb library has support for OpenSSL. Introduce a combo
option for full control if the user wants OpenSSL added to nvme-cli or
not. Only if the option is set to 'true' the fallback will be
considered when there is no system version of OpenSSL available.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Add subpackages contents to .gitignore
Steven Seungcheol Lee [Thu, 16 Dec 2021 08:15:08 +0000 (09:15 +0100)]
build: Add subpackages contents to .gitignore

we just need to maintain .wrap files for dependencies

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMerge pull request #1277 from igaw/add_get_log_page_fields_2.0
Daniel Wagner [Wed, 15 Dec 2021 13:44:39 +0000 (14:44 +0100)]
Merge pull request #1277 from igaw/add_get_log_page_fields_2.0

nvme: Add Command Set Idendifier and Offset Type to get_log

3 years agonvme: Add Command Set Idendifier and Offset Type to get_log
Daniel Wagner [Mon, 13 Dec 2021 14:01:28 +0000 (15:01 +0100)]
nvme: Add Command Set Idendifier and Offset Type to get_log

Add Command Set Identifier (CSI) and Offset Type (OT) support to
get_log as per the Spec 2.0.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1284 from sc108-lee/fixes
Daniel Wagner [Wed, 15 Dec 2021 10:06:09 +0000 (11:06 +0100)]
Merge pull request #1284 from sc108-lee/fixes

Fixes

3 years agoMerge pull request #1282 from bjpaupor/report-zones-json
Daniel Wagner [Wed, 15 Dec 2021 10:03:28 +0000 (11:03 +0100)]
Merge pull request #1282 from bjpaupor/report-zones-json

Fix JSON Report Zones Output

3 years agobuild: Add subpackages dirs to .gitignore
Daniel Wagner [Wed, 15 Dec 2021 08:34:20 +0000 (09:34 +0100)]
build: Add subpackages dirs to .gitignore

Add the two not tracked by git directories to .gitignore.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme-print: fix wrong log name, reorder case based on lid
Steven Seungcheol Lee [Wed, 15 Dec 2021 08:21:25 +0000 (17:21 +0900)]
nvme-print: fix wrong log name, reorder case based on lid

Log name based on spec to be aligned other logs name

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agonvme: getrandom function should be defined when sys/random.h is exist
Steven Seungcheol Lee [Wed, 15 Dec 2021 07:40:23 +0000 (16:40 +0900)]
nvme: getrandom function should be defined when sys/random.h is exist

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
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 pull request #1276 from MatiasBjorling/zns-fixes
Hannes Reinecke [Tue, 14 Dec 2021 07:06:10 +0000 (08:06 +0100)]
Merge pull request #1276 from MatiasBjorling/zns-fixes

zns: small cleanups to zrwa

3 years agozns: Documentation update and whitespace fixes
Daniel Wagner [Mon, 13 Dec 2021 18:35:00 +0000 (19:35 +0100)]
zns: Documentation update and whitespace fixes

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agozns: small cleanups to zrwa
Matias Bjørling [Mon, 13 Dec 2021 13:38:21 +0000 (13:38 +0000)]
zns: small cleanups to zrwa

A couple of cleanups for the ZRWA to align it with the existing
style.

Signed-off-by: Matias Bjørling <matias.bjorling@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