]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
2 years agonvme: Masks SSTAT in sanize-log output
Daniel Wagner [Thu, 25 Aug 2022 07:36:16 +0000 (09:36 +0200)]
nvme: Masks SSTAT in sanize-log output

The sanitize->sstat needs to be mask. We do this for the JSON output
but not for the normal shell output.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1649 from CodeConstruct/parse-retval
Daniel Wagner [Thu, 25 Aug 2022 06:24:43 +0000 (08:24 +0200)]
Merge pull request #1649 from CodeConstruct/parse-retval

tree: fail on non-negative return values from parse_and_open

2 years agotree: fail on non-negative return values from parse_and_open
Jeremy Kerr [Wed, 24 Aug 2022 01:20:53 +0000 (09:20 +0800)]
tree: fail on non-negative return values from parse_and_open

Currently, we see a warning with specific compilers:

  ../nvme/nvme.c: In function 'ns_rescan':
  ../nvme/nvme.c:4389:19: warning: 'dev' may be used uninitialized in this function [-Wmaybe-uninitialized]

This is due to a theoretical failure path in parse_and_open(), where
argconfig_parse() returns a positive value - this would require the
global errno to be negative.

Even though the unintialised use of dev is only possible with negative
error (which shouldn't happen), we should still consider any non-zero
return value of parse_and_open a failure. This change fixes the
instances of:

    err = parse_and_open(...);
    if (err < 0)

changing to:

    err = parse_and_open(...);
    if (err)

... and also applies this to the single use of open_exclusive().

The positive return values from parse_and_open() were removed in
11542bbd; beforehand, parse_and_open() would return a fd.

Fixes: 11542bbd ("tree: Combine NVMe file descriptor into struct nvme_dev")
Fixes: https://github.com/linux-nvme/nvme-cli/issues/1647
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #1646 from jeffreyalien/master
Daniel Wagner [Tue, 23 Aug 2022 06:08:22 +0000 (08:08 +0200)]
Merge pull request #1646 from jeffreyalien/master

print: Add Controller Ready Timeout Exceeded HW error code

2 years agoprint: Add Controller Ready Timeout Exceeded HW error code
Jeff Lien [Fri, 19 Aug 2022 21:23:18 +0000 (16:23 -0500)]
print: Add Controller Ready Timeout Exceeded HW error code

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
2 years agoMerge pull request #1643 from jeffreyalien/master
Daniel Wagner [Thu, 18 Aug 2022 11:23:13 +0000 (13:23 +0200)]
Merge pull request #1643 from jeffreyalien/master

wdc:  OCP Log page updates and fixes

2 years agowdc: OCP Log page updates and fixes
Jeff Lien [Wed, 3 Aug 2022 13:34:04 +0000 (08:34 -0500)]
wdc:  OCP Log page updates and fixes

Add support for Version 1 Error Recovery log page
Fix fw-activate-history timestamp json data
Update OCP log page capabiliites for SN550, SN650,
  and SN655

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
2 years agoMerge pull request #1642 from CodeConstruct/mi
Daniel Wagner [Wed, 17 Aug 2022 06:35:59 +0000 (08:35 +0200)]
Merge pull request #1642 from CodeConstruct/mi

MI: Add (and use) `nvme_cli_*` wrappers for more admin functions

2 years agonvme: Add wrappers for Get Log page helpers
Jeremy Kerr [Wed, 20 Jul 2022 04:28:40 +0000 (12:28 +0800)]
nvme: Add wrappers for Get Log page helpers

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Add wrapper for Sanitize NVM
Jeremy Kerr [Wed, 20 Jul 2022 02:22:39 +0000 (10:22 +0800)]
nvme: Add wrapper for Sanitize NVM

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Add wrapper for Format NVM
Jeremy Kerr [Tue, 19 Jul 2022 09:46:39 +0000 (17:46 +0800)]
nvme: Add wrapper for Format NVM

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Add wrappers for NS attach/detach
Jeremy Kerr [Tue, 19 Jul 2022 09:09:23 +0000 (17:09 +0800)]
nvme: Add wrappers for NS attach/detach

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Add wrappers for Identify controller lists
Jeremy Kerr [Tue, 19 Jul 2022 06:27:02 +0000 (14:27 +0800)]
nvme: Add wrappers for Identify controller lists

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Add wrappers for NS management functions
Jeremy Kerr [Thu, 14 Jul 2022 07:51:13 +0000 (15:51 +0800)]
nvme: Add wrappers for NS management functions

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Add wrappers for basic NS identify
Jeremy Kerr [Thu, 14 Jul 2022 07:44:05 +0000 (15:44 +0800)]
nvme: Add wrappers for basic NS identify

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Add nvme_cmd wrapper for get_features
Jeremy Kerr [Thu, 14 Jul 2022 06:35:27 +0000 (14:35 +0800)]
nvme: Add nvme_cmd wrapper for get_features

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agosubprojects/libnvme: update for MI admin command coverage
Jeremy Kerr [Wed, 17 Aug 2022 05:08:58 +0000 (13:08 +0800)]
subprojects/libnvme: update for MI admin command coverage

In upcoming changes, we'll want to use the expanded Admin command
coverage for the MI transport. This change bumps to the merge commit
adding that support:

    commit 501347ffdf6321d42ceabf173792c95bd44dac0d
    Merge: 0e4d1ce d60b04b
    Author: Daniel Wagner <dwagner@suse.de>
    Date:   Tue Aug 16 08:59:33 2022 +0200

Merge pull request #457 from CodeConstruct/mi+admin

MI: expand admin command implementation

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #1641 from igaw/add-json-uint64-helper
Daniel Wagner [Tue, 16 Aug 2022 16:07:54 +0000 (18:07 +0200)]
Merge pull request #1641 from igaw/add-json-uint64-helper

json: Support uint64 types serialization for older json-c versions

2 years agojson: Support uint64 types serialization for older json-c versions
Daniel Wagner [Tue, 16 Aug 2022 06:12:24 +0000 (08:12 +0200)]
json: Support uint64 types serialization for older json-c versions

Notable json-c 0.13 is lacking support for serializing uint64_t
types. At this point of writing the 0.13 version is widely
deployed. Let's add our own version of the serialization function as
fallback.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Introduce nvme_cli_ wrappers, wrap identify and identify_ctrl
Jeremy Kerr [Thu, 14 Jul 2022 05:59:46 +0000 (13:59 +0800)]
nvme: Introduce nvme_cli_ wrappers, wrap identify and identify_ctrl

This change introduces the first of the libnvme wrapper functions. These
have a nvme_cli_ prefix, and wrap the correspondingly-named libnvme
function.

This allows us to call the correct libnvme transport-specific function,
depending on whether this is a direct or MI device.

This requires an update to a more recent libnvme, for the mi version of
the identify functions.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agotree: Add NVMe-MI support
Jeremy Kerr [Wed, 13 Jul 2022 06:56:59 +0000 (14:56 +0800)]
tree: Add NVMe-MI support

Now that we have a struct containing the NVMe device file descriptor, we
can abstract this to support different transport types.

This change adds support for NVMe-MI transports, by adding a `mi` member
to struct nvme_dev's union, and allowing devices to be specified by an
MCTP address:

    mctp:<network>,<endpoint-id>:<controller-id>

- where the `controller-id` is optional, and defaults to 0 if not
specified.

For this, we need to add suitable linkage to the libnvme-mi component of
the libnvme codebase.

None of the actual commands can use the MI transport at present, as they
currently assume access to dev->direct.fd. We will add facilities for
that in upcoming changes.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Introduce a union in struct nvme_dev for different transport types
Jeremy Kerr [Wed, 13 Jul 2022 05:19:24 +0000 (13:19 +0800)]
nvme: Introduce a union in struct nvme_dev for different transport types

This change modifies struct nvme_dev to allow for future transport
types, by moving the transport-specific data into a union. We will add
new types in a future change.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agotree: Add dev_fd() helper
Jeremy Kerr [Wed, 13 Jul 2022 03:07:51 +0000 (11:07 +0800)]
tree: Add dev_fd() helper

We'll want to abstract the access to the direct-ioctl fd in a future
change, so add a simple helper for access to the fd member of
struct nvme_dev.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Remove static nvme_dev, allocate on open instead
Jeremy Kerr [Tue, 12 Jul 2022 10:09:39 +0000 (18:09 +0800)]
nvme: Remove static nvme_dev, allocate on open instead

This change completes the transition to a all-local device data. Instead
of using the static nvme_dev, allocate a struct nvme_dev instead, and
free on dev_close()

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Make static nvme_dev private to open_dev(), use locals elsewhere
Jeremy Kerr [Tue, 12 Jul 2022 10:05:39 +0000 (18:05 +0800)]
nvme: Make static nvme_dev private to open_dev(), use locals elsewhere

Currently nvme_dev is private to nvme.c, with file-scoped access to the
variable.

This reduces the scope of nvme_dev to just open_dev(), and uses locals
for all other references.

We'll change this to an allocated variable in an upcoming change.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Use local struct nvme_dev for show_registers & map_registers
Jeremy Kerr [Tue, 12 Jul 2022 09:51:47 +0000 (17:51 +0800)]
nvme: Use local struct nvme_dev for show_registers & map_registers

show_registers() and map_registers() use the global nvme_dev; change to
a local passed as an argument.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agotree: Change nvme_dev from global to static
Jeremy Kerr [Tue, 12 Jul 2022 09:20:25 +0000 (17:20 +0800)]
tree: Change nvme_dev from global to static

We're currently exposing the global struct nvme_dev, to allow the old
users access to the name and statbuf data. Now that users have their
local reference (along with the fd) through parse_and_open instead, we
can drop the public definition, and declare it static to nvme.c.

We still keep the static declaration; this will be removed in an
upcoming change.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/ytmc: pass struct nvme_dev rather than fd + name
Jeremy Kerr [Tue, 12 Jul 2022 09:17:30 +0000 (17:17 +0800)]
plugins/ytmc: pass struct nvme_dev rather than fd + name

The ytmc plugin has a few cases where we're passing both a fd and a name
around. Instead, use the struct nvme_dev, which contains both.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/wdc: pass struct nvme_dev rather than using global nvme_dev
Jeremy Kerr [Tue, 12 Jul 2022 09:14:09 +0000 (17:14 +0800)]
plugins/wdc: pass struct nvme_dev rather than using global nvme_dev

We have a couple of uses of the global nvme_dev variable, where we could
be passing a local instead. This change updates some of the wdc log
print functions to take a struct nvme_dev, rather than using the global.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/ocp: pass struct nvme_dev to internal functions
Jeremy Kerr [Tue, 12 Jul 2022 08:54:53 +0000 (16:54 +0800)]
plugins/ocp: pass struct nvme_dev to internal functions

Currently, we're passing a NVMe file descriptor, then accessing the
global nvme_dev.

This change just passes the local struct nvme_dev instead.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/toshiba: pass struct nvme_dev rather than fd + name
Jeremy Kerr [Tue, 12 Jul 2022 08:47:53 +0000 (16:47 +0800)]
plugins/toshiba: pass struct nvme_dev rather than fd + name

We currently pass both fd and name to internal functions. Just pass the
struct nvme_dev, which has both, instead.

While we're doing this, drop the usage of the global nvme_dev variable,
and drop an unnecessary cast from void *.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/wdc: pass a struct nvme_dev around rather than a fd
Jeremy Kerr [Tue, 12 Jul 2022 07:22:47 +0000 (15:22 +0800)]
plugins/wdc: pass a struct nvme_dev around rather than a fd

Currently, the wdc plugin (internally) passes the device fd around. This
change passes the struct nvme_dev instead, so we can access other
members in a future change.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agotree: Combine NVMe file descriptor into struct nvme_dev
Jeremy Kerr [Tue, 12 Jul 2022 06:55:34 +0000 (14:55 +0800)]
tree: Combine NVMe file descriptor into struct nvme_dev

Currently, our references to the nvme device are fragmented: we have the
device name and stat buf stored in the global nvme_dev, and then a
separate nvme device file descriptor passed between functions

This change moves the fd into the struct nvme_dev:

     struct nvme_dev {
    +        int fd;
             struct stat stat;
             const char *name;
     };

and changes parse_and_open to now populate a pointer to the dev on
successful return. Callers can now access the fd through dev->fd,
unifying this with the name and statbuf.

[At the moment, this just uses the global nvme_dev variable, but we'll
make that neater in a future change]

There are a large number of functions that use the fd directly, hence
the size of this patch. I've attempted to make this as atomic as
possible, but there are some call sites which warrant some reformatting
as we go here.

There may be some future opportunities to pass around the struct
nvme_dev * rather than the fd, but this change just implements the
minimal change to group our nvme device into the one struct.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agotree: Move global device info to a single struct
Jeremy Kerr [Tue, 12 Jul 2022 02:59:20 +0000 (10:59 +0800)]
tree: Move global device info to a single struct

Currently, we have a couple of globals that refer to the current NVMe
device: the device name, and the stat buffer:

    static struct stat nvme_stat;
    const char *devicename;

This change moves those two globals into a single global struct:

    struct nvme_dev {
            struct stat stat;
            const char *name;
    };

    extern struct nvme_dev *nvme_dev;

This will make it easier to constrain the scope of these globals in a
later change.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #1638 from Francis-Pravin/fix-parse-16bit-value
Daniel Wagner [Thu, 11 Aug 2022 17:20:26 +0000 (19:20 +0200)]
Merge pull request #1638 from Francis-Pravin/fix-parse-16bit-value

nvme: Add helper function to parse 16-bit comma separated list

2 years agonvme: Add helper function to parse 16-bit comma separated list
Francis Pravin Antony Michael Raj [Sun, 14 Aug 2022 02:30:08 +0000 (22:30 -0400)]
nvme: Add helper function to parse 16-bit comma separated list

In copy command, nlbs is declared as __u16. While parsing command line argument,
it is typecast to integer pointer. So nlbs[1], nlbs[3], nlbs[5], ... are stored
as zero after getting parsed. Therefore it is passing wrong value to controller.
Hence, adding a helper function to parse the 16-bit comma separated list

Signed-off-by: Francis Pravin Antony Michael Raj <francis.michael@solidigm.com>
Signed-off-by: Jonathan Derrick <jonathan.derrick@solidigm.com>
2 years agobuild: Update version to v2.1.2 v2.1.2
Daniel Wagner [Thu, 11 Aug 2022 13:07:35 +0000 (15:07 +0200)]
build: Update version to v2.1.2

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1636 from igaw/fix-nvme_init_copy_range_f1
Daniel Wagner [Thu, 11 Aug 2022 13:04:15 +0000 (15:04 +0200)]
Merge pull request #1636 from igaw/fix-nvme_init_copy_range_f1

wrapper: Call library version of nvme_init_copy_range_f1

2 years agowrapper: Update SPDIX license
Daniel Wagner [Thu, 11 Aug 2022 12:46:00 +0000 (14:46 +0200)]
wrapper: Update SPDIX license

The indented license is GPL-2.0-or-later. Update the SPDIX identifier
accordingly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agowrapper: Call library version of nvme_init_copy_range_f1
Daniel Wagner [Thu, 11 Aug 2022 12:09:44 +0000 (14:09 +0200)]
wrapper: Call library version of nvme_init_copy_range_f1

The wrapper needs to call the library version of the function.

While at it, introduce preprocessor helpers to reduce the amount
boilerplate code.

Fixes: 7ccb7d29afa0 ("wrapper: Add weak nvme_init_copy_range_f1 symbol")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1635 from igaw/revert-udev-re-read
Daniel Wagner [Thu, 11 Aug 2022 09:55:54 +0000 (11:55 +0200)]
Merge pull request #1635 from igaw/revert-udev-re-read

Revert "udev: re-read the discovery log page when a discovery control…

2 years agoRevert "udev: re-read the discovery log page when a discovery controller reconnected"
Daniel Wagner [Thu, 11 Aug 2022 09:19:53 +0000 (11:19 +0200)]
Revert "udev: re-read the discovery log page when a discovery controller reconnected"

This reverts commit f86faaaa2a1ff319bde188dc8988be1ec054d238.

Observing unwanted side-effects with nvme discovery. For e.g., running
a simple 'nvme discover' command ends up invoking connect-all as well,
creating namespaces on the host.

One can also see spurious discovery controllers in the 'nvme
list-subsys' output, despite having not created any persistent
discovery controllers at all.

Reported-by: Martin George <Martin.George@netapp.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1634 from linux-nvme/fixes-v2
Daniel Wagner [Thu, 11 Aug 2022 07:59:16 +0000 (09:59 +0200)]
Merge pull request #1634 from linux-nvme/fixes-v2

plugins: minor fixes v2

2 years agonvme: Simplify ns list identify
Jeremy Kerr [Thu, 14 Jul 2022 07:01:22 +0000 (15:01 +0800)]
nvme: Simplify ns list identify

Rather than multiplexing over four functions (which all then call
nvme_identify) just use nvme_identify directly, and set the identify
parameters according to the 'csi' and 'all' parameters.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
[dwagner: changed how the struct args is initialized]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agomeson: we don't need a c++ compiler
Jeremy Kerr [Wed, 13 Jul 2022 07:09:58 +0000 (15:09 +0800)]
meson: we don't need a c++ compiler

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/ocp: drop unused fd argument
Jeremy Kerr [Tue, 12 Jul 2022 08:52:56 +0000 (16:52 +0800)]
plugins/ocp: drop unused fd argument

We don't need a reference to the NVMe fd in ocp_print_C3_log_normal.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/wdc: remove fd argument from print functions
Jeremy Kerr [Tue, 12 Jul 2022 07:57:35 +0000 (15:57 +0800)]
plugins/wdc: remove fd argument from print functions

These don't need the NVMe device file descriptor, they're just printing
pre-collected data.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/wdc: fix memset() on the address of a pointer
Jeremy Kerr [Tue, 12 Jul 2022 08:16:12 +0000 (16:16 +0800)]
plugins/wdc: fix memset() on the address of a pointer

vuLogInput is a pointer, we're currently memset()-ing it like it's an
aggregate type.

We've already initialised the pointer to NULL above, so this memset
isn't doing anything.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/solidigm: fix return value on format parse failure
Jeremy Kerr [Tue, 12 Jul 2022 06:45:29 +0000 (14:45 +0800)]
plugins/solidigm: fix return value on format parse failure

If validate_output_format() fails, there are a couple of paths in the
solidgm code that will return a (closed) file descriptor, rather than an
error status. This looks to be a couple of copy-and-paste errors.

This change fixes the return value for these failure path, ensuring that
we'll actually have an error return.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/wdc: prevent duplicate close on NVMe device
Jeremy Kerr [Tue, 12 Jul 2022 05:28:17 +0000 (13:28 +0800)]
plugins/wdc: prevent duplicate close on NVMe device

wdc_crash_dump() will close the NVMe device file descriptor, but so do
all of its callers.

This change removes the unnecessary close(), as well as a stray
backslash on the previous line (which may cause unexpected indentation
warnings).

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agobuild: Update version to v2.1.1 v2.1.1
Daniel Wagner [Mon, 1 Aug 2022 15:39:47 +0000 (17:39 +0200)]
build: Update version to v2.1.1

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Extend release script to support micro version releases
Daniel Wagner [Mon, 1 Aug 2022 15:14:49 +0000 (17:14 +0200)]
build: Extend release script to support micro version releases

In case we need to fix up a a maj.min release extend the release
script to accept x.y.z version strings.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1629 from igaw/fix-release-fallouts
Daniel Wagner [Mon, 1 Aug 2022 15:01:24 +0000 (17:01 +0200)]
Merge pull request #1629 from igaw/fix-release-fallouts

Fix release fallouts

2 years agobuild: Add minimum build requirement on libnvme
Daniel Wagner [Mon, 1 Aug 2022 14:52:25 +0000 (16:52 +0200)]
build: Add minimum build requirement on libnvme

We depend on added APIs in libnvme, hence we need to update our build
requirment accordingly. Note, the ABI of the library is stable.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agowrapper: Add weak nvme_init_copy_range_f1 symbol
Daniel Wagner [Mon, 1 Aug 2022 14:50:32 +0000 (16:50 +0200)]
wrapper: Add weak nvme_init_copy_range_f1 symbol

Avoid adding a hard dependency on LIBNVME_1_1 section.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1614 from igaw/sync-release-steps
Daniel Wagner [Mon, 1 Aug 2022 12:54:10 +0000 (14:54 +0200)]
Merge pull request #1614 from igaw/sync-release-steps

Sync release steps with libnvme

2 years agoRegenerate all documentation v2.1
Daniel Wagner [Mon, 1 Aug 2022 12:49:11 +0000 (14:49 +0200)]
Regenerate all documentation

Regenerate documentation for v2.1 release

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Mon, 1 Aug 2022 12:47:37 +0000 (14:47 +0200)]
build: Update libnvme wrap

Update to v1.1 of libnvme.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1627 from igaw/fix-double-error-log
Daniel Wagner [Mon, 1 Aug 2022 12:33:03 +0000 (14:33 +0200)]
Merge pull request #1627 from igaw/fix-double-error-log

nvme: Do not print error message in collect_effects_log helper

2 years agonvme: Do not print error message in collect_effects_log helper
Daniel Wagner [Mon, 1 Aug 2022 12:22:17 +0000 (14:22 +0200)]
nvme: Do not print error message in collect_effects_log helper

We print error and status on the top level, so no need to print it a
helper.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1626 from igaw/drop-auth-ctrl-key
Daniel Wagner [Mon, 1 Aug 2022 12:15:43 +0000 (14:15 +0200)]
Merge pull request #1626 from igaw/drop-auth-ctrl-key

fabrics: Remove dhchap-ctrl-secret from discover/connect-all

2 years agofabrics: Remove dhchap-ctrl-secret from discover/connect-all
Daniel Wagner [Mon, 1 Aug 2022 11:52:31 +0000 (13:52 +0200)]
fabrics: Remove dhchap-ctrl-secret from discover/connect-all

The dhchap-ctrl-secret is per controller but discover and connect-all
operate on several controllers.

As this get's very fast complicated how to express this on the command
line, just drop the it. It was not implemented anyway and not listed
in the documentation.

Use the JSON config file in this case.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1624 from martin-gpy/async_event_config
Daniel Wagner [Mon, 1 Aug 2022 12:12:11 +0000 (14:12 +0200)]
Merge pull request #1624 from martin-gpy/async_event_config

nvme-print: sanitize the get-feature async event config output

2 years agonvme-print: sanitize the get-feature async event config output
Martin George [Fri, 29 Jul 2022 11:51:02 +0000 (17:21 +0530)]
nvme-print: sanitize the get-feature async event config output

Trivial fix to sanitize the nvme get-feature async event config
output by ensuring the details printed are properly aligned.

Signed-off-by: Martin George <marting@netapp.com>
2 years agoMerge pull request #1621 from igaw/fix-rae-users
Daniel Wagner [Mon, 25 Jul 2022 16:57:00 +0000 (18:57 +0200)]
Merge pull request #1621 from igaw/fix-rae-users

nvme: Set default rae value for nvme_get_nsid_log users

2 years agoMerge pull request #1619 from jeffreyalien/id-uuid-fix
Daniel Wagner [Fri, 22 Jul 2022 14:46:26 +0000 (16:46 +0200)]
Merge pull request #1619 from jeffreyalien/id-uuid-fix

print: Fix nvme_id_uuid_list

2 years agonvme: Set default rae value for nvme_get_nsid_log users
Daniel Wagner [Fri, 22 Jul 2022 12:12:00 +0000 (14:12 +0200)]
nvme: Set default rae value for nvme_get_nsid_log users

libnvme 1.0 hard codes the rae value for all nvme_get_nsid_log to
false. The upcoming 1.1 release will pass the rae value through
to the kernel. This is causing a behavior change. To be on the safe
side set all rae=true to false.

At least for nvme_get_log_error and nvme_get_log_smart this seems also
what the spec recommends.

Reported-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1617 from igaw/disconnect-wo-scan
Daniel Wagner [Fri, 22 Jul 2022 12:06:16 +0000 (14:06 +0200)]
Merge pull request #1617 from igaw/disconnect-wo-scan

fabrics: Avoid nvme_scan_ctrl when disconnecting

2 years agoMerge pull request #1620 from Francis-Pravin/remove-duplicate-line
Daniel Wagner [Fri, 22 Jul 2022 11:25:21 +0000 (13:25 +0200)]
Merge pull request #1620 from Francis-Pravin/remove-duplicate-line

nvme: Remove duplicate line

2 years agonvme: Remove duplicate line
Francis Pravin Antony Michael Raj [Thu, 21 Jul 2022 14:20:57 +0000 (10:20 -0400)]
nvme: Remove duplicate line

Remove the duplicate prinfow assignment

Signed-off-by: Francis Pravin Antony Michael Raj <francis.michael@solidigm.com>
Signed-off-by: Jonathan Derrick <jonathan.derrick@solidigm.com>
2 years agofabrics: Avoid nvme_scan_ctrl when disconnecting
Daniel Wagner [Tue, 19 Jul 2022 09:53:12 +0000 (11:53 +0200)]
fabrics: Avoid nvme_scan_ctrl when disconnecting

In certain corner cases, the kernel will not populate a nvme subsystem
but only create a nvme controller. nvme_scan_ctrl will fail in such
scenarios to find the controller object. Let's do the lookup based on
the ctrl name only.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update version before regenerating docs
Daniel Wagner [Mon, 18 Jul 2022 14:37:29 +0000 (16:37 +0200)]
build: Update version before regenerating docs

The docs contain the version string. Let's set new version before
regenerating the documentation to keep it consistent.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update release version rules
Daniel Wagner [Mon, 18 Jul 2022 14:08:38 +0000 (16:08 +0200)]
build: Update release version rules

Include the release candidate version string into the project
version. This allows to upload every release candidate to PyPI instead
just the final release.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoRelease v2.1-rc0 v2.1-rc0
Daniel Wagner [Thu, 14 Jul 2022 13:11:20 +0000 (15:11 +0200)]
Release v2.1-rc0

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoRegenerate all documentation
Daniel Wagner [Thu, 14 Jul 2022 13:11:20 +0000 (15:11 +0200)]
Regenerate all documentation

Regenerate documentation for v2.1-rc0 release

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Thu, 14 Jul 2022 13:07:00 +0000 (15:07 +0200)]
build: Update libnvme wrap

Update to v1.1-rc0 of libnvme.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1610 from jeffreyalien/master
Daniel Wagner [Wed, 13 Jul 2022 13:10:33 +0000 (15:10 +0200)]
Merge pull request #1610 from jeffreyalien/master

[wdc] Fix capabilities settings for SN650 and SN655

2 years agowdc: Fix capabilities settings for SN650 and SN655
Jeff Lien [Tue, 12 Jul 2022 18:27:06 +0000 (13:27 -0500)]
wdc: Fix capabilities settings for SN650 and SN655

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
2 years agoMerge pull request #1606 from Ssd5513146/master
Daniel Wagner [Tue, 12 Jul 2022 11:07:22 +0000 (13:07 +0200)]
Merge pull request #1606 from Ssd5513146/master

ymtc: fix ymtc additional smart info display

2 years agoymtc: fix ymtc additional smart info display
yunli [Tue, 12 Jul 2022 07:04:10 +0000 (15:04 +0800)]
ymtc: fix ymtc additional smart info display

2 years agoMerge pull request #1603 from igaw/fix-return-code-from-effects-log
Daniel Wagner [Tue, 12 Jul 2022 09:37:25 +0000 (11:37 +0200)]
Merge pull request #1603 from igaw/fix-return-code-from-effects-log

nvme: Return status/error code for effects-log command

2 years agoMerge pull request #1605 from martin-gpy/get_feature_H_option
Daniel Wagner [Tue, 12 Jul 2022 09:34:11 +0000 (11:34 +0200)]
Merge pull request #1605 from martin-gpy/get_feature_H_option

nvme: fix nvme get-feature with -H option

2 years agoMerge pull request #1604 from CodeConstruct/wdc-close-fix
Daniel Wagner [Tue, 12 Jul 2022 09:26:54 +0000 (11:26 +0200)]
Merge pull request #1604 from CodeConstruct/wdc-close-fix

plugins/wdc: telemetry log fixes

2 years agoMerge pull request #1607 from igaw/add-release-script
Daniel Wagner [Tue, 12 Jul 2022 09:23:29 +0000 (11:23 +0200)]
Merge pull request #1607 from igaw/add-release-script

Add release script

2 years agobuild: Add release automation script
Daniel Wagner [Tue, 12 Jul 2022 08:51:36 +0000 (10:51 +0200)]
build: Add release automation script

Add a script for generating a release.

Note, meson's project version is updated only once, either at the
begin of a RC phase or directly when there was no RC.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Add workflow to create release from tags
Daniel Wagner [Tue, 12 Jul 2022 08:48:17 +0000 (10:48 +0200)]
build: Add workflow to create release from tags

Let's automate the release process. The trigger to build a release is
the release tag.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: fix nvme get-feature with -H option
Martin George [Tue, 12 Jul 2022 08:31:08 +0000 (14:01 +0530)]
nvme: fix nvme get-feature with -H option

Currently, nvme get-feature with the -H option fails to print detailed
info for specific feature ids such as number of IO queues (fid=0x07),
async event config (fid=0x0b), KATO value (fid=0x0f), etc. This is
because nvme_feature_show_fields() is invoked only if the corresponding
'buf' pointer is valid, which is not necessary for the above feature
ids. So fix this by removing this restriction while invoking
nvme_feature_show_fields(). At the same time, ensure this 'buf' pointer
is appropriately validated before use in this function.

Fixes: bcab212 ("nvme: coverity fixes")
Signed-off-by: Martin George <marting@netapp.com>
2 years agoplugins/wdc: don't write invalid log data
Jeremy Kerr [Tue, 12 Jul 2022 07:30:43 +0000 (15:30 +0800)]
plugins/wdc: don't write invalid log data

In wdc_do_cap_telemetry_log, we currently continue to write log data if
any of the telemetry queries return with < 0.

This change aborts the output write on these errors instead.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoplugins/wdc: prevent double close in wdc_do_cap_telemetry_log
Jeremy Kerr [Tue, 12 Jul 2022 07:27:55 +0000 (15:27 +0800)]
plugins/wdc: prevent double close in wdc_do_cap_telemetry_log

Currently, wdc_do_cap_telemetry_log will close the NVMe fd before
returning, but so it all of its call sites. Since we'd be better off
making the fd open/close symmetrical, drop the close from
wdc_do_cap_telemetry_log.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: Return status/error code for effects-log command
Daniel Wagner [Mon, 11 Jul 2022 11:39:39 +0000 (13:39 +0200)]
nvme: Return status/error code for effects-log command

collect_effects_log eats up the return code from
nvme_get_log_cmd_effects. Forward it to the shell..

Fixes: 155fbebfe7b7 ("Update effects-log to handle multiple command sets")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1599 from ikegami-t/timestamp
Daniel Wagner [Mon, 11 Jul 2022 10:02:37 +0000 (12:02 +0200)]
Merge pull request #1599 from ikegami-t/timestamp

nvme: Check timestamp format result and increase string size

2 years agoMerge pull request #1600 from igaw/replace-util-json
Daniel Wagner [Mon, 11 Jul 2022 09:41:48 +0000 (11:41 +0200)]
Merge pull request #1600 from igaw/replace-util-json

    nvme: Use correct json serializing for long doubles

2 years agonvme: Use correct json serializing for long doubles
Daniel Wagner [Fri, 8 Jul 2022 10:18:03 +0000 (12:18 +0200)]
nvme: Use correct json serializing for long doubles

Fixup all places which use json_object_add_value_float() to serialize
long double types with json_object_add_value_double(). The float
version cuts off the upper 64 bits of the 128 bit long double type.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agojson: Add helper to serialize long double types
Daniel Wagner [Fri, 8 Jul 2022 10:15:50 +0000 (12:15 +0200)]
json: Add helper to serialize long double types

Introduce a helper to create a struct json_object from a long double
type.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agojson: Remove own json implementation
Daniel Wagner [Fri, 8 Jul 2022 09:59:51 +0000 (11:59 +0200)]
json: Remove own json implementation

We have a hard dependency on json-c, so let's remove our own json
implementation.

While at it move the json-c wrappers to util dir.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Cleanup json-c dependency
Daniel Wagner [Mon, 11 Jul 2022 09:32:27 +0000 (11:32 +0200)]
build: Cleanup json-c dependency

nvme-cli has hard dependency on json-c. Cleanup the leftovers from the
time where json-c was optional.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Explicitly add required on hard dependency
Daniel Wagner [Mon, 11 Jul 2022 09:29:28 +0000 (11:29 +0200)]
build: Explicitly add required on hard dependency

Make it explicit which library nvme-cli is depending on.

While at it also resort the section so that we list all
required dependencies.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agodocs: Correct spelling check error
Tokunori Ikegami [Sat, 9 Jul 2022 03:43:57 +0000 (12:43 +0900)]
docs: Correct spelling check error

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme-print: Correct spelling check error
Tokunori Ikegami [Fri, 8 Jul 2022 19:49:27 +0000 (04:49 +0900)]
nvme-print: Correct spelling check error

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme: Correct spelling check error
Tokunori Ikegami [Fri, 8 Jul 2022 18:40:31 +0000 (03:40 +0900)]
nvme: Correct spelling check error

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>