]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
3 years ago[nvme-cli] Add support for Additional SN450 Device
Jeff Lien [Tue, 18 Jan 2022 19:03:27 +0000 (13:03 -0600)]
[nvme-cli] Add support for Additional SN450 Device
Updated WDC Plugin to 1.16.1

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoMerge pull request #1318 from hreinecke/host_traddr v2.0-rc0
Daniel Wagner [Fri, 14 Jan 2022 13:31:32 +0000 (14:31 +0100)]
Merge pull request #1318 from hreinecke/host_traddr

Update to libnvme host_traddr changes

3 years agofabrics: Only disconnect discovery controllers during 'connect-all'
Hannes Reinecke [Fri, 14 Jan 2022 13:16:22 +0000 (14:16 +0100)]
fabrics: Only disconnect discovery controllers during 'connect-all'

When calling 'connect-all' the 'persistent' argument only applies to
discovery controllers; normal I/O controllers should stay connected,
as this was kinda the point...

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoRemove 'nvme-private.h'
Hannes Reinecke [Fri, 14 Jan 2022 12:29:37 +0000 (13:29 +0100)]
Remove 'nvme-private.h'

With the libnvme split this file is not used anymore.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: update for libnvme host_traddr and host_iface changes
Hannes Reinecke [Fri, 14 Jan 2022 12:28:15 +0000 (13:28 +0100)]
fabrics: update for libnvme host_traddr and host_iface changes

Libnvme moved the 'host_traddr' and 'host_iface' entries into the
fabrics configuration, so update nvme-cli to follow suit.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #1316 from jeffreyalien/new-dev-support2
Daniel Wagner [Fri, 14 Jan 2022 05:18:19 +0000 (06:18 +0100)]
Merge pull request #1316 from jeffreyalien/new-dev-support2

Add support for new PCI device ID for SN655 Drive

3 years ago[nvme-cli] Update WDC plugin version to 1.16.0
Jeff Lien [Thu, 13 Jan 2022 18:32:47 +0000 (12:32 -0600)]
[nvme-cli] Update WDC plugin version to 1.16.0

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years ago[nvme-cli] Add support for new SN655 PCI ID - 0x2722
Jeff Lien [Mon, 10 Jan 2022 22:17:25 +0000 (16:17 -0600)]
[nvme-cli] Add support for new SN655 PCI ID - 0x2722

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoMerge pull request #1314 from igaw/api-rework
Hannes Reinecke [Tue, 11 Jan 2022 14:15:59 +0000 (15:15 +0100)]
Merge pull request #1314 from igaw/api-rework

nvme: Adapt to API rework

3 years agonvme: Adapt to API rework
Daniel Wagner [Mon, 10 Jan 2022 17:29:51 +0000 (18:29 +0100)]
nvme: Adapt to API rework

libnvme changed the calling API, which uses an an argument structure
instead of passing all arguments one by one. Update all call sites
accordingly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1313 from igaw/fix-unitialized-variable
Daniel Wagner [Mon, 10 Jan 2022 16:28:29 +0000 (17:28 +0100)]
Merge pull request #1313 from igaw/fix-unitialized-variable

Fix unitialized variable

3 years agonvme: Initialize variable in passthru
Daniel Wagner [Mon, 10 Jan 2022 15:28:31 +0000 (16:28 +0100)]
nvme: Initialize variable in passthru

Always initialize huge so that we avoid reading the unitialized
variable in nvme_free().

Fixes: fb15eee3d72b ("support a meatadata file redirection for passthru").
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Add libhugetablefs to CI environment
Daniel Wagner [Mon, 10 Jan 2022 15:25:46 +0000 (16:25 +0100)]
build: Add libhugetablefs to CI environment

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1310 from linux-nvme/pt-meta
Daniel Wagner [Mon, 10 Jan 2022 08:33:47 +0000 (09:33 +0100)]
Merge pull request #1310 from linux-nvme/pt-meta

Pt meta

3 years agoupdate passthrough documentation
Keith Busch [Fri, 7 Jan 2022 17:08:55 +0000 (09:08 -0800)]
update passthrough documentation

Adding the metadata file parameter.

Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agosupport a meatadata file redirection for passthru
Keith Busch [Tue, 4 Jan 2022 17:02:55 +0000 (09:02 -0800)]
support a meatadata file redirection for passthru

The passthrough command provided a way to specific a metadata size, but
no way to save or set the data from a file. Provide an option so this is
allowed.

While we're here, it looks like the passthrough command only supported
file redirection for data-out commands. Go ahead and fix that with this
commit since the metadata needs to go both ways too.

Link: https://github.com/linux-nvme/nvme-cli/issues/1298
Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agobuild: Add provide section in libnvme.wrap
Daniel Wagner [Fri, 7 Jan 2022 17:02:36 +0000 (18:02 +0100)]
build: Add provide section in libnvme.wrap

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1297 from igaw/openssl-3-support
Daniel Wagner [Fri, 7 Jan 2022 16:46:39 +0000 (17:46 +0100)]
Merge pull request #1297 from igaw/openssl-3-support

Add OpenSSL 3 support for dhchap-key generation

3 years agonvme: Use libnvme for generating DH-HMAC-CHAP host keys
Daniel Wagner [Wed, 22 Dec 2021 13:31:16 +0000 (14:31 +0100)]
nvme: Use libnvme for generating DH-HMAC-CHAP host keys

libnvme learned to generate the keyes. Use it. With this we can also
drop the dependency on OpenSSL.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1290 from igaw/logical-block-size
Daniel Wagner [Fri, 7 Jan 2022 16:40:54 +0000 (17:40 +0100)]
Merge pull request #1290 from igaw/logical-block-size

 nvme: support ns generic device to submit_io

3 years agonvme: Use libnvme helper to retrieve logical block size
Daniel Wagner [Mon, 20 Dec 2021 15:34:35 +0000 (16:34 +0100)]
nvme: Use libnvme helper to retrieve logical block size

Use the libnvme helper nvme_get_logical_block_size to figure out the
logical block size. This way we have support for normal char
devices (nvme%d) and for generic devices (ng%d%d).

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Remove unused function decleration
Daniel Wagner [Mon, 20 Dec 2021 10:51:37 +0000 (11:51 +0100)]
nvme: Remove unused function decleration

There is no implementation for these functions and no user.
Remove it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1302 from igaw/fix-help-message-fid-support-effects-log
Daniel Wagner [Fri, 7 Jan 2022 16:34:19 +0000 (17:34 +0100)]
Merge pull request #1302 from igaw/fix-help-message-fid-support-effects-log

Fix help message fid support effects log

3 years agonvme: Fix entry short help text for fid-support-effects-log
Daniel Wagner [Tue, 28 Dec 2021 15:44:36 +0000 (16:44 +0100)]
nvme: Fix entry short help text for fid-support-effects-log

The function is to retrieve the log page information. Update the help
text accordingly and moved the entry up into the group of get_log_page
functions.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Set maximum warning level
Daniel Wagner [Mon, 27 Dec 2021 14:52:50 +0000 (15:52 +0100)]
build: Set maximum warning level

Without defining the default warning level the build system
will use the default level, which is implementation depended.
For example muon sets it to 3 which includes '-Wpendantic'.
This results in a lot of ISO-C non compliant warnings.

Let's define the warning level so that all build systems
are using the same values.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Ingore default .build directory
Daniel Wagner [Fri, 7 Jan 2022 16:28:08 +0000 (17:28 +0100)]
build: Ingore default .build directory

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1306 from igaw/build-replace-make-by-meson
Daniel Wagner [Fri, 7 Jan 2022 16:07:45 +0000 (17:07 +0100)]
Merge pull request #1306 from igaw/build-replace-make-by-meson

build: Replacing make by meson.

3 years agobuild: Replacing make by meson.
Daniel Wagner [Fri, 7 Jan 2022 10:14:20 +0000 (11:14 +0100)]
build: Replacing make by meson.

This involves replacing all Makefiles by meson.build files.
Also the top-level configure script now simply invokes meson.
The top-level Makefile is just a wrapper for meson. It supports
the following operations:

make
make test
make install
make clean    # Remove build artifacts but keep configuration
make purge    # Remove build artifacts and configuration

Based on Martin Belanger's libnvme work.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Fix *.wrap exclude pattern in .gitignore
Daniel Wagner [Fri, 7 Jan 2022 15:49:01 +0000 (16:49 +0100)]
build: Fix *.wrap exclude pattern in .gitignore

The current rules trigger git to to complain with

 $ git add subprojects/libnvme.wrap
 The following paths are ignored by one of your .gitignore files:
 subprojects

We need to keep the parent directory in the tracking
domain and just filter out all sub directories and files
except the wrap files.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1304 from jeffreyalien/master
Daniel Wagner [Fri, 7 Jan 2022 10:34:57 +0000 (11:34 +0100)]
Merge pull request #1304 from jeffreyalien/master

[nvme-cli] Fix vs-smart-add-log bug to retrieve customer id

3 years ago[nvme-cli] Fix vs-smart-add-log bug to retrieve customer id
Jeff Lien [Thu, 6 Jan 2022 15:54:02 +0000 (09:54 -0600)]
[nvme-cli] Fix vs-smart-add-log bug to retrieve customer id

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoMerge pull request #1301 from igaw/build-fix-include-config
Daniel Wagner [Wed, 29 Dec 2021 07:55:43 +0000 (08:55 +0100)]
Merge pull request #1301 from igaw/build-fix-include-config

build: cleanup and make the defines more consistent

3 years agobuild: Use _dep postfix for dependency objects
Daniel Wagner [Wed, 22 Dec 2021 09:37:10 +0000 (10:37 +0100)]
build: Use _dep postfix for dependency objects

Use consistently _dep postfix for all dependency objects.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Prefix configuration options
Daniel Wagner [Wed, 22 Dec 2021 09:35:06 +0000 (10:35 +0100)]
build: Prefix configuration options

Use the prefix CONFIG for all configuration option.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1300 from eli-schwartz/meson-fixups
Daniel Wagner [Mon, 27 Dec 2021 13:38:02 +0000 (14:38 +0100)]
Merge pull request #1300 from eli-schwartz/meson-fixups

Meson fixups

3 years agomeson: fix incorrect substitutions in configured files
Eli Schwartz [Fri, 24 Dec 2021 00:14:22 +0000 (19:14 -0500)]
meson: fix incorrect substitutions in configured files

The custom Makefile rules performed this substitution:

@@VAR@@ -> VAL

However, meson did this substitution:

@@VAR@@ -> @VAL@

This produced incorrect behavior, such as configuring a udev file to
read:

install_items+=" @/usr/etc/udev/rules.d@/70-nvmf-autoconnect.rules "

muon, meanwhile, failed loudly with:

/tmp/nvme-cli/nvmf-autoconnect/dracut-conf/70-nvmf-autoconnect.conf.in:1:19: error: key of zero length not supported
  1 | install_items+=" @@UDEVRULESDIR@@/70-nvmf-autoconnect.rules "
                        ^
/tmp/nvme-cli/meson.build:161:1: error: in function configure_file
161 | configure_file(
      ^

Since meson does not support custom token rules for configuring
replacements, and there is no real benefit to doubling the @@, just fix
this to use one @.

3 years agomeson: fix incorrect argument call to has_header()
Eli Schwartz [Fri, 24 Dec 2021 00:12:36 +0000 (19:12 -0500)]
meson: fix incorrect argument call to has_header()

It only accepts a string, but an array of strings was passed.

Due to meson internal implementation details, arguments are sometimes
flattened and this works anyway.

However, muon choked on it and errored out.

3 years agoMerge pull request #1215 from olase23/open_namespace_exclusive
Daniel Wagner [Thu, 23 Dec 2021 10:46:01 +0000 (11:46 +0100)]
Merge pull request #1215 from olase23/open_namespace_exclusive

nvme: open namespace exclusive by default

3 years agonvme: Consolidate --force option and udpate documetation
Daniel Wagner [Wed, 15 Dec 2021 09:32:37 +0000 (10:32 +0100)]
nvme: Consolidate --force option and udpate documetation

Refactor the error handling for the --force option.
Drop support for the -f and use --force consistent in all commands.
Also update the documation accordingly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: open namespace exclusive by default
Olaf Schmerse [Tue, 19 Oct 2021 10:05:59 +0000 (12:05 +0200)]
nvme: open namespace exclusive by default

All data modifying functions open the namespace exclusive. With the --force
option this can be bypassed.

Signed-off-by: Olaf Schmerse <olaf.schmerse@ionos.com>
3 years agomemblaze-nvme: remove power loss protection from smart-log-add (#1292)
jinhua2021 [Wed, 22 Dec 2021 13:37:19 +0000 (21:37 +0800)]
memblaze-nvme: remove power loss protection from smart-log-add (#1292)

* remove power loss protection from smart-log-add

Signed-off-by: jinhua2021 <jinhua.huang@memblaze.com>
3 years agoMerge pull request #1291 from igaw/meson-feature-option
Daniel Wagner [Tue, 21 Dec 2021 10:34:06 +0000 (11:34 +0100)]
Merge pull request #1291 from igaw/meson-feature-option

build: Use Feature option for OpenSSL

3 years agobuild: Use Feature option for OpenSSL
Daniel Wagner [Mon, 20 Dec 2021 16:02:19 +0000 (17:02 +0100)]
build: Use Feature option for OpenSSL

Simplify the OpenSSL logic by using meson's Feature option.

Suggested-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1288 from igaw/gen-nvme-connect-doc
Daniel Wagner [Fri, 17 Dec 2021 17:48:57 +0000 (18:48 +0100)]
Merge pull request #1288 from igaw/gen-nvme-connect-doc

Generate nvme-connect documentation

3 years agofabrics: Remove unnecessary brackets
Daniel Wagner [Fri, 17 Dec 2021 17:45:25 +0000 (18:45 +0100)]
fabrics: Remove unnecessary brackets

0ad49ade724e ("Print device name on connect") introduced the brackets
which were necessary in the orginal code base. Drop them.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agodocs: Update nvme-connect
Daniel Wagner [Fri, 17 Dec 2021 17:44:43 +0000 (18:44 +0100)]
docs: Update nvme-connect

0ad49ade724e ("Print device name on connect") added new option,
update the generated documetation.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
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>