]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
2 years agobuild: Update version to v2.5
Daniel Wagner [Fri, 30 Jun 2023 13:20:21 +0000 (15:20 +0200)]
build: Update version to v2.5

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Bump libnvme wrap
Daniel Wagner [Fri, 30 Jun 2023 13:19:06 +0000 (15:19 +0200)]
build: Bump libnvme wrap

Update to the libnvme v1.5 release

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/solidigm: Added Marketing Name Log support for Solidigm.
hsdhillo [Tue, 13 Jun 2023 20:52:34 +0000 (13:52 -0700)]
plugins/solidigm: Added Marketing Name Log support for Solidigm.

Signed-off-by: hsdhillo <Hardeep.Dhillon@solidigm.com>
2 years agonvme-print: Remove left overs from refactoring
Daniel Wagner [Fri, 23 Jun 2023 06:45:26 +0000 (08:45 +0200)]
nvme-print: Remove left overs from refactoring

The refactoring of the printing code left some code in the original
place. Remove it now

Fixes: 1d583b7856db ("nvme-print-stdout: Refactor stdout print code to use print_ops")
Fixes: 73dfe8a2d227 ("nvme-print-binary: Refactor binary print code to use print_ops")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Move num argument parsing into callbacks
Daniel Wagner [Fri, 23 Jun 2023 06:40:59 +0000 (08:40 +0200)]
nvme-print: Move num argument parsing into callbacks

The goal for the libnvme type print function is only to use
the types from the library as argument. The num argument can be
parsed from the ctrl_list thus move it the callbacks directly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Fix typo in callback definition
Daniel Wagner [Fri, 23 Jun 2023 06:40:04 +0000 (08:40 +0200)]
nvme-print: Fix typo in callback definition

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Use containers with matrix build
Daniel Wagner [Wed, 28 Jun 2023 10:38:19 +0000 (12:38 +0200)]
build: Use containers with matrix build

Use a matrix build approach and a base container which already contains
all the libraries installed.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Bump libnvme wrap
Daniel Wagner [Wed, 28 Jun 2023 10:57:50 +0000 (12:57 +0200)]
build: Bump libnvme wrap

Fetch static build fix.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoscripts: Make release script project neutral
Daniel Wagner [Fri, 23 Jun 2023 09:10:04 +0000 (11:10 +0200)]
scripts: Make release script project neutral

The script is used also for libnvme, thus make the nvme-cli
specific parts optional.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoscripts: Update update-docs.sh scripts
Daniel Wagner [Fri, 23 Jun 2023 07:20:49 +0000 (09:20 +0200)]
scripts: Update update-docs.sh scripts

libnvme is not downloaded automatically anymore. Thus use
--force-fallback-for to fetch it when updating the documentation.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoscripts: Execute the scripts from toplevel directory
Daniel Wagner [Fri, 23 Jun 2023 07:05:53 +0000 (09:05 +0200)]
scripts: Execute the scripts from toplevel directory

These scripts expect to be run from the toplevel directory, so make sure
we are running from there.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoscripts: Move helper scripts to a central place
Daniel Wagner [Fri, 23 Jun 2023 07:01:45 +0000 (09:01 +0200)]
scripts: Move helper scripts to a central place

The helper scripts for maintaining are distributed over several
directories. Let's move them to the scripts directory.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agodocs: Update file modes
Daniel Wagner [Fri, 23 Jun 2023 07:03:03 +0000 (09:03 +0200)]
docs: Update file modes

These files are not executables, just plain text, thus remove the
execution mode flag.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agodoc: Add information on --context
Daniel Wagner [Fri, 16 Jun 2023 11:13:08 +0000 (13:13 +0200)]
doc: Add information on --context

Document the newly added --context argument and how to use it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvmf-autoconnect: Annotate the context to autoconnect
Daniel Wagner [Fri, 16 Jun 2023 15:21:31 +0000 (17:21 +0200)]
nvmf-autoconnect: Annotate the context to autoconnect

By providing the execution context from the systemd service files,
nvme-cli can figure out if it is noop when looking at the configuration
files.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Add support for volatile configuration
Daniel Wagner [Wed, 14 Jun 2023 12:10:51 +0000 (14:10 +0200)]
fabrics: Add support for volatile configuration

The fabric resources are global resources and as such should only
modified by one component. So far nvme-cli was the only component
managing connections. With the introduction of nvme-stas we need to
coordinate the access to these resources.

Introduce access coordination feature which allows the external software
to drop volatile configurations files into the /var/nvme directory.

When nvme-cli ls executed(e.g. via the udev rules), the execution
context is evaluated and only resources which belong the application are
considered.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Reformat build_opionts.txt
Daniel Wagner [Mon, 12 Jun 2023 15:45:14 +0000 (17:45 +0200)]
build: Reformat build_opionts.txt

Reformat the file so that we don't have so long lines. While at it also
sort the options names by name.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Bump libnvme wrap
Daniel Wagner [Wed, 21 Jun 2023 07:41:04 +0000 (09:41 +0200)]
build: Bump libnvme wrap

Fetch recent version of libnvme which includes the fixes for the
--context feature.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/solidigm: Formated log page directory table consistently with "nvme list...
da Cunha, Leonardo [Wed, 14 Jun 2023 18:39:02 +0000 (11:39 -0700)]
plugins/solidigm: Formated log page directory table consistently with "nvme list" format.

Signed-off-by: leonardo.da.cunha <leonardo.da.cunha@solidigm.com>
2 years agoplugins/solidigm: Added Identify controller VU extensions parsing.
leonardo.da.cunha [Tue, 6 Jun 2023 23:37:06 +0000 (16:37 -0700)]
plugins/solidigm: Added Identify controller VU extensions parsing.

Signed-off-by: leonardo.da.cunha <leonardo.da.cunha@solidigm.com>
2 years agonvme-print-json: Print PCI pysical slot number for controller
Umer Saleem [Tue, 13 Jun 2023 12:34:23 +0000 (17:34 +0500)]
nvme-print-json: Print PCI pysical slot number for controller

Print PCI physical slot information for controller for JSON if
verbose if specified.

Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
2 years agonvme-print-stdout: Print PCI physical slot number for controller
Umer Saleem [Tue, 13 Jun 2023 12:26:17 +0000 (17:26 +0500)]
nvme-print-stdout: Print PCI physical slot number for controller

Print the PCI physcial slot number for the controller. The slot
number is printed if versbose is specified.

Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
2 years agolibnvme.wrap: Bump to 42ac453
Umer Saleem [Wed, 14 Jun 2023 16:33:42 +0000 (21:33 +0500)]
libnvme.wrap: Bump to 42ac453

Support for PCI physical slot number for NVME controller.

Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
2 years agoplugins/nbft: Use common code to parse print flags
Daniel Wagner [Wed, 14 Jun 2023 12:08:50 +0000 (14:08 +0200)]
plugins/nbft: Use common code to parse print flags

Use validate_output_format instead open coding the print flag parsing.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Do not print device on connect per default
Daniel Wagner [Wed, 14 Jun 2023 12:03:53 +0000 (14:03 +0200)]
fabrics: Do not print device on connect per default

During the print code refactoring, the show connect message was enabled
per default. To avoid any regressions in application restore the old
behavior and print only the result when the '-o' option is used.

Fixes: 0576d84bf4aa ("fabrics: Move printing functions to the print files")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Revert 'fabrics: prevent 'nvme connect' to well-known discovery
Daniel Wagner [Wed, 14 Jun 2023 11:57:35 +0000 (13:57 +0200)]
fabrics: Revert 'fabrics: prevent 'nvme connect' to well-known discovery
NQN'

Unfortunately, blktests nvme/003 depends on this feature. To avoid
any regression in the testsuite revert the change. After this has
been address in blktests we can add it back.

Fixes: 9077d042c04a ("fabrics: prevent 'nvme connect' to well-known discovery NQN")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: fix wrong list-subsys output when ns are attached to different ctrls
Sagi Grimberg [Mon, 12 Jun 2023 15:34:06 +0000 (18:34 +0300)]
nvme-print: fix wrong list-subsys output when ns are attached to different ctrls

If we list subsystem controllers not for a specific ns (user did not pass
a namespace device node), we cannot look at the first ns in the subsystem
to list because it may not be attached to all subsystem controllers.

We incorrectly assumes that subsystem namespaces (or at least the first of
them) are attached to all subsystem controllers.

Fix that by showing the multipath subsystem-list flavor only when the user
passed a specific namespace, and fallback to a simple controller list otherwise.

Fixes: cdeaab8fca6e ("nvme-print: Show ANA state only for one namespace")
Fixes: 7435ed9ae6a6 ("nvme-print: Show paths from the first namespace only")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/micron: Correct NULL pointer checking error
Tokunori Ikegami [Tue, 6 Jun 2023 16:48:32 +0000 (01:48 +0900)]
plugins/micron: Correct NULL pointer checking error

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/innogrit: Add vendor command get-eventlog and get-cdump
innogritkenny [Tue, 30 May 2023 03:10:51 +0000 (11:10 +0800)]
plugins/innogrit: Add vendor command get-eventlog and get-cdump

cdw2 add signature
nsid modify to 0xffffffff
for support fw checking rule.

2 years agonvme: Use correct data buffer size
Daniel Wagner [Tue, 6 Jun 2023 15:21:55 +0000 (17:21 +0200)]
nvme: Use correct data buffer size

The submit_io command is using the buffer size provided by the
user. But this size argument might be updated and the correct length
for the buffer is buffer_size. Thus use this value and not the
initial length.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Fix quoted string split across lines to use quoted newline
Tokunori Ikegami [Mon, 5 Jun 2023 17:01:06 +0000 (02:01 +0900)]
nvme: Fix quoted string split across lines to use quoted newline

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/zns: Fix zns.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 4 Jun 2023 12:45:40 +0000 (21:45 +0900)]
plugins/zns: Fix zns.c linux kernel check patch errors and warnings

Note: Still the remaining warning messages are not fixed as same with nvme.c.

WARNING: quoted string split across lines
+       const char *desc = "Send a ZNS specific Identify Controller command to "
+                          "the given device and report information about the specified "

WARNING: quoted string split across lines
+                          "the given device and report information about the specified "
+                          "controller in various formats.";

WARNING: quoted string split across lines
+       const char *desc = "Send a ZNS specific Identify Namespace command to "
+                          "the given device and report information about the specified "

WARNING: quoted string split across lines
+                          "the given device and report information about the specified "
+                          "namespace in varios formats.";

WARNING: quoted string split across lines
+       const char *desc = "The zone append command is used to write to a zone "
+                          "using the slba of the zone, and the write will be appended from the "

WARNING: quoted string split across lines
+                          "using the slba of the zone, and the write will be appended from the "
+                          "write pointer of the zone";

total: 0 errors, 6 warnings, 1278 lines checked

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/ymtc: Fix ymtc-nvme.c linux kernel check patch warning
Tokunori Ikegami [Sun, 4 Jun 2023 12:30:55 +0000 (21:30 +0900)]
plugins/ymtc: Fix ymtc-nvme.c linux kernel check patch warning

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/ymtc: Fix ymtc-nvme.c space indentation to tab indentation
Tokunori Ikegami [Sun, 4 Jun 2023 12:28:37 +0000 (21:28 +0900)]
plugins/ymtc: Fix ymtc-nvme.c space indentation to tab indentation

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/virtium: Fix virtium-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 4 Jun 2023 12:13:56 +0000 (21:13 +0900)]
plugins/virtium: Fix virtium-nvme.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/transcend: Fix transcend-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 4 Jun 2023 11:47:51 +0000 (20:47 +0900)]
plugins/transcend: Fix transcend-nvme.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/solidigm: Fix linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 4 Jun 2023 10:21:26 +0000 (19:21 +0900)]
plugins/solidigm: Fix linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/shannon: Fix shannon-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 4 Jun 2023 07:55:46 +0000 (16:55 +0900)]
plugins/shannon: Fix shannon-nvme.c linux kernel check patch errors and warnings

Note: Still the remaining warning messages are not fixed as same with nvme.c.

WARNING: quoted string split across lines
+       const char *desc = "Read operating parameters of the "
+               "specified controller. Operating parameters are grouped "

...

WARNING: quoted string split across lines
+               "are vendor-specific and not changeable. Use set-feature to "
+               "change saveable Features.\n\n"

WARNING: quoted string split across lines
+       const char *desc = "Modify the saveable or changeable "
+               "current operating parameters of the controller. Operating "

...

WARNING: quoted string split across lines
+               "Use get-feature to determine which Features are supported by "
+               "the controller and are saveable/changeable.\n\n"

total: 0 errors, 16 warnings, 381 lines checked

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/seagate: Fix seagate-nvme.c linux kernel check patch warnings
Tokunori Ikegami [Sun, 4 Jun 2023 07:26:47 +0000 (16:26 +0900)]
plugins/seagate: Fix seagate-nvme.c linux kernel check patch warnings

Note: Still the remaining warning messages are not fixed as same with nvme.c.

WARNING: quoted string split across lines
+       const char *log_specific = "1 - controller shall capture Data representing the internal "
+               "state of the controller at the time the command is processed. "

WARNING: quoted string split across lines
+               "state of the controller at the time the command is processed. "
+               "0 - controller shall not update the Telemetry Host Initiated Data.";

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/scaleflux: Fix sfx-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 4 Jun 2023 01:30:29 +0000 (10:30 +0900)]
plugins/scaleflux: Fix sfx-nvme.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/netapp: Fix netapp-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 4 Jun 2023 00:55:31 +0000 (09:55 +0900)]
plugins/netapp: Fix netapp-nvme.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/nbft: Fix nbft-plugin.c linux kernel check patch warnings
Tokunori Ikegami [Sun, 4 Jun 2023 00:47:06 +0000 (09:47 +0900)]
plugins/nbft: Fix nbft-plugin.c linux kernel check patch warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/micron: Fix micron-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sat, 3 Jun 2023 17:38:36 +0000 (02:38 +0900)]
plugins/micron: Fix micron-nvme.c linux kernel check patch errors and warnings

Note: Still the remaining warning messages are not fixed as same with nvme.c.

WARNING: quoted string split across lines
+               "This performs a selective firmware download, which allows the user to "
+               "select which firmware binary to update for 9200 devices. This requires "

WARNING: quoted string split across lines
+               "select which firmware binary to update for 9200 devices. This requires "
+               "a power cycle once the update completes. The options available are:\n\n"

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/micron: Fix micron-nvme.c space indentation to tab indentation
Tokunori Ikegami [Sat, 3 Jun 2023 13:22:39 +0000 (22:22 +0900)]
plugins/micron: Fix micron-nvme.c space indentation to tab indentation

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/memblaze: Fix memblaze-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sat, 3 Jun 2023 12:59:21 +0000 (21:59 +0900)]
plugins/memblaze: Fix memblaze-nvme.c linux kernel check patch errors and warnings

Note: Still the remaining warning messages are not fixed as same with nvme.c.

WARNING: quoted string split across lines
+               "This performs a selective firmware download, which allows the user to "
+               "select which firmware binary to update for 9200 devices. This requires a power cycle once the "

WARNING: quoted string split across lines
+               "select which firmware binary to update for 9200 devices. This requires a power cycle once the "
+               "update completes. The options available are:\n\n"

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/memblaze: Fix memblaze-utils.h space indentation to tab indentation
Tokunori Ikegami [Sat, 3 Jun 2023 12:52:38 +0000 (21:52 +0900)]
plugins/memblaze: Fix memblaze-utils.h space indentation to tab indentation

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/memblaze: Fix memblaze-nvme.c space indentation to tab indentation
Tokunori Ikegami [Sat, 3 Jun 2023 11:51:59 +0000 (20:51 +0900)]
plugins/memblaze: Fix memblaze-nvme.c space indentation to tab indentation

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/intel: Fix intel-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sat, 3 Jun 2023 11:33:58 +0000 (20:33 +0900)]
plugins/intel: Fix intel-nvme.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/inspur: Fix inspur-nvme.c linux kernel check patch warnings
Tokunori Ikegami [Sat, 3 Jun 2023 06:40:10 +0000 (15:40 +0900)]
plugins/inspur: Fix inspur-nvme.c linux kernel check patch warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/inspur: Fix inspur-nvme.c space indentation to tab indentation
Tokunori Ikegami [Sat, 3 Jun 2023 06:37:13 +0000 (15:37 +0900)]
plugins/inspur: Fix inspur-nvme.c space indentation to tab indentation

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/innogrit: Fix innogrit-nvme.c linux kernel check patch errors
Tokunori Ikegami [Sat, 3 Jun 2023 06:28:54 +0000 (15:28 +0900)]
plugins/innogrit: Fix innogrit-nvme.c linux kernel check patch errors

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/huawei: Fix huawei-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sat, 3 Jun 2023 06:20:21 +0000 (15:20 +0900)]
plugins/huawei: Fix huawei-nvme.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/fdb: Fix fdb.c linux kernel check patch warnings
Tokunori Ikegami [Sat, 3 Jun 2023 06:05:35 +0000 (15:05 +0900)]
plugins/fdb: Fix fdb.c linux kernel check patch warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/dera: Fix dera-nvme.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sat, 3 Jun 2023 06:02:39 +0000 (15:02 +0900)]
plugins/dera: Fix dera-nvme.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/amzn: Fix amzn-nvme.c linux kernel check patch error and warnings
Tokunori Ikegami [Sat, 3 Jun 2023 05:52:46 +0000 (14:52 +0900)]
plugins/amzn: Fix amzn-nvme.c linux kernel check patch error and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/wdc: Fix wdc-utils.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sat, 3 Jun 2023 03:23:59 +0000 (12:23 +0900)]
plugins/wdc: Fix wdc-utils.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/wdc: Refactor wdc-nvme.c for linux kernel check patch errors and warnings
Tokunori Ikegami [Fri, 2 Jun 2023 17:13:02 +0000 (02:13 +0900)]
plugins/wdc: Refactor wdc-nvme.c for linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoutil: Move falltrhough feature check to meson.build
Tokunori Ikegami [Tue, 6 Jun 2023 08:45:43 +0000 (10:45 +0200)]
util: Move falltrhough feature check to meson.build

Instead cluttering the header file, let's add it to meson.build.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Use correct metadata buffer size
Daniel Wagner [Mon, 5 Jun 2023 15:13:29 +0000 (17:13 +0200)]
nvme: Use correct metadata buffer size

The submit_io command is using the metadata buffer size provided by the
user. But this size argument might be updated and the correct length
for the mbuffer is mbuffer_size. Thus use this value and not the
initial length.

Fixes: 18de3a6d61a7 ("Convert to libnvme")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print-binary: Refactor binary print code to use print_ops
Daniel Wagner [Fri, 2 Jun 2023 10:17:16 +0000 (12:17 +0200)]
nvme-print-binary: Refactor binary print code to use print_ops

Use the newly introduced print_ops infrastructure to for the binary
printing code.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print-stdout: Refactor stdout print code to use print_ops
Daniel Wagner [Wed, 31 May 2023 18:52:09 +0000 (20:52 +0200)]
nvme-print-stdout: Refactor stdout print code to use print_ops

Use the newly introduced print_ops infrastructure to for the stdout
printing code.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print-json: Refactor json print code to use nvme_print_ops
Daniel Wagner [Wed, 31 May 2023 18:38:12 +0000 (20:38 +0200)]
nvme-print-json: Refactor json print code to use nvme_print_ops

Use the newly introduced print_ops infrastructure to for the json
printing code.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoprint: Introduce print ops structure
Daniel Wagner [Fri, 19 May 2023 16:33:29 +0000 (18:33 +0200)]
print: Introduce print ops structure

Introduce callbacks for printing the nvme data structures. With this we
are able to split the two printing types (stdout and json) and just use
the ops the user selects ('-o json' for example).

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Move printing functions to the print files
Daniel Wagner [Tue, 30 May 2023 11:44:06 +0000 (13:44 +0200)]
fabrics: Move printing functions to the print files

Move all printing functions to the corresponding print files.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Split add_bitmap implementation
Daniel Wagner [Tue, 30 May 2023 08:08:10 +0000 (10:08 +0200)]
nvme-print: Split add_bitmap implementation

Instead a common function for printing the bitmaps just split it
into the corresponding implementation.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Unify flag passing into functions
Daniel Wagner [Tue, 30 May 2023 07:42:59 +0000 (09:42 +0200)]
nvme-print: Unify flag passing into functions

Use the 'enum nvme_print_flags' type consistently everywhere.
Furthermore, move the flag as last argument where needed.

While at it also do properly indent the functions arguments.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Export generic to string functions
Daniel Wagner [Fri, 26 May 2023 14:00:12 +0000 (16:00 +0200)]
nvme-print: Export generic to string functions

These function do not print anything, thus can be shared between the
different output formats.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Double function definition
Daniel Wagner [Tue, 30 May 2023 07:45:48 +0000 (09:45 +0200)]
nvme-print: Double function definition

The json function is already defined in nvme-print-json.h header file.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/sfx: sfx-nvme add expand-cap & dump evtlog cmd
yjin [Mon, 22 May 2023 10:05:57 +0000 (18:05 +0800)]
plugins/sfx: sfx-nvme add expand-cap & dump evtlog cmd

Signed-off-by: yjin <yuekun.jin@scaleflux.com>
2 years agoutil/types: Add generic spinner
Wei Hou [Thu, 1 Jun 2023 18:15:33 +0000 (20:15 +0200)]
util/types: Add generic spinner

Signed-off-by: Wei Hou <wei.hou@scaleflux.com>
2 years agoutil/types: Move convert_ts to util/types
Wei Hou [Thu, 1 Jun 2023 18:07:07 +0000 (20:07 +0200)]
util/types: Move convert_ts to util/types

The time stamp converting function can be reused by various plugins.
Thus move it to the util section.

Signed-off-by: Wei Hou <wei.hou@scaleflux.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugin: Change version and usage names for linux kernel check patch warnings
Tokunori Ikegami [Fri, 2 Jun 2023 00:15:13 +0000 (09:15 +0900)]
plugin: Change version and usage names for linux kernel check patch warnings

Also change usage function as a static function since not used externally.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agofabrics: prevent 'nvme connect' to well-known discovery NQN
Martin George [Mon, 29 May 2023 07:40:33 +0000 (13:10 +0530)]
fabrics: prevent 'nvme connect' to well-known discovery NQN

Using 'nvme connect' to connect to the well-known discovery NQN
could result in a few problems with the current implementation:

1) It does not explicitly disconnect from the discovery subsystem
after usage, thereby leading to a spurious discovery controller
on the host.

2) Multiple 'nvme connect' invocations to the well-known discovery
NQN would result in duplicate discovery controllers on the host.

All this is already handled in 'nvme discover'. So it would be
better to avoid using 'nvme connect' to connect to the well-known
discovery NQN in the first place, and use 'nvme discover' instead
for the same.

Signed-off-by: Martin George <marting@netapp.com>
2 years agoutil: Fix types.c linux kernel check patch warnings
Tokunori Ikegami [Sun, 28 May 2023 13:02:48 +0000 (22:02 +0900)]
util: Fix types.c linux kernel check patch warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoutil: Fix crc32.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 28 May 2023 12:58:00 +0000 (21:58 +0900)]
util: Fix crc32.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoutil: Fix base64.c linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 28 May 2023 12:52:30 +0000 (21:52 +0900)]
util: Fix base64.c linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoutil: Fix argconfig.c linux kernel check patch error and warnings
Tokunori Ikegami [Sun, 28 May 2023 12:47:06 +0000 (21:47 +0900)]
util: Fix argconfig.c linux kernel check patch error and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/toshiba: Fix linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 28 May 2023 12:30:31 +0000 (21:30 +0900)]
plugins/toshiba: Fix linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugin: Fix files linux kernel check patch errors and warnings
Tokunori Ikegami [Sun, 28 May 2023 11:58:24 +0000 (20:58 +0900)]
plugin: Fix files linux kernel check patch errors and warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/ocp: Fix remaining files linux kernel check patch warnings
Tokunori Ikegami [Sun, 28 May 2023 10:38:27 +0000 (19:38 +0900)]
plugins/ocp: Fix remaining files linux kernel check patch warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/ocp: Fix ocp-nvme.c linux kernel check patch warnings
Tokunori Ikegami [Sun, 28 May 2023 10:00:25 +0000 (19:00 +0900)]
plugins/ocp: Fix ocp-nvme.c linux kernel check patch warnings

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/ocp: Fix ocp-nvme.c linux kernel check patch errors
Tokunori Ikegami [Sun, 28 May 2023 08:47:41 +0000 (17:47 +0900)]
plugins/ocp: Fix ocp-nvme.c linux kernel check patch errors

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/solidigm: Added NLog support to Telemetry parsing.
leonardo.da.cunha [Sat, 22 Apr 2023 00:19:50 +0000 (17:19 -0700)]
plugins/solidigm: Added NLog support to Telemetry parsing.
Telemetry Reason Identifier fields changed to start with lower case.

Signed-off-by: leonardo.da.cunha <leonardo.da.cunha@solidigm.com>
2 years agonbft: Add include util/types.h
Daniel Wagner [Thu, 25 May 2023 17:52:58 +0000 (19:52 +0200)]
nbft: Add include util/types.h

util_uuid_to_string() is define in util/types.h, thus include it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonbft: Add stdlib.h include
Daniel Wagner [Thu, 25 May 2023 17:51:29 +0000 (19:51 +0200)]
nbft: Add stdlib.h include

calloc() and free() are defined in stdlib.h, thus include the
definition.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonbft: Make json-c output depending on config flag
Daniel Wagner [Thu, 25 May 2023 17:49:47 +0000 (19:49 +0200)]
nbft: Make json-c output depending on config flag

In case json-c is not available avoid compilation errors.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print-json: Update function sigs for !json-c builds
Daniel Wagner [Thu, 25 May 2023 17:37:09 +0000 (19:37 +0200)]
nvme-print-json: Update function sigs for !json-c builds

The json_output_* function got updated, but the !json-c case was not
updated accordingly. Update them now.

Fixes: e853da696ea4 ("nvme-print-json: Add json output result function")
Fixes: 6e3e1cc8d5b2 ("nvme: Add nvme_show_perror to use instead of perror for json output")
Fixes: 2b0bc4d824d0 ("nvme-printf: Add show error function for nvme list command json output")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Do not use json-c fallback for muon minimal build
Daniel Wagner [Thu, 25 May 2023 17:31:55 +0000 (19:31 +0200)]
build: Do not use json-c fallback for muon minimal build

Configure the muon minimal build without using the json-c
fallback. This ensures that the case where json-c is not
available is also compile tested.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoocp: Add eol plp failure mode json outputs
Tokunori Ikegami [Sun, 21 May 2023 15:55:52 +0000 (00:55 +0900)]
ocp: Add eol plp failure mode json outputs

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme-print: Add nvme show result function
Tokunori Ikegami [Sun, 21 May 2023 15:54:02 +0000 (00:54 +0900)]
nvme-print: Add nvme show result function

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme-print-json: Add json output result function
Tokunori Ikegami [Sun, 21 May 2023 15:51:52 +0000 (00:51 +0900)]
nvme-print-json: Add json output result function

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme-print: Fix nvme_show_error() to call va_end() for json output format
Tokunori Ikegami [Sun, 21 May 2023 14:08:02 +0000 (23:08 +0900)]
nvme-print: Fix nvme_show_error() to call va_end() for json output format

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme: Fix nvme format block-size option handling
Mateusz Kozlowski [Tue, 23 May 2023 13:14:26 +0000 (15:14 +0200)]
nvme: Fix nvme format block-size option handling

nlbaf returned by id-ns is a 0 based value, so the previous handling of
the loop skipped checking the last lbaf.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@solidigm.com>
2 years agoRevert "nvme: Masks SSTAT in sanize-log output"
Maurizio Lombardi [Tue, 23 May 2023 13:08:40 +0000 (15:08 +0200)]
Revert "nvme: Masks SSTAT in sanize-log output"

The NVME_SANITIZE_SSTAT_STATUS_MASK is used to mask the
3 least significant bits (representing the status of the most recent
sanitize operation) of the SSTAT field.

The SSTAT field is 16 bits wide and contains other information too, such
as the Global Data Erased bit and the number of completed passes.

Revert this commit so nvme-cli will print the entire SSTAT field

This reverts commit 7092ff55c5d9017231a68fa4dbb9a37b42d61d61.

2 years agofabrics: Fix NVMF_ARGS macro indentation error
Tokunori Ikegami [Sat, 20 May 2023 01:15:12 +0000 (10:15 +0900)]
fabrics: Fix NVMF_ARGS macro indentation error

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoDocumentation: Add document for OCP Device capability(LID: 0xC4) log page
Arunpandian J [Wed, 17 May 2023 13:25:36 +0000 (18:55 +0530)]
Documentation: Add document for OCP Device capability(LID: 0xC4) log page

Signed-off-by: Arunpandian J <arun.j@samsung.com>
2 years agocompletions: Add bash completion for OCP Device capability(LID: 0xC4) log page
Arunpandian J [Wed, 17 May 2023 13:23:33 +0000 (18:53 +0530)]
completions: Add bash completion for OCP Device capability(LID: 0xC4) log page

Signed-off-by: Arunpandian J <arun.j@samsung.com>
2 years agoplugins/ocp: Add Device capability(LID: 0xC4) log page
Arunpandian J [Wed, 17 May 2023 13:17:42 +0000 (18:47 +0530)]
plugins/ocp: Add Device capability(LID: 0xC4) log page

Signed-off-by: Arunpandian J <arun.j@samsung.com>
2 years agoudev: fix warning reported by udevadm verify
Dmitry V. Levin [Fri, 19 May 2023 08:00:00 +0000 (08:00 +0000)]
udev: fix warning reported by udevadm verify

Fix the following warning reported by udevadm verify:

nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules.in:18 Whitespace after comma is expected.
nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules.in: udev rules check failed

Signed-off-by: Dmitry V. Levin <ldv@strace.io>
2 years agofabrics: fix conditions in nvmf-autoconnect.service
Martin Wilck [Tue, 23 May 2023 10:43:46 +0000 (12:43 +0200)]
fabrics: fix conditions in nvmf-autoconnect.service

The unit should be started if either config.json or discovery.conf
exists. The current syntax would start it if either one does not
exist. Fix it.

Fixes: eec7634 ("fabrics: Trigger auto connect if config.json exists")
Signed-off-by: Martin Wilck <mwilck@suse.com>