]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
11 months agobuild: bump libnvme wrap
Nitin Sao [Tue, 6 Aug 2024 05:40:13 +0000 (11:10 +0530)]
build: bump libnvme wrap

fetch NVME_CMD_EFFECTS_CSER_MASK from enum nvme_cmd_effects

Signed-off-by: Nitin Sao <nitin.sao@samsung.com>
11 months agoplugins: Add a new DapuStor plugin and the smart-log-add command
Xiaoyuan Zhang [Tue, 6 Aug 2024 07:37:09 +0000 (15:37 +0800)]
plugins: Add a new DapuStor plugin and the smart-log-add command

Add the DapuStor plugin to support the retrieval and
display of the Vendor Specific SMART logs:
Additional SMART log page (0xCA)
Extended Additional SMART log page (0xCB)

Signed-off-by: Xiaoyuan Zhang <zhxiaoy2024@gmail.com>
11 months agoRelease v2.10.2
Daniel Wagner [Mon, 5 Aug 2024 13:42:49 +0000 (15:42 +0200)]
Release v2.10.2

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agodoc: Regenerate all docs for v2.10.2
Daniel Wagner [Mon, 5 Aug 2024 13:42:49 +0000 (15:42 +0200)]
doc: Regenerate all docs for v2.10.2

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agobuild: fix libnvme dependency
Daniel Wagner [Mon, 5 Aug 2024 13:41:52 +0000 (15:41 +0200)]
build: fix libnvme dependency

Undo last libnvme dependency update which was done automatically
done by the release script.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agoRelease v2.10.1
Daniel Wagner [Mon, 5 Aug 2024 13:33:31 +0000 (15:33 +0200)]
Release v2.10.1

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agodoc: Regenerate all docs for v2.10.1
Daniel Wagner [Mon, 5 Aug 2024 13:33:31 +0000 (15:33 +0200)]
doc: Regenerate all docs for v2.10.1

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agobuild: add install step to doc CI build
Daniel Wagner [Fri, 2 Aug 2024 11:08:13 +0000 (13:08 +0200)]
build: add install step to doc CI build

We had some fallouts which were happened at the install step when the
documentation was build. Let's add this step, so we catch those errors
in future.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agodocs: rename ocp-unsupported-req-log file
Daniel Wagner [Fri, 2 Aug 2024 09:46:49 +0000 (11:46 +0200)]
docs: rename ocp-unsupported-req-log file

The filename has to match the command name, thus rename the filename.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agoRelease v2.10
Daniel Wagner [Fri, 2 Aug 2024 07:58:11 +0000 (09:58 +0200)]
Release v2.10

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agodoc: Regenerate all docs for v2.10
Daniel Wagner [Fri, 2 Aug 2024 07:58:11 +0000 (09:58 +0200)]
doc: Regenerate all docs for v2.10

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agobuild: bump libnvme wrap
Daniel Wagner [Fri, 2 Aug 2024 07:54:53 +0000 (09:54 +0200)]
build: bump libnvme wrap

Update to libnvme v1.10 release.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agosed: Fix parsing of Discovery0 features
Milan Broz [Thu, 1 Aug 2024 08:41:50 +0000 (10:41 +0200)]
sed: Fix parsing of Discovery0 features

TCG SED features have variable sizes, so the code needs to use
stored length to move the offset for the next feature.
Otherwise, it checks the code at the wrong offset.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
11 months agofabrics: avoid potential segfault in nvmf_dim()
Martin George [Thu, 1 Aug 2024 19:07:12 +0000 (00:37 +0530)]
fabrics: avoid potential segfault in nvmf_dim()

Eliminate the call to nvme_free_tree() in nvmf_dim() since the
cleanup helper is already available here.

Signed-off-by: Martin George <marting@netapp.com>
11 months agonvme: avoid segfault in show-topology
Martin George [Thu, 1 Aug 2024 19:02:27 +0000 (00:32 +0530)]
nvme: avoid segfault in show-topology

The show-topology command currently ends in a segfault for
ENOENT scenarios:

nvme show-topology
Failed to scan topology: No such file or directory
Segmentation fault (core dumped)

Fix this by eliminating the call to nvme_free_tree() since the
cleanup helper is already available here.

Signed-off-by: Martin George <marting@netapp.com>
11 months agofabrics: do not leak nvme_ctrl_t object on connect
Daniel Wagner [Thu, 1 Aug 2024 13:08:06 +0000 (15:08 +0200)]
fabrics: do not leak nvme_ctrl_t object on connect

valgrinds reports that the nvme_ctrl_t is leaked in the connect command.
Let's introduced a new cleanup helper for this.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agonvme: extend help message when mmap regs fails
Daniel Wagner [Thu, 1 Aug 2024 11:23:28 +0000 (13:23 +0200)]
nvme: extend help message when mmap regs fails

Newer kernels enable the lockdown feature when secure boot is enabled.
This feature also prevents the register mapping into userspace. Thus it
is not enough to have CONFIG_IO_STRICT_DEVMEM disabled. Extend the
message with the hint also to disable secure boot.

While at it, also lower the reporting level to INFO, so that one single
'-v' is enough to get this information.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agonvme: return -ENXIO value to open device if errno not set
Tokunori Ikegami [Thu, 18 Jul 2024 15:11:10 +0000 (00:11 +0900)]
nvme: return -ENXIO value to open device if errno not set

The APIs may not set errno so set errno to ENXIO before the device open.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
11 months agowdc: OCP 2.5 Log Page Updates
jeff-lien-wdc [Tue, 16 Jul 2024 20:26:49 +0000 (15:26 -0500)]
wdc: OCP 2.5 Log Page Updates

Add panic count and prev panic id to Error Recovery log page (0xC1)

Add debug telemetry log size to Latency Monitor log page (0xc3)

Signed-off-by: jeff-lien-wdc <jeff.lien@wdc.com>
11 months agofabrics: drop --quiet alias -S
Daniel Wagner [Thu, 11 Jul 2024 17:06:29 +0000 (19:06 +0200)]
fabrics: drop --quiet alias -S

-S has been allocated for the global dhchap secret option. It's likely
that the --quiet option is less used, thus drop the -S alias for it.

Fixes: 0571307d3af0 ("nvme-connect: Add 'dhchap-secret' and 'dhchap-ctrl-secret' arguments")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agofabrics: drop --disable-sqflow alias -d
Daniel Wagner [Thu, 11 Jul 2024 16:53:36 +0000 (18:53 +0200)]
fabrics: drop --disable-sqflow alias -d

The alias for --disable-sqflow -d clashes with --device for the
discover command. Since the --disable-sqflow is not so commonly used,
let's free -d for other uses.

Fixes: 18de3a6d61a7 ("Convert to libnvme")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agofabrics: check if json config is existing
Daniel Wagner [Thu, 11 Jul 2024 16:42:23 +0000 (18:42 +0200)]
fabrics: check if json config is existing

nvme_read_config will return success even if the file doesn't exist.
This leads to the situation that we always execute
discover_from_json_config_file even though there is no json config
file.

One side effect of this is that when executing 'nvme discover -d
/dev/nvmeXXX' we will always do a discover for the first controller we
find.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agoplugins/ocp: fix UAF when printing telemetry log
Vigneshwaran Saravanan/Vigneshwaran Saravanan [Tue, 30 Jul 2024 13:45:52 +0000 (19:15 +0530)]
plugins/ocp: fix UAF when printing telemetry log

Take care the below failures for "telemetry-string-log". Resolved the
Segmentation Fault issue while printing.

Signed-off-by: Vigneshwaran Saravanan/Vigneshwaran Saravanan <s.vignesh@samsung.com>
Reviewed-by: Karthik Balan <karthik.b82@samsung.com>
Reviewed-by: Arunpandian J <arun.j@samsung.com>
11 months agonvme-print-stdout: fix persistent-event-log set feature event output
Xiaoyuan Zhang [Sat, 27 Jul 2024 07:46:30 +0000 (15:46 +0800)]
nvme-print-stdout: fix persistent-event-log set feature event output

Refer to FDP Events Set Feature Data Structure:
the number of FDP Event Types is only Dword11 bits [23:16].
the buffer only contains FDP Event Type.

The value of mem_buf is incorrect:
the pointer 'set_feat_event' should be converted to 'unsigned char *' first

Signed-off-by: Xiaoyuan Zhang <zhxiaoy2024@gmail.com>
11 months agofabrics: do not report error when no modules are loaded when disconnecting
Daniel Wagner [Fri, 26 Jul 2024 12:20:09 +0000 (14:20 +0200)]
fabrics: do not report error when no modules are loaded when disconnecting

Do not report an error when the libnvme reports that the subsystem is
not available when the user tries to disconnect. This allows the user to
call disconnect without filtering this special case. The result is the
same, after this call the host is not connected anymore.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agofabrics: use cleanup helper where possible
Daniel Wagner [Fri, 26 Jul 2024 12:14:16 +0000 (14:14 +0200)]
fabrics: use cleanup helper where possible

Let's make the error path shorter and simpler by using the cleanup
helpers.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
11 months agofabrics: print an error for ENOENT too
Martin George [Wed, 17 Jul 2024 08:17:51 +0000 (13:47 +0530)]
fabrics: print an error for ENOENT too

Many nvme commands such as discover, connect, connect-all, etc.
simply return to the prompt without printing any useful error
message when the respective nvme driver modules are not loaded in
the kernel. This is because nothing gets printed when
nvme_scan_topology() returns an ENOENT due to missing nvme system
files stemming from not loading the appropriate nvme modules.
Fix the same.

Signed-off-by: Martin George <marting@netapp.com>
12 months agoplugins/virtium: use time_t for time_stamp values
Heitor Alves de Siqueira [Wed, 24 Jul 2024 16:15:35 +0000 (13:15 -0300)]
plugins/virtium: use time_t for time_stamp values

In the vtview_log structs, time_t should be used for any time_stamp
values instead of long. This ensures correct builds on 32-bit
architectures even with 64-bit time_t (e.g. armhf on Ubuntu).

Signed-off-by: Heitor Alves de Siqueira <halves@canonical.com>
12 months agocompletions: add ocp set-error-injection command
Tokunori Ikegami [Sun, 21 Jul 2024 01:16:28 +0000 (10:16 +0900)]
completions: add ocp set-error-injection command

The command injects error conditions.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agodoc: add ocp set-error-injection command
Tokunori Ikegami [Sun, 21 Jul 2024 00:53:11 +0000 (09:53 +0900)]
doc: add ocp set-error-injection command

The command injects error conditions.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agoocp: add set-error-injection command
Tokunori Ikegami [Sun, 7 Jul 2024 14:37:43 +0000 (23:37 +0900)]
ocp: add set-error-injection command

The command injects error conditions.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agonvme: use argconfig_parse_seen to check conditions
zhangxiaoyuan [Fri, 19 Jul 2024 10:23:44 +0000 (18:23 +0800)]
nvme: use argconfig_parse_seen to check conditions

The value of NVME_FEAT_FID_TIMESTAMP cannot be set
to 0 through 'set-feature /dev/nvmeX -f 0xe -v 0'.
using argconfig_parse_seen() can fix this issue.

Signed-off-by: Xiaoyuan Zhang <zhxiaoy@outlook.com>
12 months agonvme: use proper mask to get correct lbafu value
Francis Pravin [Thu, 18 Jul 2024 10:05:44 +0000 (15:35 +0530)]
nvme: use proper mask to get correct lbafu value

The NVME_NS_FLBAS_HIGHER/LOWER_MASK is used to get the format index
value from Formatted LBA Size (FLBAS) field of Identify Namespace
Data Structure. But, We are not getting the proper lbafu value while
using the same macro on user passed format index value.
So, use the proper mask to get the correct lbafu value.

Signed-off-by: Francis Pravin <francis.p@samsung.com>
Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
12 months agoutils: fix print formatting option
Daniel Wagner [Wed, 17 Jul 2024 15:39:23 +0000 (17:39 +0200)]
utils: fix print formatting option

A 64bit value to print needs to use the PRIx macros to work on 32bit and
64bit platforms.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agoutils: cleanup includes in utils.h
Daniel Wagner [Wed, 17 Jul 2024 15:25:18 +0000 (17:25 +0200)]
utils: cleanup includes in utils.h

There a plenty of includes which are not necessary. Remove them.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agoutils: add missing header
Daniel Wagner [Wed, 17 Jul 2024 15:24:32 +0000 (17:24 +0200)]
utils: add missing header

The build breaks because convert_ts is missing.

Also utils.c depends on json_object_add_value_string, thus define one
when we don't use json-c.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agonvme-print: Added print for two new fields for HMB feature
Nitin Sao [Tue, 16 Jul 2024 06:28:18 +0000 (11:58 +0530)]
nvme-print: Added print for two new fields for HMB feature

As per TP4104, added print for two new fields for HMB feature
HMNARE (Host Memory Non-operational Access Restriction Enable) and
HMNAR (Host Memory Non-operational Access Restricted) with 1 bit
each. Bit 1 is not used for Get Feature command and will be 0.
And added print for HMBR field in stdout_id_ctrl_ctratt.

Signed-off-by: Nitin Sao <nitin.sao@samsung.com>
Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Reviewed-by: Mohit Kapoor <mohit.kap@samsung.com>
12 months agoplugins/micron: Move OCP internal log parsing from Micron to OCP Plugin.
Chaithanya shoba [Sun, 14 Jul 2024 17:29:11 +0000 (22:59 +0530)]
plugins/micron: Move OCP internal log parsing from Micron to OCP Plugin.

Move OCP internal log parsing from Micron to OCP Plugin. Previous
PR https://github.com/linux-nvme/nvme-cli/pull/2354. Datacenter
NVMe SSD Specification v2.5r9, section 4.9.

Signed-off-by: Chaithanya shoba <ashoba@micron.com>
12 months agofabrics: remove unused _discover_from_json_config_file() argument
Caleb Sander Mateos [Wed, 17 Jul 2024 02:26:05 +0000 (20:26 -0600)]
fabrics: remove unused _discover_from_json_config_file() argument

_discover_from_json_config_file() takes a nvme_subsystem_t argument
but doesn't use it.
Drop the unnecessary argument.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Fixes: b3b9963396c5 ("fabrics: refactore discover from json config")
12 months agonvme: avoid unnecessary dup() + close() in io_mgmt_send()
Caleb Sander Mateos [Wed, 17 Jul 2024 02:04:04 +0000 (20:04 -0600)]
nvme: avoid unnecessary dup() + close() in io_mgmt_send()

_cleanup_fd_ doesn't close STD{IN,OUT,ERR}_FILENO,
so don't bother creating a duplicate fd.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Fixes: 7e1f6799f8cd ("nvme: use cleanup helper to close file descriptor")
12 months agoutil: remove unnecessary NULL check in cleanup_nvme_root()
Caleb Sander Mateos [Tue, 16 Jul 2024 15:59:29 +0000 (09:59 -0600)]
util: remove unnecessary NULL check in cleanup_nvme_root()

cleanup_nvme_root() is checking whether the passed pointer is non-NULL,
but since the pointer is to a local variable, this will always be true.
Therefore, remove the check and always call nvme_free_tree().

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agonvme: use argconfig_parse_comma_sep_array_u16() in attach-ns
Caleb Sander Mateos [Tue, 16 Jul 2024 21:34:57 +0000 (15:34 -0600)]
nvme: use argconfig_parse_comma_sep_array_u16() in attach-ns

nvme_attach_ns() is using argconfig_parse_comma_sep_array()
to parse a list of ints and then copying them into a list of u16s.

Use argconfig_parse_comma_sep_array_u16() instead to save on memory
and avoid needing to copy the values to another list.
This also checks that the values fit in u16.

Also use NVME_ID_CTRL_LIST_MAX instead of hard-coding the max list size.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: avoid duplication in argconfig_parse_comma_sep_array*()
Caleb Sander Mateos [Tue, 16 Jul 2024 21:28:53 +0000 (15:28 -0600)]
util: avoid duplication in argconfig_parse_comma_sep_array*()

Use the loop body to convert the first token to an int.

Extend the existing macro so it can be used to define all the functions.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: remove redundant loop condition in argconfig_parse()
Caleb Sander Mateos [Tue, 16 Jul 2024 19:11:34 +0000 (13:11 -0600)]
util: remove redundant loop condition in argconfig_parse()

Since options_count is computed as the number of options
until the first one with a NULL option field,
s->option and option_index < options_count are equivalent.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: introduce is_null_or_empty() to avoid strlen()
Caleb Sander Mateos [Tue, 16 Jul 2024 21:43:18 +0000 (15:43 -0600)]
util: introduce is_null_or_empty() to avoid strlen()

argconfig uses strlen() in several places to check for empty strings.
strlen() traverses the entire string though only the first char matters.

Add a helper function is_null_or_empty() that only checks the first char
for NUL. It also encapsulates the NULL check performed by each caller.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: reduce allocation sizes in argconfig_parse()
Caleb Sander Mateos [Tue, 16 Jul 2024 19:07:23 +0000 (13:07 -0600)]
util: reduce allocation sizes in argconfig_parse()

long_opts stores up to 1 element per option, plus a help element,
and a zerored final element. So it can be allocated with length
options_count + 2 instead of options_count + 3.
short_opts stores up to 3 characters per option, plus 2 help characters,
and a NUL terminator. So it can be allocated with length
options_count * 3 + 3 instead of options_count * 3 + 5.

Also use the two arguments to calloc() instead of multiplying the sizes.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: consolidate call paths to argconfig_parse_type()
Caleb Sander Mateos [Tue, 16 Jul 2024 19:01:36 +0000 (13:01 -0600)]
util: consolidate call paths to argconfig_parse_type()

argconfig_parse_val() already falls back on argconfig_parse_type()
if no option values match.
So always call argconfig_parse_val() from argconfig_parse()
instead of checking whether any option values are defined.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: reduce complexity of argconfig_parse_val()
Caleb Sander Mateos [Tue, 16 Jul 2024 16:53:59 +0000 (10:53 -0600)]
util: reduce complexity of argconfig_parse_val()

Assuming constant-length value strings, argconfig_parse_val()'s runtime
is currently quadratic in the number of option values.
For each option value, it computes a minimum prefix length
that distinguishes that option from all others.
It then checks whether the input matches up to that prefix length.

Instead, compare the input directly against each option value.
If exactly one matches, select that option value.
Otherwise, fallback on the default value parser.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: reduce arguments passed to argconfig_parse_type()
Caleb Sander Mateos [Tue, 16 Jul 2024 16:35:07 +0000 (10:35 -0600)]
util: reduce arguments passed to argconfig_parse_type()

Arguments option and index are only used to get the name of the option.
This can be obtained from s->option instead.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: remove empty default case in argconfig functions
Caleb Sander Mateos [Tue, 16 Jul 2024 16:21:04 +0000 (10:21 -0600)]
util: remove empty default case in argconfig functions

Both argconfig_parse_type() and argconfig_set_opt_val()
switch on the argument value type and have an empty default case.
This is unnecessary and masks errors from unhandled enum values.
So drop the default cases.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: remove unnecessary parentheses in argconfig_parse_type()
Caleb Sander Mateos [Tue, 16 Jul 2024 16:17:46 +0000 (10:17 -0600)]
util: remove unnecessary parentheses in argconfig_parse_type()

Match the style in argconfig_set_opt_val().

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: remove redundant cast in argconfig_parse_type()
Caleb Sander Mateos [Tue, 16 Jul 2024 16:13:01 +0000 (10:13 -0600)]
util: remove redundant cast in argconfig_parse_type()

s->default_value is already a void *,
so there is no need to cast it to a char * and back.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: inline argconfig_parse_byte()
Caleb Sander Mateos [Tue, 16 Jul 2024 16:10:48 +0000 (10:10 -0600)]
util: inline argconfig_parse_byte()

argconfig_parse_byte() is only used in argconfig_parse_type().
For consistency with the other cases, inline it into the function.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: remove redundant NULL check in argconfig_print_help()
Caleb Sander Mateos [Tue, 16 Jul 2024 16:05:41 +0000 (10:05 -0600)]
util: remove redundant NULL check in argconfig_print_help()

s has been checked to be non-NULL earlier,
so there is no need to check it in the loop.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: use cleanup to avoid goto in argconfig_parse()
Caleb Sander Mateos [Tue, 16 Jul 2024 15:57:38 +0000 (09:57 -0600)]
util: use cleanup to avoid goto in argconfig_parse()

Use _cleanup_free_ in place of explicit calls to free()
in argconfig_parse(). This simplifies the code
and allows using an early return in place of a goto.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: make argconfig_set_opt_val() a void function
Caleb Sander Mateos [Tue, 16 Jul 2024 15:49:46 +0000 (09:49 -0600)]
util: make argconfig_set_opt_val() a void function

argconfig_set_opt_val() always returns 0,
so there is no need for its return value.
Return 0 in the one caller, argconfig_set_opt_val(), instead.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: remove argconfig_parse_val() declaration
Caleb Sander Mateos [Tue, 16 Jul 2024 15:42:36 +0000 (09:42 -0600)]
util: remove argconfig_parse_val() declaration

argconfig_parse_val() is defined before it is used,
so there is no need to pre-declare it.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agoutil: remove argconfig CFG_SIZE type
Caleb Sander Mateos [Tue, 16 Jul 2024 18:42:44 +0000 (12:42 -0600)]
util: remove argconfig CFG_SIZE type

CFG_SIZE is unused and not handled by argconfig_set_opt_val().

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agotest: add test cases for argconfig comma-separated array parsing
Caleb Sander Mateos [Tue, 16 Jul 2024 22:46:04 +0000 (16:46 -0600)]
test: add test cases for argconfig comma-separated array parsing

There are no unit tests currently covering
argconfig's comma-separated integer array parsing.
Add test cases to test-argconfig-parse.c
that use argconfig_parse_comma_sep_array_u32(),
verifying its functionality and edge cases.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agotest: add test cases for argconfig option values
Caleb Sander Mateos [Tue, 16 Jul 2024 18:38:11 +0000 (12:38 -0600)]
test: add test cases for argconfig option values

test-argconfig-parse.c tests argconfig option parsing,
but is missing test cases for options with opt_val lists.

Add test cases to verify this functionality and its edge cases.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
12 months agowdc: Update and refactor the C0h log page parsing
jeff-lien-wdc [Mon, 8 Jan 2024 15:38:55 +0000 (09:38 -0600)]
wdc: Update and refactor the C0h log page parsing

Add OCP 2.5 fields
Create common functions to get and parse the
different variations of the C0 log page.

Signed-off-by: jeff-lien-wdc <jeff.lien@wdc.com>
12 months agobuild(deps): bump mosteo-actions/docker-run from 1 to 2
dependabot[bot] [Mon, 15 Jul 2024 18:23:37 +0000 (18:23 +0000)]
build(deps): bump mosteo-actions/docker-run from 1 to 2

Bumps [mosteo-actions/docker-run](https://github.com/mosteo-actions/docker-run) from 1 to 2.
- [Release notes](https://github.com/mosteo-actions/docker-run/releases)
- [Commits](https://github.com/mosteo-actions/docker-run/compare/v1...v2)

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

Signed-off-by: dependabot[bot] <support@github.com>
12 months agobuild: use official download action
Daniel Wagner [Fri, 12 Jul 2024 18:38:38 +0000 (20:38 +0200)]
build: use official download action

There is no point in using 3rd party actions for downloading the
artifacts. Let's use the official one.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agobuild: fetch complete git history
Daniel Wagner [Fri, 12 Jul 2024 12:51:14 +0000 (14:51 +0200)]
build: fetch complete git history

In order to build a image with which contains the correct git version
SHA we need to fetch the complete git tree. Otherwise 'git describe'
fails and we use the project version string as fallback.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agobuild: show git version used during configuration
Daniel Wagner [Fri, 12 Jul 2024 12:18:12 +0000 (14:18 +0200)]
build: show git version used during configuration

Show which git version is used when configuration phase.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agobuild: add static build target
Daniel Wagner [Fri, 12 Jul 2024 11:52:54 +0000 (13:52 +0200)]
build: add static build target

Add a static build target.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agoccan: Add freed pointer checking to delete strset member
Tokunori Ikegami [Fri, 23 Feb 2024 12:07:48 +0000 (21:07 +0900)]
ccan: Add freed pointer checking to delete strset member

Add to set freed entry pointer to NULL then check it if NULL.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agofabrics: connect all hosts in config.json
Daniel Wagner [Tue, 9 Jul 2024 09:02:48 +0000 (11:02 +0200)]
fabrics: connect all hosts in config.json

Iterate over all hosts defined in the config.json configuration file,
instead just the default controller.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agofabrics: refactore discover from json config
Daniel Wagner [Fri, 5 Jul 2024 12:35:30 +0000 (14:35 +0200)]
fabrics: refactore discover from json config

Move the connect logic out of the subsystem, ctrl loop. Too much
indention.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agofabrics: first read config before topology scanning
Daniel Wagner [Thu, 11 Jul 2024 08:49:23 +0000 (10:49 +0200)]
fabrics: first read config before topology scanning

The topology scanning will create nodes in the internal libnvme tree. As
we rely on the order of the nodes in the tree, we need to read the
config before we scan. This makes sure the first node is the one we have
defined in the config.json. This is important because the first node
provides default hosnqn configuration in absents of /etc/nvme/hostnqn.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agofabrics: use helper to lookup default hostnqn/hostid
Daniel Wagner [Wed, 3 Jul 2024 08:22:18 +0000 (10:22 +0200)]
fabrics: use helper to lookup default hostnqn/hostid

libnvme provides a handy new helper to lookup the hostnqn and hostid.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agofabrics: extend already connected message
Daniel Wagner [Thu, 11 Jul 2024 11:40:42 +0000 (13:40 +0200)]
fabrics: extend already connected message

The 'already connected' message only contains the traddr as info. Add
the missing information so that it's possible to figure out what
combination is already in use.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agofabrics: use cleanup helper to free nvme root object
Daniel Wagner [Wed, 3 Jul 2024 09:42:42 +0000 (11:42 +0200)]
fabrics: use cleanup helper to free nvme root object

Simplify the error handling path by using the cleanup helpers.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agobuild: bump libnvme wrap
Daniel Wagner [Fri, 12 Jul 2024 08:20:25 +0000 (10:20 +0200)]
build: bump libnvme wrap

Fetch hostnqn changes.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agonvme: check MD size with PI size when PRACT set to 1
Francis Pravin [Fri, 12 Jul 2024 06:18:51 +0000 (11:48 +0530)]
nvme: check MD size with PI size when PRACT set to 1

As per NVM Command Set Specification, Rev 1.0d, Sec-5.2.2 PRACT Bit:
"If PRACT bit is set to 1 and Metadata size equals to the Protection
Information size, the protection information is stripped or inserted
by the controller."
Currently NVMe supports 8 and 16 byte size of Protection Information.
So, use pi_size instead of 8 byte.

Signed-off-by: Francis Pravin <francis.p@samsung.com>
Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
12 months agonvme-print: add new field added in TP4090
Nitin Sao [Wed, 26 Jun 2024 03:17:42 +0000 (08:47 +0530)]
nvme-print: add new field added in TP4090

As per TP4090, a new field support is added as NPDGL (Namespace
Preferred Deallocate Granularity Large) and so the bit-field of
NSFEAT, OPTPERF get extended by 1 bit.

Signed-off-by: Nitin Sao <nitin.sao@samsung.com>
Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Reviewed-by: Mohit Kapoor <mohit.kap@samsung.com>
12 months agobuild: bump libnvme wrap
Nitin Sao [Wed, 26 Jun 2024 03:17:42 +0000 (08:47 +0530)]
build: bump libnvme wrap

Fetch npdgl field from nvme_nvm_id_ns

Signed-off-by: Nitin Sao <nitin.sao@samsung.com>
12 months agonvme-print-binary: add effects-log command output missed
Tokunori Ikegami [Tue, 9 Jul 2024 15:55:49 +0000 (00:55 +0900)]
nvme-print-binary: add effects-log command output missed

The csi data added before effects log page output.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agobuild: add documentation CI build
Daniel Wagner [Wed, 10 Jul 2024 06:58:16 +0000 (08:58 +0200)]
build: add documentation CI build

Build the documentation in the CI build to catch formatting issues in
the submissions.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agocompletions: add ocp get-error-injection command
Tokunori Ikegami [Sun, 7 Jul 2024 07:52:44 +0000 (16:52 +0900)]
completions: add ocp get-error-injection command

The set-error-injection command will be added separately.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agodoc: add ocp get-error-injection command
Tokunori Ikegami [Sun, 7 Jul 2024 07:36:07 +0000 (16:36 +0900)]
doc: add ocp get-error-injection command

The set-error-injection command will be added separately.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agoocp: add get-error-injection command
Tokunori Ikegami [Sun, 7 Jul 2024 06:08:20 +0000 (15:08 +0900)]
ocp: add get-error-injection command

The set-error-injection command will be added separately.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agoocp: fix eol-plp-failure-mode command sel option value
Tokunori Ikegami [Sun, 7 Jul 2024 09:11:05 +0000 (18:11 +0900)]
ocp: fix eol-plp-failure-mode command sel option value

Since the select value 8 as changed not supported by the command.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agodoc: fix ocp eol-plp-failure-mode select short option
Tokunori Ikegami [Sun, 7 Jul 2024 08:20:55 +0000 (17:20 +0900)]
doc: fix ocp eol-plp-failure-mode select short option

Fix -s to -S since the -s is used for the save short option.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agoocp: set UUID index for eol-plp-failure-mode command to get
Tokunori Ikegami [Sun, 7 Jul 2024 06:28:54 +0000 (15:28 +0900)]
ocp: set UUID index for eol-plp-failure-mode command to get

The value required from OCP version 2.0 for get feature command also.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agonvme: fix verbose logging
Martin George [Mon, 8 Jul 2024 16:03:58 +0000 (21:33 +0530)]
nvme: fix verbose logging

The -v verbose option for certain nvme commands like id-ctrl,
id-ns, smart-log, sanitize-log, etc. is practically a no-op since
it only prints latency info in addition to the regular output.
But at the same time, these commands already implement a -H human
readable option which prints additional useful info. So fix the
-v option to make it synonymous with the -H option here. And while
we are at it, move the latency info from current INFO level (i.e.
-v logging) to DEBUG level (i.e. -vv logging) since it is better
suited there.

Signed-off-by: Martin George <marting@netapp.com>
12 months agodoc: fix micron ocp telemetry log parse title
Daniel Wagner [Tue, 9 Jul 2024 15:38:41 +0000 (17:38 +0200)]
doc: fix micron ocp telemetry log parse title

The title needs a man page section info.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
12 months agonvme-rpmb: send RPMB_REQ_READ_RESULT for authentication key programming
Tokunori Ikegami [Fri, 28 Jun 2024 11:57:40 +0000 (20:57 +0900)]
nvme-rpmb: send RPMB_REQ_READ_RESULT for authentication key programming

This follows the NVMe revision 2.0a authentication key data flow.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agoplugins/micron: Add support for OCP telemetry log parsing
Chaithanya shoba [Fri, 24 May 2024 07:26:08 +0000 (12:56 +0530)]
plugins/micron: Add support for OCP telemetry log parsing

Datacenter NVMe SSD Specification v2.5r9, section 4.9.

Signed-off-by: Chaithanya Shoba <ashoba@micron.com>
12 months agoocp: Update Plugin Version
jeff-lien-wdc [Fri, 5 Jul 2024 14:35:08 +0000 (09:35 -0500)]
ocp: Update Plugin Version

Update ocp plugin version to 2.9.0

Signed-off-by: jeff-lien-wdc <jeff.lien@wdc.com>
12 months agonvme: fix lbaf inuse to use 6:5 bits
Steven Seungcheol Lee [Mon, 8 Jul 2024 06:55:54 +0000 (15:55 +0900)]
nvme: fix lbaf inuse to use 6:5 bits

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
12 months agoocp: use NVME_ARGS macro definition by eol-plp-failure-mode command
Tokunori Ikegami [Sun, 7 Jul 2024 13:55:14 +0000 (22:55 +0900)]
ocp: use NVME_ARGS macro definition by eol-plp-failure-mode command

The verbose, output-format and timeout options enabled by the macro.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agonvme: extern NVME_ARGS macro definition
Tokunori Ikegami [Sun, 7 Jul 2024 13:52:41 +0000 (22:52 +0900)]
nvme: extern NVME_ARGS macro definition

To use the macro by the plugins/ocp commands etc.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agonvme: use _cleanup_free_ type buffer for get-feature command
Tokunori Ikegami [Sat, 6 Jul 2024 11:35:25 +0000 (20:35 +0900)]
nvme: use _cleanup_free_ type buffer for get-feature command

Reduce the buffer free calls.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agoplugins/ocp: Update telemetry string log page (C9h)
Vigneshwaran Saravanan/Vigneshwaran Saravanan [Thu, 4 Jul 2024 08:36:02 +0000 (14:06 +0530)]
plugins/ocp: Update telemetry string log page (C9h)

Take care the below failures for "telemetry-string-log".

Resolved the json printing issue.

Changed the Statistic Identifier, Event String, Vendor Unique, ASCII
table offset and size calculation.

Reviewed-by: Karthik Balan <karthik.b82@samsung.com>
Reviewed-by: Arunpandian J <arun.j@samsung.com>
Reviewed-by: Jayakanthan Rajendran <jaya.ganthan@samsung.com>
Signed-off-by: Vigneshwaran Saravanan <s.vignesh@samsung.com>
12 months agonvme-print-json: add get-feature command fahrenheit temperature output
Tokunori Ikegami [Sun, 30 Jun 2024 06:56:27 +0000 (15:56 +0900)]
nvme-print-json: add get-feature command fahrenheit temperature output

Add temperature threshold and host controlled thermal management outputs.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agonvme: add get-feature and id-ctrl commands fahrenheit outputs
Tokunori Ikegami [Fri, 5 Jul 2024 16:01:15 +0000 (01:01 +0900)]
nvme: add get-feature and id-ctrl commands fahrenheit outputs

Show temperatures in degrees fahrenheit by the option.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agonvme: delete smart-log command fahrenheit option
Tokunori Ikegami [Fri, 5 Jul 2024 15:52:48 +0000 (00:52 +0900)]
nvme: delete smart-log command fahrenheit option

Used locale for the fahrenheit temperature instead.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agonvme-print: check locale to use temperatures in degrees fahrenheit
Tokunori Ikegami [Thu, 4 Jul 2024 16:55:45 +0000 (01:55 +0900)]
nvme-print: check locale to use temperatures in degrees fahrenheit

Delete the fahrenheit option separately.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
12 months agocompletion: add support for tls-key
Daniel Wagner [Thu, 4 Jul 2024 17:17:46 +0000 (19:17 +0200)]
completion: add support for tls-key

The tls-key command is missing support for the zsh and bash completion.

Signed-off-by: Daniel Wagner <dwagner@suse.de>