]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
2 years agobuild: Fix appimage configuration
Daniel Wagner [Fri, 14 Apr 2023 12:22:45 +0000 (14:22 +0200)]
build: Fix appimage configuration

Typo in the arguments to the ftp upload stage. The default mode is
already correct, so just drop it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agodoc: Update REAMDE
Daniel Wagner [Fri, 14 Apr 2023 12:04:05 +0000 (14:04 +0200)]
doc: Update REAMDE

Update the build from source section and shorten the distro install
section.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update wrap mode defaults
Daniel Wagner [Thu, 13 Apr 2023 11:00:55 +0000 (13:00 +0200)]
build: Update wrap mode defaults

We switched the default of the wrap mode to nofallback. Update the CI
builds accordingly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Extend summary section
Daniel Wagner [Fri, 14 Apr 2023 07:45:03 +0000 (09:45 +0200)]
build: Extend summary section

List also the dependencies and the user configuration in the summary.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Make json-c dependency lookup not fail
Daniel Wagner [Fri, 14 Apr 2023 07:17:43 +0000 (09:17 +0200)]
build: Make json-c dependency lookup not fail

Let's relax the dependency on json-c, when the comman line option is set
to auto. It will just ignore the dependency if not found.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Disable fallback on default
Daniel Wagner [Thu, 13 Apr 2023 10:56:10 +0000 (12:56 +0200)]
build: Disable fallback on default

meson's default setting for wrap mode is to attempt to download missing
dependencies. Disable this feature as the community is unhappy with
this default behavior.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Bump libnvme wrap
Daniel Wagner [Thu, 13 Apr 2023 10:54:13 +0000 (12:54 +0200)]
build: Bump libnvme wrap

Get the wrap mode disable settings

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Bump libnvme.wrap to align create ns args
Steven Seungcheol Lee [Wed, 5 Apr 2023 04:12:13 +0000 (13:12 +0900)]
build: Bump libnvme.wrap to align create ns args

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agonvme: Add zns specfic field for create ns
Steven Seungcheol Lee [Wed, 5 Apr 2023 04:10:42 +0000 (13:10 +0900)]
nvme: Add zns specfic field for create ns

nvme_ns_mgmt_host_sw_specified_zns from TP4115 ZNS Namespace Management Enhancements 2022.03.15 Ratified

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agonvme: Add ns-mgmt host software specified fields
Steven Seungcheol Lee [Mon, 13 Feb 2023 12:28:38 +0000 (21:28 +0900)]
nvme: Add ns-mgmt host software specified fields

nphndls, phndl from TP4146 Flexible Data Placement 2022.11.30 Ratified

Reported-by: Youngjin Jung <yj4369.jung@samsung.com>
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agonvme: Add dtype, dspec on write-zeroes, write-uncor
Steven Seungcheol Lee [Thu, 9 Feb 2023 04:18:46 +0000 (13:18 +0900)]
nvme: Add dtype, dspec on write-zeroes, write-uncor

Based on TP4146 Flexible Data Placement 2022.11.30 Ratified

Reported-by: Youngjin Jung <yj4369.jung@samsung.com>
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agonvme-print: Add new fields print on id directive
Steven Seungcheol Lee [Wed, 8 Feb 2023 06:43:46 +0000 (15:43 +0900)]
nvme-print: Add new fields print on id directive

Identify Directive – Return Parameters Data Structure
From TP4146 Flexible Data Placement 2022.11.30 Ratified

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agonvme-print: Add VWCNP on NSFEAT of id-ns
Steven Seungcheol Lee [Wed, 8 Feb 2023 06:05:27 +0000 (15:05 +0900)]
nvme-print: Add VWCNP on NSFEAT of id-ns

Identify – I/O Command Set Independent Identify Namespace Data Structure
From TP4146 Flexible Data Placement 2022.11.30 Ratified

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agonvme: Fix format command to skip to reread NSID all block device
Tokunori Ikegami [Wed, 12 Apr 2023 15:30:35 +0000 (00:30 +0900)]
nvme: Fix format command to skip to reread NSID all block device

Since if NSID all specified NS data is not identified so the reread failed.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/solidigm: Fixes and clean-up of Telemetry parse code.
da Cunha, Leonardo [Thu, 16 Mar 2023 23:53:37 +0000 (16:53 -0700)]
plugins/solidigm: Fixes and clean-up of Telemetry parse code.
Fixed parsing of 64 bit values.
Fixed COD field name.
Fixed compilation warnings when compiling for 32 bit.
Added missing free().
Consolidated single entry function to telemetry parser.
Consolidated use of integer types.

2 years agodoc: Documentations maintenance changes
Tokunori Ikegami [Tue, 11 Apr 2023 16:34:47 +0000 (01:34 +0900)]
doc: Documentations maintenance changes

Change the following commands documentations.
  1. admin-passthru
  2. get-feature
  3. set-feature
  4. clear-fw-activate-history

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agodoc: Add nvme-mi-send command documentation
Tokunori Ikegami [Tue, 11 Apr 2023 16:35:53 +0000 (01:35 +0900)]
doc: Add nvme-mi-send command documentation

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agodoc: Add nvme-mi-recv command documentation
Tokunori Ikegami [Tue, 11 Apr 2023 16:16:04 +0000 (01:16 +0900)]
doc: Add nvme-mi-recv command documentation

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agodoc: Add clear-pcie-correctable-error-counters command documentation
Tokunori Ikegami [Tue, 11 Apr 2023 16:03:50 +0000 (01:03 +0900)]
doc: Add clear-pcie-correctable-error-counters command documentation

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agodoc: Add eol-plp-failure-mode command documentation
Tokunori Ikegami [Tue, 11 Apr 2023 16:01:18 +0000 (01:01 +0900)]
doc: Add eol-plp-failure-mode command documentation

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/solidigm: Add firmware activation history log to Solidigm plugin
kdedow [Thu, 30 Mar 2023 17:05:56 +0000 (10:05 -0700)]
plugins/solidigm: Add firmware activation history log to Solidigm plugin

2 years agoplugins/ocp: Add firmware activation history log to OCP plugin
kdedow [Thu, 30 Mar 2023 16:27:26 +0000 (09:27 -0700)]
plugins/ocp: Add firmware activation history log to OCP plugin

2 years agonvme-print: Use enum nvme_print_flags for nvme_show_id_ctrl
Daniel Wagner [Wed, 5 Apr 2023 12:31:25 +0000 (14:31 +0200)]
nvme-print: Use enum nvme_print_flags for nvme_show_id_ctrl

gcc is complaining that the function declaration and definition do not
match. Update the declaration accordingly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Add support for NVMe-MI send command
Tokunori Ikegami [Tue, 4 Apr 2023 17:11:57 +0000 (02:11 +0900)]
nvme: Add support for NVMe-MI send command

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme: Use stdout for passthru and submit_io commands success messages
Tokunori Ikegami [Mon, 3 Apr 2023 15:02:24 +0000 (00:02 +0900)]
nvme: Use stdout for passthru and submit_io commands success messages

Also fix submit_io command indentation errors.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme: Fix passthru command function indentation errors
Tokunori Ikegami [Sun, 2 Apr 2023 15:33:23 +0000 (00:33 +0900)]
nvme: Fix passthru command function indentation errors

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme: Add support for NVMe-MI receive command
Tokunori Ikegami [Sun, 2 Apr 2023 15:15:05 +0000 (00:15 +0900)]
nvme: Add support for NVMe-MI receive command

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agofabrics: fix fc config JSON file handling
Martin George [Tue, 4 Apr 2023 09:29:09 +0000 (14:59 +0530)]
fabrics: fix fc config JSON file handling

Unlike other nvme transports, nvme/fc connection requires a valid
host_traddr in addition to traddr and transport type. Current fc
config JSON handling is broken due to the host_traddr not getting
updated even if explicitly listed in the JSON file, as shown below:

nvme connect-all -J /usr/local/etc/nvme/config.json
Failed to write to /dev/nvme-fabrics: Invalid argument

And the below error is logged in the messages file for the same:

nvme_fabrics: missing parameter 'host_traddr=%s'

Fix this by ensuring the relevant host_traddr string is appropriately
passed to the respective nvme controller structure. And while we are
at it, ensure the host_iface string is updated too but noting that it
is only applicable to tcp alone, and not rdma or fc.

Signed-off-by: Martin George <marting@netapp.com>
2 years agobuild: Fetch all references before using git describe
Daniel Wagner [Wed, 5 Apr 2023 06:27:53 +0000 (08:27 +0200)]
build: Fetch all references before using git describe

The release script is using git describe to get the references string of
the library. The returned string validated if it is a valid release
string, e.g. v1.4. If not we abort the operation.

Thus we need to make sure that we have all references including the
tags, thus do a git fetch --all first.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Deploy AppImage only for push on master
Daniel Wagner [Mon, 3 Apr 2023 14:51:21 +0000 (16:51 +0200)]
build: Deploy AppImage only for push on master

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild(deps): bump sand4rt/ftp-deployer from 1.4 to 1.7
dependabot[bot] [Mon, 3 Apr 2023 14:41:53 +0000 (14:41 +0000)]
build(deps): bump sand4rt/ftp-deployer from 1.4 to 1.7

Bumps [sand4rt/ftp-deployer](https://github.com/sand4rt/ftp-deployer) from 1.4 to 1.7.
- [Release notes](https://github.com/sand4rt/ftp-deployer/releases)
- [Commits](https://github.com/sand4rt/ftp-deployer/compare/v1.4...v1.7)

---
updated-dependencies:
- dependency-name: sand4rt/ftp-deployer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild: Use sftp transport for AppImage deploy step
Daniel Wagner [Mon, 3 Apr 2023 14:08:41 +0000 (16:08 +0200)]
build: Use sftp transport for AppImage deploy step

Also split deploy strep from build step.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Add external AppImage upload workflow
Daniel Wagner [Mon, 3 Apr 2023 12:27:36 +0000 (14:27 +0200)]
build: Add external AppImage upload workflow

After building the AppImage upload it to an external server.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agodoc: Regenerate all docs for v2.4 v2.4
Daniel Wagner [Fri, 31 Mar 2023 14:17:49 +0000 (16:17 +0200)]
doc: Regenerate all docs for v2.4

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update version to v2.4
Daniel Wagner [Fri, 31 Mar 2023 14:17:26 +0000 (16:17 +0200)]
build: Update version to v2.4

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Bump libnvme to v1.4
Daniel Wagner [Fri, 31 Mar 2023 14:11:44 +0000 (16:11 +0200)]
build: Bump libnvme to v1.4

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/ocp: Add SMART cloud log to solidigm plugin
kdedow [Thu, 30 Mar 2023 00:08:05 +0000 (17:08 -0700)]
plugins/ocp: Add SMART cloud log to solidigm plugin

2 years agonvme-print: Unify number base format for nsid
Minwoo Im [Sun, 26 Mar 2023 11:06:49 +0000 (20:06 +0900)]
nvme-print: Unify number base format for nsid

`nvme list` is one of the most frequently used subcommand to list up
nvme devices in the system.  `nvme list -v` prints much more detail in
it.  But, those two commands have different number base format which are
decimal and hexadecimal without any prefix (e.g., 0x) or something.

nvme list -v shows hexadecimal nsid without `0x` which means it might be
confused between decimal and hexadecimal.  To unify this, this patch
expands device NSID fields width from 8 to 10 to cover `0x` two chracters
as a prefix for both `nvme list` and `nvme list -v`.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
2 years agonvme-(discover,connect,connect-all): enable options '--keyring' and '--tls_key'
Hannes Reinecke [Thu, 23 Mar 2023 15:14:53 +0000 (16:14 +0100)]
nvme-(discover,connect,connect-all): enable options '--keyring' and '--tls_key'

Enable the options '--keyring' and '--tls_key' to select the key
for TLS encrypted connections.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agonvme-connect: enable option '--tls'
Hannes Reinecke [Thu, 23 Mar 2023 15:14:53 +0000 (16:14 +0100)]
nvme-connect: enable option '--tls'

Enable the option '--tls' to activate TLS encrypted connections.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agonvme-check-tls-key: add options to derive a 'retained' TLS key
Hannes Reinecke [Wed, 22 Mar 2023 14:58:27 +0000 (15:58 +0100)]
nvme-check-tls-key: add options to derive a 'retained' TLS key

Add options to derive a 'retained' TLS key and store it into the given keyring.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agonvme-gen-tls-key: add options to derive a TLS key
Hannes Reinecke [Wed, 22 Mar 2023 14:58:27 +0000 (15:58 +0100)]
nvme-gen-tls-key: add options to derive a TLS key

Add options to derive a TLS key and store it into the given keyring.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Mon, 27 Mar 2023 13:30:14 +0000 (15:30 +0200)]
build: Update libnvme wrap

The Python command line option type has changed, thus we need to update
the CI build accordingly.

While at it also add a name to the build and test step.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/ocp: Move SMART cloud log methods to separate file for reusability
kdedow [Wed, 22 Mar 2023 00:27:24 +0000 (17:27 -0700)]
plugins/ocp: Move SMART cloud log methods to separate file for reusability

2 years agonvme: validate storage tag size correctly
Laiwenhu [Thu, 23 Mar 2023 08:30:55 +0000 (16:30 +0800)]
nvme: validate storage tag size correctly

The minimum and maximum value for the tag size are not correct
for the 64b case. Update them according the specification.

See also 'Figure 101: Extended LBA Format Data Structure, NVM Command
Set Specific' in NVM Command Set Specification.

[dwagner: updated commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print-json: Add json output status function
Tokunori Ikegami [Sat, 25 Mar 2023 02:36:10 +0000 (11:36 +0900)]
nvme-print-json: Add json output status function

For the json output add json argconfig option also.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoutil: Cleanup argconfig parse function
Tokunori Ikegami [Fri, 24 Mar 2023 17:37:59 +0000 (02:37 +0900)]
util: Cleanup argconfig parse function

1. Split to parse config type function
2. Change if else statement to switch case statement
3. Use calloc instead of malloc
4. Delete unused while 0 statement
5. Add argconfig error common function

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme: Fix format command function indentation errors
Tokunori Ikegami [Wed, 22 Mar 2023 15:35:00 +0000 (00:35 +0900)]
nvme: Fix format command function indentation errors

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoutil: Use argconfig commandline options pointer directly
Tokunori Ikegami [Wed, 22 Mar 2023 15:29:30 +0000 (00:29 +0900)]
util: Use argconfig commandline options pointer directly

Also change print help function options argument as not const variable.
Fix ";;" also incorrectly used to ";".

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme-print: Fix nvme show status function indentation errors
Tokunori Ikegami [Thu, 23 Mar 2023 16:59:41 +0000 (01:59 +0900)]
nvme-print: Fix nvme show status function indentation errors

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme: Check fw-commit command support MUD
Tokunori Ikegami [Thu, 23 Mar 2023 11:22:08 +0000 (20:22 +0900)]
nvme: Check fw-commit command support MUD

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoprint: print csi and opcode in error log (TP4113)
Minwoo Im [Wed, 8 Mar 2023 23:52:54 +0000 (08:52 +0900)]
print: print csi and opcode in error log (TP4113)

Print newly added fields in the error information log page to show which
command is errored by opcode. This commit is based on TP4113.

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
2 years agobuild: Bump up libnvme wrap
Minwoo Im [Wed, 22 Mar 2023 21:52:34 +0000 (06:52 +0900)]
build: Bump up libnvme wrap

To fetch newly added the opcode filed in error log in nvme/types.h.

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
2 years agoplugins/inspur: Cast vendor specific smart log value
Daniel Wagner [Wed, 22 Mar 2023 16:17:42 +0000 (17:17 +0100)]
plugins/inspur: Cast vendor specific smart log value

nvme_get_log_simple expects an 'enum nvme_cmd_get_log_lid' type. Cast
the vendor specific value as clang reports this as warning.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Use correct ABORT type for self abort test
Daniel Wagner [Wed, 22 Mar 2023 16:14:12 +0000 (17:14 +0100)]
nvme: Use correct ABORT type for self abort test

The enum type is not matching, use the correct one.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/solidigm: Do not overwrite previously initialized variable
Daniel Wagner [Wed, 22 Mar 2023 16:06:49 +0000 (17:06 +0100)]
plugins/solidigm: Do not overwrite previously initialized variable

clang reports that .uuidx are initialized twice. Remove the default
initialize value.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Add action build back
Daniel Wagner [Wed, 22 Mar 2023 15:45:08 +0000 (16:45 +0100)]
build: Add action build back

The test target is only the building the minimal dependencies, thus not
the complete code base build. Add the build step back.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: sanitize supported-log-pages output
Martin George [Wed, 22 Mar 2023 06:36:55 +0000 (12:06 +0530)]
nvme-print: sanitize supported-log-pages output

The current nvme supported-log-pages output is a little cryptic
as seen below:

Support Log Pages Details for nvme1n1:
LID 0x0 (Supported Log Pages), supports 0x3

LID 0x1 (Error Information), supports 0x3
...

So sanitize this output to make it more meaningful with better
formatting. This should apply to the verbose output as well.
With these changes, the sanitized normal output should show up
as follows:

Support Log Pages Details for nvme1n1:
LID 0x0 - Supported Log Pages
LID 0x1 - Error Information
...

And the sanitized verbose output would show up as:

Support Log Pages Details for nvme1n1:
LID 0x0 - Supported Log Pages
  LSUPP is supported
  IOS is supported
LID 0x1 - Error Information
  LSUPP is supported
  IOS is supported
...

Signed-off-by: Martin George <marting@netapp.com>
2 years agonvme: Enforce length to a multiple of 4 in get_log_page
duanhaoqiang [Wed, 15 Mar 2023 10:20:59 +0000 (18:20 +0800)]
nvme: Enforce length to a multiple of 4 in get_log_page

When calculating NUMDL and NUMDU we assume that the controller is only
able to handle dword aligment (see Figure 117: SGL Data Block
descriptor).

Hence we just need to allocate a buffer which is a multiple of 4.

[dwagner: added commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: fix block count and data size logic
Martin George [Tue, 21 Mar 2023 08:49:11 +0000 (14:19 +0530)]
nvme: fix block count and data size logic

The required block count and data size is not automatically set
for a namespace device in submit_io(). Also it is the user specified
block count and not the actual required block count that is passed
to the ioctl data structure, often leading to nvme passthrough io
errors. For e.g. an nvme read on a 512b block size namespace device
with data size set to 4K ends up with the below error:

nvme read /dev/nvme0n1 -s 0 -z 4096
NVMe status: Data SGL Length Invalid: The length of a Data SGL is too
short or too long and the controller does not support SGL transfers
longer than the amount of data to be transferred(0x400f)

This read is successful only when the appropriate block count is
passed from the command line:

nvme read /dev/nvme0n1 -s 0 -z 4096 -c 7
read: Success

So fix this by deriving the required block count and data size based
on the logical block size and passing them appropriately to the
respective ioctl data structure. And while we are at it, remove a
couple of superfluous braces in this part of the code.

Signed-off-by: Martin George <marting@netapp.com>
2 years agoutil: Introduce argconfig simple helper to check seen condition
Tokunori Ikegami [Mon, 20 Mar 2023 13:11:22 +0000 (22:11 +0900)]
util: Introduce argconfig simple helper to check seen condition

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/ocp: Add set feature EOL/PLP failure mode no-uuid option
Tokunori Ikegami [Thu, 16 Mar 2023 16:38:07 +0000 (01:38 +0900)]
plugins/ocp: Add set feature EOL/PLP failure mode no-uuid option

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/ocp: Refactor to clear feature identifier C1h and C3h
Tokunori Ikegami [Thu, 16 Mar 2023 16:14:09 +0000 (01:14 +0900)]
plugins/ocp: Refactor to clear feature identifier C1h and C3h

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/ocp: Add support for clear PCIe correctable error counters feature
Tokunori Ikegami [Wed, 15 Mar 2023 17:01:51 +0000 (02:01 +0900)]
plugins/ocp: Add support for clear PCIe correctable error counters feature

Allow argconfig to set NULL default value to check seen flag parameter only.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme-doc: update man page for supported-log-pages
Martin George [Sat, 11 Mar 2023 05:49:37 +0000 (11:19 +0530)]
nvme-doc: update man page for supported-log-pages

There is no human-readable option implemented for nvme
supported-log-pages. Instead there is only a verbose option.
So update the respective man page to reflect the same.

Signed-off-by: Martin George <marting@netapp.com>
2 years agoplugins/ocp: OCP 2.0 field updates for SMART cloud log
kdedow [Wed, 1 Mar 2023 16:09:52 +0000 (08:09 -0800)]
plugins/ocp: OCP 2.0 field updates for SMART cloud log

- Add power state change field
- Parse full two bytes for point version and minor version fields

2 years agobuild: Print option summary
Martin Belanger [Wed, 15 Mar 2023 19:49:43 +0000 (15:49 -0400)]
build: Print option summary

At the end of the meson setup command, display the options so that
we can quickly determine that we're configured the project properly

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
[dwagner: ported this from libnvme to nvme-cli]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Fix parameter limit range
Steven Seungcheol Lee [Wed, 15 Mar 2023 05:40:30 +0000 (14:40 +0900)]
nvme: Fix parameter limit range

3 Bits - Max value 7
SEL : Bits [10:08] of Get Features Command Dword 10

4 Bits - Max value 15
OWPASS : Bits [07:04] of Sanitize – Command Dword 10

7 Bits - Max value 127
LSP : Bits [14:08] of Get Log Page Command Dword 10
UUID Index : Bits [06:00] of Get Log Page, Get Features, Set Features Command Dword 14

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agofdp: Fix wrong Reclaim Unit Handle Status size
Steven Seungcheol Lee [Mon, 13 Mar 2023 05:55:04 +0000 (14:55 +0900)]
fdp: Fix wrong Reclaim Unit Handle Status size

size should include reserved, NRUHSD bytes
that exist before Reclaim Unit Handle Status Descriptor List

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agoplugins/ocp: Add support for EOL/PLP failure mode feature
Tokunori Ikegami [Thu, 9 Mar 2023 17:42:53 +0000 (02:42 +0900)]
plugins/ocp: Add support for EOL/PLP failure mode feature

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agobuild: Upload all log files on failure
Daniel Wagner [Tue, 14 Mar 2023 13:56:57 +0000 (14:56 +0100)]
build: Upload all log files on failure

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Initialize sysconfdir
Daniel Wagner [Tue, 14 Mar 2023 13:11:36 +0000 (14:11 +0100)]
build: Initialize sysconfdir

The default sysconfdir needs to be initialize so that Meson and muon
expand to the same final result using join_paths().

Fixes: 432a49732bf7 ("build: Use prefixdir directly on sysconfdir")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Fix printing of u32 values
Caleb Sander [Thu, 9 Mar 2023 16:29:06 +0000 (09:29 -0700)]
nvme-print: Fix printing of u32 values

Fields HMPRE, HMMIN, and NN in the Identify Controller data structure
are 32-bit unsigned values but are being printed as signed integers.
Print them using %u so large values are not displayed as negative ones.
Also make JSON uint objects use uint64 instead of int64 internally
so u32 values are stored accurately.

Signed-off-by: Caleb Sander <csander@purestorage.com>
2 years agonvme: Fix invalid memory access in show_registers
Martin Joerg [Wed, 8 Mar 2023 11:52:29 +0000 (12:52 +0100)]
nvme: Fix invalid memory access in show_registers

In case nvme_get_property fails, nvme_get_properties frees the allocated memory.
The memory should not be accessed and freed again in show_registers.

Signed-off-by: Martin Joerg <martin.joerg@gmail.com>
2 years agoutil: Add argconfig seen flag parameter to check if feature NSID set
Tokunori Ikegami [Wed, 1 Mar 2023 14:51:46 +0000 (23:51 +0900)]
util: Add argconfig seen flag parameter to check if feature NSID set

To set the flag parameter change options arguments as not const variables.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme-print: fix segfault in supported-log-pages json output
Martin George [Tue, 7 Mar 2023 11:09:54 +0000 (16:39 +0530)]
nvme-print: fix segfault in supported-log-pages json output

nvme supported-log-pages -o json currently segfaults due to the
wrong json object type as shown below:

nvme: json_object.c: json_object_array_add: Assertion `json_object_get_type(jso) == json_type_array' failed.
Aborted (core dumped)

Fix this by passing the appropriate json type.

Signed-off-by: Martin George <marting@netapp.com>
2 years agofabrics: Fix ordering for auto connect services
Daniel Wagner [Tue, 7 Mar 2023 09:24:01 +0000 (10:24 +0100)]
fabrics: Fix ordering for auto connect services

In order to be able to mount file systems via /etc/fstab we have to
make sure that the corresponding auto connect services have been
executed. Because the mounting of the local filesystem happens very
early in the boot we have to carefully sort these service file into the
boot process.

First, we have to disable the DefaultDependency as this will
automatically add dependency on sysinit.target which is too late (after
local mounts). Though without the default dependency we have to provide
a Before and After conditions.

The Before is simple as we have a local-fs-pre target. The After
is a bit tricky as there are no targets available.

Because the whole autoconnect machinery depends on udev events being
delivered we place the service after systemd-udevd has been started.

Link: https://www.freedesktop.org/software/systemd/man/bootup.html
Reported-by: Maurizio Lombardi <mlombard@redhat.com>
Reported-by: Wen Xiong <wenxiong@linux.ibm.com>
Tested-by: Maurizio Lombardi <mlombard@redhat.com>
Tested-by: Wen Xiong <wenxiong@linux.ibm.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme.c: Check Firmware Update Granularity in fwdl
Steven Seungcheol Lee [Fri, 3 Mar 2023 07:44:55 +0000 (16:44 +0900)]
nvme.c: Check Firmware Update Granularity in fwdl

FWUG indicates the granularity and alignment requirement of the
firmware image being updated by the Firmware Image Download command

FWUG is reported in 4 KiB units
0h indicates that no information on granularity is provided
FFh indicates there is no restriction
so when this is 0 value, use 4 KiB split as a default

Do not override when xfer is given by user
-> Support for ignore fwug in (fwug>mdts) case

Reviewed-by: Keith Busch <keith.busch@gmail.com>
Reported-by: Minsik Jeon <hmi.jeon@samsung.com>
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agolog: high latency timestamp issue
丁剑 [Sun, 19 Feb 2023 07:43:07 +0000 (15:43 +0800)]
log: high latency timestamp issue

1. The old nvme-cli set-feature uses 32bit to represent timestamp, but the spec definition is 48bit.
2. memblaze made a slight correction to allow for overflow.
3. Now this correction is no longer needed.

Signed-off-by: 丁剑 <djukyo@gmail.com>
2 years agonvme: Align get feature data buffer length by page size to allocate
Tokunori Ikegami [Mon, 27 Feb 2023 16:23:01 +0000 (01:23 +0900)]
nvme: Align get feature data buffer length by page size to allocate

Since a memory error caused by some features as data corrupted over length.
Also the issue can be resolved by the change to align the data length.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme: Continue get feature on invalid NS error to get multiple feature ids
Tokunori Ikegami [Fri, 24 Feb 2023 15:54:24 +0000 (00:54 +0900)]
nvme: Continue get feature on invalid NS error to get multiple feature ids

Some features returned invalid NS if NSID all 0xffffffff default specified.
Also print get feature ID for invalid NS error to get multiple feature ids.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/ocp: SMART cloud log bug fixes.
kdedow [Mon, 27 Feb 2023 20:56:20 +0000 (12:56 -0800)]
plugins/ocp: SMART cloud log bug fixes.

- Fix incorrect SMART cloud log description
- Fix SMART cloud log end-to-end correction offsets

2 years agoMade temperature readouts in line with the SI.
Vishal Pankaj Chandratreya [Tue, 28 Feb 2023 05:10:00 +0000 (10:40 +0530)]
Made temperature readouts in line with the SI.

* The unit name 'kelvin' is written in lowercase, unless it starts a sentence. However, its plural 'kelvins' is more appropriate because of the context.
* Added a space between the number and the unit (e.g. 30 °C or 303 K).
* Wherever '°C' and 'kelvin' appeared in the same context, the latter is replaced with 'K'.

Ref.: *The International System of Units*, 9th edition (2019, updated 2022), Bureau International des Poids et Mesures

2 years agoChanged 'Kelvin' to 'kelvin', as recommended by the BIPM.
Vishal Pankaj Chandratreya [Sun, 26 Feb 2023 12:02:03 +0000 (17:32 +0530)]
Changed 'Kelvin' to 'kelvin', as recommended by the BIPM.

2 years agoplugins/ocp: Fix whitespace and style issues
Dedow, Karl [Thu, 16 Feb 2023 21:07:25 +0000 (13:07 -0800)]
plugins/ocp: Fix whitespace and style issues

As reported by a code linter results in OCP plugin

[dwagner:
 - lot's of manual cleanup
 - fixed non white space changes reported by checktool
 - verified result with 'git diff --word-diff'
]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoutil: Revert JSON output to plain numbers
Tokunori Ikegami [Fri, 17 Feb 2023 13:53:26 +0000 (22:53 +0900)]
util: Revert JSON output to plain numbers

Add explicit a localization stringify function for uint128_t types.
Also set serializer to generate a number instead of a string.

Fixes: 2a8bc94 ("nvme-print: Display smart log data units read and written SI value")
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[dwagner: introduce an explicit l10 function]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Add rae argument to telemetry-log command
Daniel Wagner [Wed, 15 Feb 2023 16:52:35 +0000 (17:52 +0100)]
nvme: Add rae argument to telemetry-log command

Allow to clear the rae bit for the telemetry-log command.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Refactor get telemetry log page helper
Daniel Wagner [Wed, 15 Feb 2023 15:56:28 +0000 (16:56 +0100)]
nvme: Refactor get telemetry log page helper

Refactor the helper to use explicit code paths instead of conditions to
steer the code flow. This is way simpler to read and the resulting code
size is only growing 88 bytes.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Factor out parse telemetry log da element
Daniel Wagner [Wed, 15 Feb 2023 14:05:00 +0000 (15:05 +0100)]
nvme: Factor out parse telemetry log da element

Make get_telemtetry_log_helper a bit more readable.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Fix type in error message
Daniel Wagner [Wed, 15 Feb 2023 14:02:07 +0000 (15:02 +0100)]
nvme: Fix type in error message

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Add muon build target
Daniel Wagner [Fri, 10 Feb 2023 15:09:54 +0000 (16:09 +0100)]
build: Add muon build target

Build nvme-cli using muon.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agounit: Add test-argconfig-parse
Tokunori Ikegami [Thu, 16 Feb 2023 18:33:29 +0000 (03:33 +0900)]
unit: Add test-argconfig-parse

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agobuild: Add s390x cross build and enable cross tests
Daniel Wagner [Thu, 16 Feb 2023 16:06:19 +0000 (17:06 +0100)]
build: Add s390x cross build and enable cross tests

Enable s390x cross builds and also run all tests when building cross.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update CI build targets
Daniel Wagner [Thu, 16 Feb 2023 08:08:23 +0000 (09:08 +0100)]
build: Update CI build targets

Update the CI build targets so we cover a bit more configuration space.

- Build release and debug builds
- Build with clang
- Cleanup the depdency list, e.g. Drop the libdbus dependency
- Do not fail on libnvme warnings, we need to catch them
  in the libnvme project.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Use chunked read in get_log()
Daniel Wagner [Wed, 15 Feb 2023 11:35:10 +0000 (12:35 +0100)]
nvme: Use chunked read in get_log()

Large transfer might not work because we exhaust resource limits, so
chunk the read into 4k (default).

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Use fprintf for error message logging in get_log()
Daniel Wagner [Wed, 15 Feb 2023 11:28:01 +0000 (12:28 +0100)]
nvme: Use fprintf for error message logging in get_log()

perror uses the errno variable which is likely set to 0, which leads to
error messages like

  non-zero log-len is required param: Success

Use fprintf and write to stderr the error messages.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Bump libnvme wrap
Daniel Wagner [Thu, 16 Feb 2023 07:38:55 +0000 (08:38 +0100)]
build: Bump libnvme wrap

Fetch the new nvme_mi_admin_get_log_page() function.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: fix /dev/spkd/ typo
Stefan Hajnoczi [Wed, 15 Feb 2023 15:46:34 +0000 (10:46 -0500)]
nvme: fix /dev/spkd/ typo

SPDK NVMe character devices are located at /dev/spdk/ according to the
documentation (https://spdk.io/doc/nvme.html#nvme_cuse). Fix the typo.

Fixes: 6c9f792f99aa8782b32635c44e3a573bbb36c830 ("nvme: Print full device path")
Cc: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 years agodoc: --storage-tag-check doesn't take any arguments
Daniel Wagner [Fri, 10 Feb 2023 13:12:33 +0000 (14:12 +0100)]
doc: --storage-tag-check doesn't take any arguments

Update the documentation on --storage-tag-check. This command line
option is a boolean flag and doesn't take any arguments.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Ensure host-traddr/iface consistency for "connect-all"
Martin Belanger [Fri, 10 Feb 2023 16:56:36 +0000 (11:56 -0500)]
fabrics: Ensure host-traddr/iface consistency for "connect-all"

When using "connect-all --device" without specifying the options
--host-traddr and --host-iface, the children connections may not
have the same host-traddr/host-iface as the connection to the
discovery controller (DC).

This is specific to the --device option where one reuses a
persistent connection to a discovery controller to update the
discovery log pages (DLP) and connect to new controllers listed in
the new DLP. If --device is used w/o also specifying --host-traddr
and --host-iface, then the new connections may not use the same
attributes that were used for the DC connection.

This patch checks if --host-traddr and --host-iface have been
provided, and if not, it will use the DC's --host-traddr and
--host-iface for the new connections made as a result of changes
to the DLP.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>