]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
2 years agobuild: Drop dependency on libuuid
Daniel Wagner [Thu, 13 Oct 2022 15:52:10 +0000 (17:52 +0200)]
build: Drop dependency on libuuid

libnvme provide the uuid functions we actually need, so just use those
and drop the libuuid dependency.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Thu, 27 Oct 2022 15:08:11 +0000 (17:08 +0200)]
build: Update libnvme wrap

Fetch the nvme_util_* functions.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1693 from igaw/nvme-topology
Daniel Wagner [Thu, 27 Oct 2022 13:55:40 +0000 (15:55 +0200)]
Merge pull request #1693 from igaw/nvme-topology

nvme: Add show-topology command

2 years agocompletions: Add show-topology tab completion
Daniel Wagner [Wed, 26 Oct 2022 13:27:11 +0000 (15:27 +0200)]
completions: Add show-topology tab completion

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agodoc: Add nvme show-topology documnetation
Daniel Wagner [Wed, 26 Oct 2022 12:41:19 +0000 (14:41 +0200)]
doc: Add nvme show-topology documnetation

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Add show-topology command
Daniel Wagner [Mon, 26 Sep 2022 16:17:01 +0000 (18:17 +0200)]
nvme: Add show-topology command

Add nvme show-topology which displays the entire nvme topology on the
host - all the subsystems with all the underlying controllers and its
states including ANA for all nvme devices.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1699 from ikegami-t/set-feature-0dh
Daniel Wagner [Wed, 26 Oct 2022 08:04:16 +0000 (10:04 +0200)]
Merge pull request #1699 from ikegami-t/set-feature-0dh

nvme: Fix set feature command to get feature identifier 0Dh length as…

2 years agonvme: Fix set feature command to get feature identifier 0Dh length as zero
Tokunori Ikegami [Thu, 13 Oct 2022 16:13:22 +0000 (01:13 +0900)]
nvme: Fix set feature command to get feature identifier 0Dh length as zero

The nvme_get_feature_length() function does not handle the direction
information correctly. Thus libnvme introduced a new version of this
function. Use it when available.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[dwagner: Add wrapper code when nvme_get_feature_length2
          is not available]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agolibnvme-wrap: Avoid fallback as variable name
Daniel Wagner [Mon, 24 Oct 2022 13:43:04 +0000 (15:43 +0200)]
libnvme-wrap: Avoid fallback as variable name

The libnvme util.h header file has support for the 'fallback
statement' for older compilers. This is done by precompiler tricks
which will replace all 'fallback' texts. So we should avoid fallback
as variable name.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agolibvnme-wrap: Rename file
Daniel Wagner [Mon, 24 Oct 2022 13:32:15 +0000 (15:32 +0200)]
libvnme-wrap: Rename file

The name 'wrapper' is a bit too generic. The functions in this file are
fallback implementations for older libnvme libraries. Hence prefix the
file with libnvme.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Fri, 21 Oct 2022 09:39:31 +0000 (11:39 +0200)]
build: Update libnvme wrap

Fetch newly added nvme_get_feature_length2 function.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update json-c.wrap
Daniel Wagner [Fri, 21 Oct 2022 09:48:17 +0000 (11:48 +0200)]
build: Update json-c.wrap

Update to the latest the json-c wrap version.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update zlib wrap
Daniel Wagner [Fri, 21 Oct 2022 09:49:04 +0000 (11:49 +0200)]
build: Update zlib wrap

Update to latest zlib version.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1704 from safl/mk
Daniel Wagner [Fri, 21 Oct 2022 07:50:31 +0000 (09:50 +0200)]
Merge pull request #1704 from safl/mk

Makefile: add 'make uninstall'

2 years agoMerge pull request #1705 from igaw/use-current_build_dir
Daniel Wagner [Fri, 21 Oct 2022 06:57:17 +0000 (08:57 +0200)]
Merge pull request #1705 from igaw/use-current_build_dir

build: Use meson.current_build_dir() for tests

2 years agoMakefile: add 'make uninstall'
Simon A. F. Lund [Thu, 20 Oct 2022 10:09:44 +0000 (12:09 +0200)]
Makefile: add 'make uninstall'

An uninstall option, in addition to RPM install/uninstall, is arguably
quite convenient. Yet, Makefiles usually do not provide an 'uninstall'
target since that would require recording an installation manifest and
custom logic for removal.

However, meson has an internal feature doing precisely that.

This change invokes the meson uninstall feature via "make uninstall".

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
2 years agobuild: Use meson.current_build_dir() for tests
Daniel Wagner [Thu, 20 Oct 2022 10:21:43 +0000 (12:21 +0200)]
build: Use meson.current_build_dir() for tests

Meson reports future deprecation of meson.build_root().  The
recommended replacement is to use meson.current_build_dir().

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1703 from jinliangw/master
Daniel Wagner [Wed, 19 Oct 2022 12:07:53 +0000 (14:07 +0200)]
Merge pull request #1703 from jinliangw/master

util: Fix le128_to_cpu on little-endian

2 years agotests: Update license to GPL-2.0-or-later
Daniel Wagner [Tue, 17 May 2022 06:14:56 +0000 (08:14 +0200)]
tests: Update license to GPL-2.0-or-later

When I reviewed the tests I asked wrongly for GPL-2.0-only. The
project is using the GPL-2.0-or-later license. Relax the license
requirement to GPL-2.0-or-later.

Cc: Arunpandian J <apj.arun@samsung.com>
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Link: https://lore.kernel.org/r/20220517061456.7623-1-dwagner@suse.de
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoutil: Fix le128_to_cpu on little-endian
Jinliang Wang [Tue, 18 Oct 2022 23:41:13 +0000 (16:41 -0700)]
util: Fix le128_to_cpu on little-endian

We need to swap the words order in little-endian machine too.
For example:

uint128:  0x4000000030000000200000001

 0  1  2  3 |  4  5  6  7 | 8  9  a  b  | c  d  e  f
01 00 00 00 | 02 00 00 00 | 03 00 00 00 | 04 00 00 00

  w0(MSB)   |     w1      |    w2       |  w3(LSB)
04 00 00 00 | 03 00 00 00 | 02 00 00 00 | 01 00 00 00

Fixes: https://github.com/linux-nvme/nvme-cli/issues/1702
Signed-off-by: Jinliang Wang <jinliangw@google.com>
2 years agoMerge pull request #1694 from igaw/autoconnect-json-config
Daniel Wagner [Tue, 18 Oct 2022 16:39:12 +0000 (18:39 +0200)]
Merge pull request #1694 from igaw/autoconnect-json-config

fabrics: Honor JSON config file in connect-all command

2 years agoMerge pull request #1698 from sc108-lee/debug
Daniel Wagner [Tue, 18 Oct 2022 08:25:55 +0000 (10:25 +0200)]
Merge pull request #1698 from sc108-lee/debug

Makefile: Add 'make debug' for debug build

2 years agoMerge pull request #1696 from maurizio-lombardi/null_test
Daniel Wagner [Tue, 18 Oct 2022 08:25:26 +0000 (10:25 +0200)]
Merge pull request #1696 from maurizio-lombardi/null_test

nvme: check if cfg.metadata is NULL before passing it to strlen()

2 years agoMakefile: Add 'make debug' for debug build
Steven Seungcheol Lee [Thu, 13 Oct 2022 06:16:19 +0000 (15:16 +0900)]
Makefile: Add 'make debug' for debug build

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agonvme: check if cfg.metadata is NULL before passing it to strlen()
Maurizio Lombardi [Wed, 12 Oct 2022 15:23:47 +0000 (17:23 +0200)]
nvme: check if cfg.metadata is NULL before passing it to strlen()

2 years agofabrics: Trigger auto connect if config.json exists
Daniel Wagner [Thu, 29 Sep 2022 14:00:26 +0000 (16:00 +0200)]
fabrics: Trigger auto connect if config.json exists

When either discover.conf or config.json exists the rule should be
executed.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Honor JSON config file in connect-all command
Daniel Wagner [Thu, 29 Sep 2022 13:44:23 +0000 (15:44 +0200)]
fabrics: Honor JSON config file in connect-all command

When we there is a JSON config file use it when doing a
connect-all.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: nvme config --modify depends on -n and -t argument
Daniel Wagner [Thu, 29 Sep 2022 09:28:50 +0000 (11:28 +0200)]
fabrics: nvme config --modify depends on -n and -t argument

In order to be able to modify a config we need to look it up
first. The nvme_lookup_subsystem() call will crash if we don't
provide a NQN.

The transport is needed to be able lookup a controller.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update json-c.wrap
Daniel Wagner [Thu, 29 Sep 2022 10:12:09 +0000 (12:12 +0200)]
build: Update json-c.wrap

Update to the latest the json-c wrap version.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1692 from jeffreyalien/master
Daniel Wagner [Tue, 27 Sep 2022 13:02:06 +0000 (15:02 +0200)]
Merge pull request #1692 from jeffreyalien/master

plugins/wdc: Add support for SN660 drive

2 years agoplugins/wdc: Add support for SN660 drive
Jeff Lien [Mon, 26 Sep 2022 14:17:54 +0000 (09:17 -0500)]
plugins/wdc: Add support for SN660 drive

Update WDC plugin version to 2.1.2

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
2 years agofabrics: re-read the discovery log page when a discovery controller reconnected
Sagi Grimberg [Thu, 22 Sep 2022 08:15:38 +0000 (11:15 +0300)]
fabrics: re-read the discovery log page when a discovery controller reconnected

When using persistent discovery controllers, if the discovery controller
loses connectivity and manage to reconnect after a while, we need to
retrieve again the discovery log page in order to learn about possible
changes that may have occurred during this time as discovery log change
events were lost.

Upon reception of a udev EVENT=rediscover we can kickstart discovery on
the existing discovery controller device node that generated the event.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: James Smart <jsmart2021@gmail.com>
[dwagner: added --host_iface argument]
Signed-off-by: Daniel Wagner <dwagner@suse.de
2 years agoMerge pull request #1691 from CodeConstruct/pr/mi-firmware
Daniel Wagner [Tue, 27 Sep 2022 09:10:21 +0000 (11:10 +0200)]
Merge pull request #1691 from CodeConstruct/pr/mi-firmware

nvme: Add wrappers for firmware commands

2 years agonvme: Add wrappers for firmware commands
Jeremy Kerr [Sat, 24 Sep 2022 06:41:03 +0000 (14:41 +0800)]
nvme: Add wrappers for firmware commands

This change adds nvme_dev wrappers for the firmware download and
firmware commit commands, allowing access over a MI channel.

We need a bump to libnvme for the underlying MI firmware calls.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agolibnvme.wrap: Bump to 677075a1
Jeremy Kerr [Sat, 24 Sep 2022 06:41:03 +0000 (14:41 +0800)]
libnvme.wrap: Bump to 677075a1

In an upcoming change we'll want support for the firmware-handling
commands, so bump the libnvme wrap version to suit.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #1690 from CodeConstruct/dev/uint128
Daniel Wagner [Mon, 26 Sep 2022 12:58:21 +0000 (14:58 +0200)]
Merge pull request #1690 from CodeConstruct/dev/uint128

util: Fix le128_to_cpu on big-endian

2 years agoMerge pull request #1688 from CodeConstruct/dev/ci-cross
Daniel Wagner [Mon, 26 Sep 2022 12:56:54 +0000 (14:56 +0200)]
Merge pull request #1688 from CodeConstruct/dev/ci-cross

Add warning fixes and enable cross compilation targets in github workflows

2 years agogithub workflows: add armhf and ppc64le cross compile checks
Jeremy Kerr [Sun, 25 Sep 2022 12:48:31 +0000 (20:48 +0800)]
github workflows: add armhf and ppc64le cross compile checks

Like we have done in libnvme, this change adds a couple of cross-compile
definitons for the github workflows: one for armhf, one for powerpc64le.

Fixes: https://github.com/linux-nvme/nvme-cli/issues/1687
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme, plugins: fix __u64 -> unsigned long long assumptions
Jeremy Kerr [Mon, 26 Sep 2022 10:04:08 +0000 (18:04 +0800)]
nvme, plugins: fix __u64 -> unsigned long long assumptions

We have a couple of instances which assume __u64 is an unsigned long,
which is not always the case.

For the printf() formats, we would ideally used PRId64, but on ll64
platforms, it looks this macro is broken: it expands to "ld", where
__u64 is an unsigned long long. So, do an explicit cast to unsigned long
long instead, and just use %lld.

With this change, we can compile without warnings on amd64, armhf and
powerpc64le.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoutil: Fix le128_to_cpu on big-endian
Jeremy Kerr [Mon, 26 Sep 2022 12:02:31 +0000 (20:02 +0800)]
util: Fix le128_to_cpu on big-endian

We currently have a bug when converting from le128, as we'll overwrite
words that we later need to read.

Also, use an if rather than #ifdef, so the BE case can be compiled.
Turns out we need the ccan headers for this.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #1685 from CodeConstruct/dev/uint128
Daniel Wagner [Mon, 26 Sep 2022 07:20:16 +0000 (09:20 +0200)]
Merge pull request #1685 from CodeConstruct/dev/uint128

utils: Fix uint128_t usage

2 years agoMerge pull request #1686 from igaw/fix-misc
Daniel Wagner [Mon, 26 Sep 2022 07:17:20 +0000 (09:17 +0200)]
Merge pull request #1686 from igaw/fix-misc

Various small build fixes

2 years agoMerge pull request #1675 from martin-belanger/udev-rule
Daniel Wagner [Mon, 26 Sep 2022 06:39:04 +0000 (08:39 +0200)]
Merge pull request #1675 from martin-belanger/udev-rule

udev: Add HOST_IFACE to udev rule

2 years agoutils: Fix uint128_t usage
Jeremy Kerr [Sun, 25 Sep 2022 12:12:34 +0000 (20:12 +0800)]
utils: Fix uint128_t usage

Currently, nvme-cli will not compile on 32-bit platforms, as uint128_t
is not available.

This change, based on suggestions from Daniel Wagner <dwagner@suse.de>,
adds our own nvme_uint128_t type, which needs a custom to_string()
function.

In order to make the latter straightforward, we use four 32-bit words
for the internal representation of the 128-bit type. We then use 64-bit
arithmetic to avoid having to handle the carry-bit explicitly.

Also, add a small test case for the printing.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoudev: Add HOST_IFACE to udev rule
Martin Belanger [Tue, 13 Sep 2022 15:19:13 +0000 (11:19 -0400)]
udev: Add HOST_IFACE to udev rule

The HOST_IFACE only applies to TCP connections. When provided, it forces TCP
connections on a specific interface instead of letting the routing table
decide. Some users may prefer to force connections on specific interfaces
instead of configuring the routing table. This change makes sure that the
HOST_IFACE used to set up the persistent connection to the discovery
controller also gets applied to the I/O controller connections.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
2 years agoMerge pull request #1683 from igaw/fix-wdc-enum-conversion
Daniel Wagner [Fri, 23 Sep 2022 14:39:54 +0000 (16:39 +0200)]
Merge pull request #1683 from igaw/fix-wdc-enum-conversion

plugins/wdc: Add type case for feature id

2 years agonvme: Use correct print format specifier for sizeof arguments
Daniel Wagner [Fri, 23 Sep 2022 14:27:50 +0000 (16:27 +0200)]
nvme: Use correct print format specifier for sizeof arguments

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/micron-nvme: Use correct print format specifier for sizeof arguments
Daniel Wagner [Fri, 23 Sep 2022 14:28:19 +0000 (16:28 +0200)]
plugins/micron-nvme: Use correct print format specifier for sizeof arguments

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/wdc: Add type case for feature id
Daniel Wagner [Fri, 23 Sep 2022 11:43:57 +0000 (13:43 +0200)]
plugins/wdc: Add type case for feature id

clang reports

../plugins/wdc/wdc-nvme.c:9000:36: warning: implicit conversion from enumeration type 'NVME_FEATURE_IDENTIFIERS' (aka 'enum _NVME_FEATURE_IDENTIFIERS') to different enumeration type 'enum nvme_features_id' [-Wenum-conversion]
                                             deFeatureIdList[listIdx].featureId,
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~

Add type case to avoid the warning. Ideally, the plugin would not
introduce their own enum value.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins: Use PRIu64 format specifier for 64bit types
Daniel Wagner [Fri, 23 Sep 2022 10:32:53 +0000 (12:32 +0200)]
plugins: Use PRIu64 format specifier for 64bit types

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Use uint128 JSON function for media_units_written
Daniel Wagner [Fri, 23 Sep 2022 10:31:33 +0000 (12:31 +0200)]
nvme-print: Use uint128 JSON function for media_units_written

media_units_written is of type __uint128_t hence we should use the
correct function for serializing to JSON.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1662 from DebabrataSTX/stx_ocp
Daniel Wagner [Thu, 22 Sep 2022 09:51:18 +0000 (11:51 +0200)]
Merge pull request #1662 from DebabrataSTX/stx_ocp

adding OCP changes for Seagate drives

2 years agodoc: Add and update man pages for seagate plugin
Debabrata Bardhan [Thu, 15 Sep 2022 12:24:44 +0000 (17:54 +0530)]
doc: Add and update man pages for seagate plugin

Adding documentation of Seagate plug-in commands.

Signed-off-by: Debabrata Bardhan <debabrata.bardhan@seagate.com>
2 years agoplugins/seagate: Add support for OCP
Debabrata Bardhan [Thu, 15 Sep 2022 12:08:16 +0000 (17:38 +0530)]
plugins/seagate: Add support for OCP

Added new behavior as defined by Datacenter NVMe SSD Specification, version 2.0.

Signed-off-by: Debabrata Bardhan <debabrata.bardhan@seagate.com>
2 years agoMerge pull request #1677 from tbzatek/json-strings-3
Daniel Wagner [Wed, 14 Sep 2022 12:03:28 +0000 (14:03 +0200)]
Merge pull request #1677 from tbzatek/json-strings-3

nvme-print: Handle NULL hostid in JSON output

2 years agonvme-print: Handle NULL hostid in JSON output
Tomas Bzatek [Tue, 13 Sep 2022 14:54:44 +0000 (16:54 +0200)]
nvme-print: Handle NULL hostid in JSON output

For pcie devices there might be no hostid available, in case the
/etc/nvme/hostid file doesn't exist.

2 years agoMerge pull request #1676 from igaw/doc-update-nvme-list-subsys-example
Daniel Wagner [Wed, 14 Sep 2022 09:44:42 +0000 (11:44 +0200)]
Merge pull request #1676 from igaw/doc-update-nvme-list-subsys-example

doc: Update examples in nvme-list-subsys.txt

2 years agodoc: Update examples in nvme-list-subsys.txt
Daniel Wagner [Wed, 14 Sep 2022 09:12:19 +0000 (11:12 +0200)]
doc: Update examples in nvme-list-subsys.txt

The examples show the output from nvme-cli 1.x. The address field
shows the attributes separated by spaces. The corresponding code in
libnvme doesn't do this. Instead the exact output from sysfs, e.g.

  # cat /sys/class/nvme/nvme0/address
  traddr=192.168.201.101,trsvcid=4420

Update the example in the nvme list-subsys documentation.

Signed-off-by: Daniel Wagner <dwagnwer@suse.de>
2 years agoMerge pull request #1673 from linux-nvme/dependabot/github_actions/actions/checkout-3
Daniel Wagner [Tue, 13 Sep 2022 07:27:47 +0000 (09:27 +0200)]
Merge pull request #1673 from linux-nvme/dependabot/github_actions/actions/checkout-3

build(deps): bump actions/checkout from 2 to 3

2 years agobuild(deps): bump actions/checkout from 2 to 3
dependabot[bot] [Mon, 12 Sep 2022 18:21:51 +0000 (18:21 +0000)]
build(deps): bump actions/checkout from 2 to 3

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoMerge pull request #1666 from igaw/add-uint128-type
Daniel Wagner [Mon, 12 Sep 2022 07:51:45 +0000 (09:51 +0200)]
Merge pull request #1666 from igaw/add-uint128-type

Add uint128 type

2 years agoadd item ddr_ecc_err_cnt in smart-log-add
innogritkenny [Tue, 6 Sep 2022 08:41:56 +0000 (16:41 +0800)]
add item ddr_ecc_err_cnt in smart-log-add

2 years agoplugins/virtium: Output 128bit values as uint128 type instead of double
Steven Seungcheol Lee [Wed, 7 Sep 2022 09:18:59 +0000 (11:18 +0200)]
plugins/virtium: Output 128bit values as uint128 type instead of double

The 128bit types should be printed as integer not as double. The
print function for double type will add decimal points.

While at it drop the local copy of int128_to_double and use the one
from util.

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: refactoring]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/wdc: Output 128bit values as uint128 type instead of double
Steven Seungcheol Lee [Wed, 7 Sep 2022 09:18:02 +0000 (11:18 +0200)]
plugins/wdc: Output 128bit values as uint128 type instead of double

The 128bit types should be printed as integer not as double. The
print function for double type will add decimal points.

While at it drop the local copy of int128_to_double and use the one
from util.

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: refactoring]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/ocp: Output 128bit values as uint128 type instead of double
Steven Seungcheol Lee [Wed, 7 Sep 2022 09:16:27 +0000 (11:16 +0200)]
plugins/ocp: Output 128bit values as uint128 type instead of double

The 128bit types should be printed as integer not as double. The
print function for double type will add decimal points.

While at it drop the local copy of int128_to_double and use the one
from util.

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: refactoring]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Output 128bit values as uint128 type instead of double
Steven Seungcheol Lee [Wed, 7 Sep 2022 09:16:11 +0000 (11:16 +0200)]
nvme-print: Output 128bit values as uint128 type instead of double

The 128bit types should be printed as integer not as double. The
print function for double type will add decimal points.

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: refactoring]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoutil/json: Add 128 bit JSON helpers
Steven Seungcheol Lee [Wed, 7 Sep 2022 09:11:34 +0000 (11:11 +0200)]
util/json: Add 128 bit JSON helpers

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: refactoring]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoutil/types: Add 128 bit conversion helpers
Steven Seungcheol Lee [Wed, 7 Sep 2022 09:10:01 +0000 (11:10 +0200)]
util/types: Add 128 bit conversion helpers

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: refactoring]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoutil: Move common type conversion helpers into util section
Daniel Wagner [Wed, 7 Sep 2022 09:05:03 +0000 (11:05 +0200)]
util: Move common type conversion helpers into util section

These helpers are useful not just in the core code. Allow plugins
to use these too.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1659 from igaw/docs-how-to-prepare-a-pr
Daniel Wagner [Wed, 7 Sep 2022 07:13:12 +0000 (09:13 +0200)]
Merge pull request #1659 from igaw/docs-how-to-prepare-a-pr

doc: Add 'how to contribute' section

2 years agonvme-print: Add missing values in id-ctrl for JSON output
Daniel Wagner [Wed, 7 Sep 2022 07:08:17 +0000 (09:08 +0200)]
nvme-print: Add missing values in id-ctrl for JSON output

Add the missing values in the id-ctrl JSON output.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Print fguid as a UUID
Pierre Labat [Fri, 26 Aug 2022 22:02:08 +0000 (17:02 -0500)]
nvme-print: Print fguid as a UUID

Signed-off-by: Pierre Labat <plabat@micron.com>
[dwagner: added json output]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1637 from igaw/udpate-format-doc-sanitize
Daniel Wagner [Wed, 7 Sep 2022 06:44:17 +0000 (08:44 +0200)]
Merge pull request #1637 from igaw/udpate-format-doc-sanitize

docs: Update formatting for sanact list

2 years agodocs: Update formatting for sanact list
Daniel Wagner [Thu, 11 Aug 2022 13:55:20 +0000 (15:55 +0200)]
docs: Update formatting for sanact list

asciidoc creates list with either a '*' or '-'. Without it this is
rendered as one paragraph which is hard to read.

While at it, also use hex values to match with example.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/innogrit: add smart items for smart-log-add
innogritkenny [Wed, 31 Aug 2022 09:23:02 +0000 (17:23 +0800)]
plugins/innogrit: add smart items for smart-log-add

2 years agoMerge pull request #1656 from sc108-lee/zns_report_zones
Daniel Wagner [Wed, 31 Aug 2022 08:00:33 +0000 (10:00 +0200)]
Merge pull request #1656 from sc108-lee/zns_report_zones

zns.c: report zones should be started after retrieved zone

2 years agodoc: Add 'how to contribute' section
Daniel Wagner [Wed, 31 Aug 2022 07:41:54 +0000 (09:41 +0200)]
doc: Add 'how to contribute' section

Document how to contribute to the project. Highlight the fact, that
it expected that the PRs are also following the Linux community
contributions guidelines (clean series).

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agozns.c: report zones should be started after retrieved zone
Steven Seungcheol Lee [Mon, 29 Aug 2022 11:23:55 +0000 (20:23 +0900)]
zns.c: report zones should be started after retrieved zone

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agoMerge pull request #1654 from sc108-lee/endurance_log
Daniel Wagner [Tue, 30 Aug 2022 14:47:47 +0000 (16:47 +0200)]
Merge pull request #1654 from sc108-lee/endurance_log

nvme-print: fix wrong json key

2 years agoMerge pull request #1648 from lgdacunha/telemetry_cod
Daniel Wagner [Tue, 30 Aug 2022 12:24:12 +0000 (14:24 +0200)]
Merge pull request #1648 from lgdacunha/telemetry_cod

Added parsing for Solidigm telemetry observable data.

2 years agonvme-print: fix wrong json key
Steven Seungcheol Lee [Mon, 29 Aug 2022 08:43:18 +0000 (17:43 +0900)]
nvme-print: fix wrong json key

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agoAdded parsing for Solidigm telemetry observable data.
da Cunha, Leonardo [Fri, 15 Jul 2022 02:11:19 +0000 (22:11 -0400)]
Added parsing for Solidigm telemetry observable data.

2 years agoMerge pull request #1650 from igaw/fix-sstat-output
Daniel Wagner [Thu, 25 Aug 2022 15:12:04 +0000 (17:12 +0200)]
Merge pull request #1650 from igaw/fix-sstat-output

nvme: Masks SSTAT in sanize-log output

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>