Francis Pravin [Mon, 13 May 2024 08:56:44 +0000 (14:26 +0530)]
nvme: fix fw-commit MUD result message
As per spec, 0th bit is set when the controller detects an overlapping
firmware/boot partition image update command sequence due to processing
a command from an Admin Submission Queue on a controller and the 1st bit
is set due to processing the command from Management Endpoint. So, fixed
the MUD result message.
Signed-off-by: Francis Pravin <francis.p@samsung.com>
Greg Joyce [Fri, 10 May 2024 19:23:11 +0000 (14:23 -0500)]
sed: only re-read partition table after unlock.
The partition table was being re-read after both lock and
unlock operations. The re-read would fail with an error
message after a lock since the partition was no longer readable.
nvme-print-json: Fix LBA status DSLBA output as hexadecimal
The output printed with the 0x prefix but as not hexadecimal.
Same change for nvme-print-stdout below. 7b4b50ff ("nvme-print-stdout: Fix LBA status DSLBA output as hexadecimal")
Set the address after NVM set EGSETS - 1 identifier parameter.
Same change for nvme-print-stdout 10d24132
("nvme-print-stdout: Fix channel configuration descriptors pointer").
Martin Belanger [Fri, 10 May 2024 13:43:38 +0000 (09:43 -0400)]
build: Update meson commands in Makefile
Invoking meson by itself w/o "setup" is considered deprecated.
Updated Makefile to use "meson setup". Also replaced "ninja"
commands by the corresponding "meson compile" command.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Warner Losh [Sat, 4 May 2024 03:32:07 +0000 (21:32 -0600)]
solidigm: Eliminate <linux/limits.h>
ARG_MAX is defined in <limits.h>, per POSIX, but it's defined to be a
variable in glibc. Instead, get rid of it entirely by using asprintf to
construct the commands. This prevents us from trying a partially
constructed command that might do something unintentional. For
solidigm-market-log.c, there's no constants needed from
<linux/limits.h>. With this we can delete it both places.
Francis Pravin [Fri, 10 May 2024 09:46:36 +0000 (15:16 +0530)]
nvme: remove double free in persistent-event-log
The pevent_collected structure uses the buffer address which is allocated
using nvme_alloc_huge(). So, pevent_collected and mh.p has same address.
Hence, remove _cleanup_free_ from pevent_collected to prevent double free.
Signed-off-by: Francis Pravin <francis.p@samsung.com> Signed-off-by: Sathyavathi M <sathya.m@samsung.com>
Arthur Shau [Thu, 9 May 2024 18:41:16 +0000 (11:41 -0700)]
ocp: Add Get DSSD Power State Feature (FID: C7h)
Implements the Get DSSD Power State Feature (FID C7h). Also added an
optional flag that you can pass to the plugin command to print out
all three values at once.
Leonardo da Cunha [Mon, 29 Apr 2024 22:00:35 +0000 (15:00 -0700)]
plugins/solidigm: Automatic enabling Data Area 4 when retrieving Telemetry.
vs-internal-log, stopped extracting Host Initiated Telemetry previous
snapshot, simplified the type name of Telemetry snapshots to CIT and HIT,
removed command options for setting namespace, and file prefix, and added
command option to set output folder.
Signed-off-by: Leonardo da Cunha <leonardo.da.cunha@solidigm.com>
Sebastian Brzezinka [Mon, 12 Sep 2022 13:02:53 +0000 (15:02 +0200)]
plugins/spdk: plugin to list SPDK subsystems
Since `nvme-cli` start using `sysfs` to gather information about
subsystems, SPDK devices that are represented using CUSE can
no longer be listed.
Support for the JSON format is disabled cause `nvme_ctrl_get_state` use
sysfs to get value, causing segmentation fault when it's missing.
It could be solved by providing an empty string instead of a NULL pointer.
This patch adds SPDK devices to the nvme_root topology tree,
$ nvme spdk list-subsys
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com> Signed-off-by: Daniel Wagner <dwagner@suse.de>
Sebastian Brzezinka [Fri, 26 May 2023 09:23:37 +0000 (11:23 +0200)]
nvme-print: check if controller belong to SPDK
Check if controller belongs to SPDK cuse devices and compare paths
to make it possible to distinguish SPDK devices and not rely on
order and existence of a file.
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com> Signed-off-by: Daniel Wagner <dwagner@suse.de>
Tomasz Zawadzki [Wed, 23 Mar 2022 12:41:40 +0000 (13:41 +0100)]
plugins/spdk: plugin to list SPDK controllers
Since libnvme and nvme-cli(2.0) are continuing as separate projects,
and libnvme use sysfs exclusively to gather information about NVMe
devices, legacy paths that allow specifying a custom directory ('-d`)
is no longer available.
SPDK, as a userspace driver, does not create a sysfs entry but makes it
possible to expose such devices via NVMe-cuse and since it behaves as
character device, most commands should be intact, except
listing devices and subsystems.
This patch adds SPDK devices to the nvme_root topology tree, which
allows for keeping functionality where both SPDK and kernel devices
are printed.
$ nvme spdk list
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com> Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme_cli_get_log_ana_groups() is not called anywhere.
In preparation for a libnvme change that changes the signature
of nvme_get_log_ana_groups(), just remove the function.
Warner Losh [Mon, 29 Apr 2024 17:43:53 +0000 (11:43 -0600)]
sed_opal: Only build when we really have sed_opal headers
There's already code to not build the sed opal plugin when the necessary
headers aren't present. However, it doesn't work, since HAVE_SED_OPAL is
always defined to be either 0 or 1, so the meson has() return true, even
when the value is 0, causing the sed-opal plugin to build, even when the
header files it needs are missing.
Daniel Wagner [Tue, 4 Apr 2023 12:06:03 +0000 (14:06 +0200)]
nvmf-connect: systemd hardening effort
Apply the recommended hardening settings as recommended by openSUSE
and Fedor project. A few of the hardening option have to turned of
because nvme-cli needs write access to sysfs and /dev/nvme devices.
Links: https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
Links: https://fedoraproject.org/wiki/Changes/SystemdSecurityHardening Signed-off-by: Daniel Wagner <dwagner@suse.de>
Martin George [Tue, 16 Apr 2024 07:38:11 +0000 (13:08 +0530)]
nvme: fix mem leak in multiple key related functions
Valgrind revealed mem leaks in multiple key related functions
including gen_tls_key() and check_tls_key() during insert, and
gen_dhchap_key(). This was traced to the respective cfg pointer
not getting freed after fetching the hostnqn string from the
hostnqn file. Fix the same.
Martin George [Mon, 15 Apr 2024 07:14:32 +0000 (12:44 +0530)]
fabrics: fix mem leak in nvmf_check_hostid_and_hostnqn()
Valgrind revealed a mem leak in nvmf_check_hostid_and_hostnqn()
during nvme discover & connect. Leak traced to both hostid
pointers not getting freed for cases where the hostid value
matches the strings from both these respective hostid pointers.
Fix the same.
Brandon Paupore [Tue, 26 Mar 2024 15:27:07 +0000 (10:27 -0500)]
ocp: Unify line start spacing as tabs
Most of the ocp-nvme.c file already uses tabs in this way, but some
functions are using spaces instead. Unify this to follow the checkpatch
preference for code indents using tabs where possible.
Tomas Bzatek [Mon, 25 Mar 2024 15:35:31 +0000 (16:35 +0100)]
nbft: Refactor connection attempt out
With planned NBFT discovery work, a common connection
function would be handy. Besides, the DHCP fallback mostly
duplicated the connection code anyway, let's refactor that.
Martin George [Sat, 6 Apr 2024 12:47:25 +0000 (18:17 +0530)]
nvme: check-tls-key fails despite having hostnqn file
Nvme check-tls-key requires both hostnqn and subsysnqn to be
specified along with the keydata. Ideally, it should be able to
fetch the hostnqn string from the hostnqn file if no hostnqn
option is passed, irrespective of whether the insert option is
specified or not. Also passing the subsysnqn option is required
not just for identity v1, but for v0 as well, irrespective of
the insert option. Fix accordingly.
fabrics : allow host to create duplicate connections to target
Apparently the nvmf connect code doesn't allow creating
duplicate connections from a host to the same target even
though user specifies option "--duplicate-connect" or "-D".
This patch help fix this issue.
Fixes: 07d6b911e081 ("fabrics: Do not attempt to reconnect to already connected ctrls") Reported-by: Amit Engel <Amit.Engel@Dell.com> Signed-off-by: Nilay Shroff <nilay@linux.ibm.com> Link: https://lore.kernel.org/r/20240403133438.161916-1-nilay@linux.ibm.com Signed-off-by: Daniel Wagner <dwagner@suse.de>