From 65e354015ed7eed72681b9f5bd88aec572fea063 Mon Sep 17 00:00:00 2001 From: baiguo Date: Thu, 25 Jul 2024 15:02:23 +0800 Subject: [PATCH] test/nvmf: Check if selected net devices are in proper state --- ...if-selected-net-devices-are-in-prope.patch | 55 +++++++++++++++++++ spdk.spec | 6 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0003-backport-test-nvmf-Check-if-selected-net-devices-are-in-prope.patch diff --git a/0003-backport-test-nvmf-Check-if-selected-net-devices-are-in-prope.patch b/0003-backport-test-nvmf-Check-if-selected-net-devices-are-in-prope.patch new file mode 100644 index 0000000..e4dfee3 --- /dev/null +++ b/0003-backport-test-nvmf-Check-if-selected-net-devices-are-in-prope.patch @@ -0,0 +1,55 @@ +From f9239101f3778f08ffa9b4942879253fde58e28e Mon Sep 17 00:00:00 2001 +From: Michal Berger +Date: 2024-05-10 11:28:23 +0000 +Subject: [PATCH] test/nvmf: Check if selected net devices are in proper state + +test/nvmf: Check if selected net devices are in proper state + +Even if we detect all the interfaces attached to a proper NIC, we +still need to verify if they are operational. If not, we are better +with removing them and potentially falling through to phy-fallback +instead of failing the entire test.i + +Change-Id: I09c4467038aff86a0877c198116ca823ffdbe228 +Signed-off-by: Michal Berger +Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23000 +Tested-by: SPDK CI Jenkins +Reviewed-by: Jim Harris +Reviewed-by: Tomasz Zawadzki + +--- + test/nvmf/common.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/test/nvmf/common.sh b/test/nvmf/common.sh +index 2888fb0..e425757 100644 +--- a/test/nvmf/common.sh ++++ b/test/nvmf/common.sh +@@ -285,7 +285,7 @@ function gather_supported_nvmf_pci_devs() { + cache_pci_bus_sysfs + xtrace_restore + +- local intel=0x8086 mellanox=0x15b3 pci ++ local intel=0x8086 mellanox=0x15b3 pci net_dev + + local -a pci_devs=() + local -a pci_net_devs=() +@@ -380,6 +380,15 @@ function gather_supported_nvmf_pci_devs() { + # are any net devices bound to the controllers. + for pci in "${pci_devs[@]}"; do + pci_net_devs=("/sys/bus/pci/devices/$pci/net/"*) ++ # Check if available devices are in proper operational state. If not, remove them from the main list. ++ # This check is valid for TCP only since for RDMA we use infiniband which don't rely on actual UP ++ # state of the device. ++ if [[ $TEST_TRANSPORT == tcp ]]; then ++ for net_dev in "${!pci_net_devs[@]}"; do ++ [[ $(< "${pci_net_devs[net_dev]}/operstate") == up ]] || unset -v "pci_net_devs[net_dev]" ++ done ++ fi ++ + if ((${#pci_net_devs[@]} == 0)); then + echo "No net devices associated with $pci" + continue +-- +2.33.0 + diff --git a/spdk.spec b/spdk.spec index bd9bed0..31a8a08 100644 --- a/spdk.spec +++ b/spdk.spec @@ -4,13 +4,14 @@ Name: spdk Version: 24.01 -Release: 6 +Release: 7 Summary: Set of libraries and utilities for high performance user-mode storage License: BSD and MIT URL: http://spdk.io Source0: https://github.com/spdk/spdk/archive/refs/tags/v%{version}.tar.gz Patch1: 0001-Add-without-ISA-L-option-and-disabled-by-default.patch Patch2: 0002-backport-Add-ctrlr_lock-for-cuse-register-and-unregister.patch +Patch3: 0003-backport-test-nvmf-Check-if-selected-net-devices-are-in-prope.patch %define package_version %{version}-%{release} @@ -177,6 +178,9 @@ mv doc/output/html/ %{install_docdir} %changelog +* Thu Jul 25 2024 baiguo - 24.01-7 +- test/nvmf: Check if selected net devices are in proper state + * Thu Jun 6 2024 baiguo - 24.01-6 - Add ctrlr_lock for cuse register and unregister -- Gitee