nvme-cli: update to version v2.8

Resolves: RHEL-30876

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
This commit is contained in:
Maurizio Lombardi 2024-04-03 11:10:02 +02:00
parent 6070524ad5
commit 6e8ec11a4a
8 changed files with 31 additions and 211 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@
/nvme-cli-2.2.1.tar.gz /nvme-cli-2.2.1.tar.gz
/nvme-cli-2.4.tar.gz /nvme-cli-2.4.tar.gz
/nvme-cli-2.6.tar.gz /nvme-cli-2.6.tar.gz
/nvme-cli-2.8.tar.gz

View File

@ -0,0 +1,20 @@
diff --git a/fabrics.c b/fabrics.c
index 1a53b232da23..0d80dfc5b044 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -636,6 +636,7 @@ char *nvmf_hostid_from_hostnqn(const char *hostnqn)
void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn, unsigned int verbose)
{
+#if 0
char *hostid_from_file, *hostid_from_hostnqn;
if (!hostid)
@@ -659,6 +660,7 @@ void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn, unsi
"warning: use hostid which does not match uuid in hostnqn\n");
free(hostid_from_hostnqn);
}
+#endif
}
int nvmf_discover(const char *desc, int argc, char **argv, bool connect)

View File

@ -1,29 +0,0 @@
From 0782167f3a6709df232b746cdfa2a036c6207f7f Mon Sep 17 00:00:00 2001
From: Martin George <marting@netapp.com>
Date: Tue, 3 Oct 2023 16:05:23 +0530
Subject: [PATCH] udev-rules: set ctrl_loss_tmo to -1 for ONTAP NVMe/TCP
Setting ctrl_loss_tmo to -1 for ONTAP NVMe/TCP controllers would enable
indefinite reconnect attempts during a path loss and help avoid purging
the path on the host, which otherwise may lead to mounted fs read-only
behavior. So add a rule towards enabling the same.
Signed-off-by: Martin George <marting@netapp.com>
---
nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in b/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in
index 299fe2251418..99b6a8ba0bf8 100644
--- a/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in
+++ b/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in
@@ -1,3 +1,6 @@
# Enable round-robin for NetApp ONTAP and NetApp E-Series
ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp ONTAP Controller", ATTR{iopolicy}="round-robin"
ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp E-Series", ATTR{iopolicy}="round-robin"
+
+# Set ctrl_loss_tmo to -1 for NetApp ONTAP NVMe/TCP
+ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", ATTR{transport}=="tcp", ATTR{model}=="NetApp ONTAP Controller", ATTR{ctrl_loss_tmo}="-1"
--
2.39.3

View File

@ -1,50 +0,0 @@
From 748a9ac050fb443b1204d06ce3b5b129b6a8afe2 Mon Sep 17 00:00:00 2001
From: Martin George <marting@netapp.com>
Date: Thu, 5 Oct 2023 12:12:46 +0530
Subject: [PATCH] udev-rules: rename netapp udev rule
Rename 71-nvmf-iopolicy-netapp.rules.in to 71-nvmf-netapp.rules.in
so as to make the name generic, since this not only sets the
iopolicy here but also modifies the ctrl_loss_tmo.
Signed-off-by: Martin George <marting@netapp.com>
---
meson.build | 2 +-
nvme.spec.in | 2 +-
...71-nvmf-iopolicy-netapp.rules.in => 71-nvmf-netapp.rules.in} | 0
3 files changed, 2 insertions(+), 2 deletions(-)
rename nvmf-autoconnect/udev-rules/{71-nvmf-iopolicy-netapp.rules.in => 71-nvmf-netapp.rules.in} (100%)
diff --git a/meson.build b/meson.build
index 3d3fb08541ff..310ba1f83400 100644
--- a/meson.build
+++ b/meson.build
@@ -236,7 +236,7 @@ endforeach
udev_files = [
'70-nvmf-autoconnect.rules',
- '71-nvmf-iopolicy-netapp.rules',
+ '71-nvmf-netapp.rules',
]
foreach file : udev_files
diff --git a/nvme.spec.in b/nvme.spec.in
index fe4675a7bb0b..3eab9ff030ff 100644
--- a/nvme.spec.in
+++ b/nvme.spec.in
@@ -31,7 +31,7 @@ touch %{buildroot}@SYSCONFDIR@/nvme/hostid
@SYSCONFDIR@/nvme/discovery.conf
%ghost @SYSCONFDIR@/nvme/config.json
@UDEVRULESDIR@/70-nvmf-autoconnect.rules
-@UDEVRULESDIR@/71-nvmf-iopolicy-netapp.rules
+@UDEVRULESDIR@/71-nvmf-netapp.rules
@DRACUTRILESDIR@/70-nvmf-autoconnect.conf
@SYSTEMDDIR@/nvmf-connect@.service
@SYSTEMDDIR@/nvmefc-boot-connections.service
diff --git a/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in b/nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in
similarity index 100%
rename from nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in
rename to nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in
--
2.39.3

View File

@ -1,92 +0,0 @@
From 5f872e9c1689078bf2c4e33108c1514da1a91497 Mon Sep 17 00:00:00 2001
From: Maurizio Lombardi <mlombard@redhat.com>
Date: Mon, 13 Nov 2023 10:49:35 +0100
Subject: [PATCH] Revert "fabrics: Use corresponding hostid when hostnqn is
generated"
This reverts commit 7d1c18f581e489e0cedfd9991bc97a2f8239cf82.
---
fabrics.c | 47 ++---------------------------------------------
1 file changed, 2 insertions(+), 45 deletions(-)
diff --git a/fabrics.c b/fabrics.c
index 57ca927fce9a..f4fb63f0c555 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -616,43 +616,6 @@ static int nvme_read_volatile_config(nvme_root_t r)
return ret;
}
-char *nvmf_hostid_from_hostnqn(const char *hostnqn)
-{
- const char *uuid;
-
- if (!hostnqn)
- return NULL;
-
- uuid = strstr(hostnqn, "uuid:");
- if (!uuid)
- return NULL;
-
- return strdup(uuid + strlen("uuid:"));
-}
-
-void nvmf_check_hostid_and_hostnqn(const char *hostid, const char *hostnqn)
-{
- char *hostid_from_file, *hostid_from_hostnqn;
-
- if (!hostid)
- return;
-
- hostid_from_file = nvmf_hostid_from_file();
- if (hostid_from_file && strcmp(hostid_from_file, hostid)) {
- fprintf(stderr, "warning: use generated hostid instead of hostid file\n");
- free(hostid_from_file);
- }
-
- if (!hostnqn)
- return;
-
- hostid_from_hostnqn = nvmf_hostid_from_hostnqn(hostnqn);
- if (hostid_from_hostnqn && strcmp(hostid_from_hostnqn, hostid)) {
- fprintf(stderr, "warning: use hostid which does not match uuid in hostnqn\n");
- free(hostid_from_hostnqn);
- }
-}
-
int nvmf_discover(const char *desc, int argc, char **argv, bool connect)
{
char *subsysnqn = NVME_DISC_SUBSYS_NAME;
@@ -729,13 +692,10 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect)
hostid_arg = hostid;
if (!hostnqn)
hostnqn = hnqn = nvmf_hostnqn_from_file();
- if (!hostnqn) {
+ if (!hostnqn)
hostnqn = hnqn = nvmf_hostnqn_generate();
- hostid = hid = nvmf_hostid_from_hostnqn(hostnqn);
- }
if (!hostid)
hostid = hid = nvmf_hostid_from_file();
- nvmf_check_hostid_and_hostnqn(hostid, hostnqn);
h = nvme_lookup_host(r, hostnqn, hostid);
if (!h) {
ret = ENOMEM;
@@ -946,13 +906,10 @@ int nvmf_connect(const char *desc, int argc, char **argv)
if (!hostnqn)
hostnqn = hnqn = nvmf_hostnqn_from_file();
- if (!hostnqn) {
+ if (!hostnqn)
hostnqn = hnqn = nvmf_hostnqn_generate();
- hostid = hid = nvmf_hostid_from_hostnqn(hostnqn);
- }
if (!hostid)
hostid = hid = nvmf_hostid_from_file();
- nvmf_check_hostid_and_hostnqn(hostid, hostnqn);
h = nvme_lookup_host(r, hostnqn, hostid);
if (!h) {
errno = ENOMEM;
--
2.39.3

View File

@ -1,29 +0,0 @@
From 2f30d87d5c258fd97f78b0705bb92519d8a2498d Mon Sep 17 00:00:00 2001
From: "da Cunha, Leonardo" <leonardo.da.cunha@solidigm.com>
Date: Wed, 11 Oct 2023 09:01:44 -0700
Subject: [PATCH] nvme: Fixed segmentation fault when getting host initiated
telemetry
Signed-off-by: leonardo.da.cunha <leonardo.da.cunha@solidigm.com>
---
nvme.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/nvme.c b/nvme.c
index b9e56a48f0a5..73d74afdfd73 100644
--- a/nvme.c
+++ b/nvme.c
@@ -851,6 +851,10 @@ static int __get_telemetry_log_host(struct nvme_dev *dev,
_cleanup_free_ struct nvme_telemetry_log *log = NULL;
int err;
+ log = nvme_alloc(sizeof(*log));
+ if (!log)
+ return -errno;
+
err = nvme_cli_get_log_telemetry_host(dev, 0,
NVME_LOG_TELEM_BLOCK_SIZE,
log);
--
2.39.3

View File

@ -2,18 +2,15 @@
#%%global shortcommit0 %%(c=%%{commit0}; echo ${c:0:7}) #%%global shortcommit0 %%(c=%%{commit0}; echo ${c:0:7})
Name: nvme-cli Name: nvme-cli
Version: 2.6 Version: 2.8
Release: 5%{?dist} Release: 1%{?dist}
Summary: NVMe management command line interface Summary: NVMe management command line interface
License: GPL-2.0-only License: GPL-2.0-only
URL: https://github.com/linux-nvme/nvme-cli URL: https://github.com/linux-nvme/nvme-cli
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: 0001-udev-rules-set-ctrl_loss_tmo-to-1-for-ONTAP-NVMe-TCP.patch Patch0: 0001-Revert-fabrics-Use-corresponding-hostid-when-hostnqn.patch
Patch1: 0002-udev-rules-rename-netapp-udev-rule.patch
Patch2: 0003-Revert-fabrics-Use-corresponding-hostid-when-hostnqn.patch
Patch3: 0004-nvme-Fixed-segmentation-fault-when-getting-host-init.patch
BuildRequires: meson >= 0.50.0 BuildRequires: meson >= 0.50.0
BuildRequires: gcc gcc-c++ BuildRequires: gcc gcc-c++
@ -21,7 +18,7 @@ BuildRequires: libuuid-devel
BuildRequires: systemd-devel BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros BuildRequires: systemd-rpm-macros
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: libnvme-devel >= 1.6-1 BuildRequires: libnvme-devel >= 1.8-1
BuildRequires: json-c-devel >= 0.14 BuildRequires: json-c-devel >= 0.14
BuildRequires: asciidoc BuildRequires: asciidoc
BuildRequires: xmlto BuildRequires: xmlto
@ -36,9 +33,6 @@ nvme-cli provides NVM-Express user space tooling for Linux.
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build %build
%meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} %meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir}
@ -67,8 +61,10 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme
%config(noreplace) %{_sysconfdir}/nvme/discovery.conf %config(noreplace) %{_sysconfdir}/nvme/discovery.conf
%{_unitdir}/nvmefc-boot-connections.service %{_unitdir}/nvmefc-boot-connections.service
%{_unitdir}/nvmf-autoconnect.service %{_unitdir}/nvmf-autoconnect.service
%{_unitdir}/nvmf-connect-nbft.service
%{_unitdir}/nvmf-connect.target %{_unitdir}/nvmf-connect.target
%{_unitdir}/nvmf-connect@.service %{_unitdir}/nvmf-connect@.service
%{_udevrulesdir}/65-persistent-net-nbft.rules
%{_udevrulesdir}/70-nvmf-autoconnect.rules %{_udevrulesdir}/70-nvmf-autoconnect.rules
%{_udevrulesdir}/71-nvmf-netapp.rules %{_udevrulesdir}/71-nvmf-netapp.rules
# Do not install the dracut rule yet. See rhbz 1742764 # Do not install the dracut rule yet. See rhbz 1742764
@ -94,6 +90,9 @@ if [ $1 -eq 1 ] || [ $1 -eq 2 ]; then
fi fi
%changelog %changelog
* Wed Apr 03 2024 Maurizio Lombardi <mlombard@redhat.com> - 2.8-1
- Update to version 2.8
* Thu Feb 22 2024 Maurizio Lombardi <mlombard@redhat.com> - 2.6-5 * Thu Feb 22 2024 Maurizio Lombardi <mlombard@redhat.com> - 2.6-5
- Fix for RHEL-13107 - Fix for RHEL-13107

View File

@ -1 +1 @@
SHA512 (nvme-cli-2.6.tar.gz) = da4daef2d7c554455e0c195c03f92188e0e946409a3bd8a5b421d9a106746e82fb1309901d2893639b1a3447bda094c80a9f49f59bf43cf2b00402f82beea3fc SHA512 (nvme-cli-2.8.tar.gz) = 1be0bed4e1bf8a25229f301c2b00b78d2de4eaf8ff2b815fa75e44dd35ddd7787604152bdf00696130df3281206a734c5f408c3f2127440e05c2e4b1cdbb79d4