From 9f03beea38f305ce858256824f8088f32756287b Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Mon, 4 Mar 2019 09:24:39 -0700 Subject: [PATCH] test/nvmf: change reporting strategy for NICs. This makes it so we only have to check one variable when determining if we want to load Soft-RoCE NICs. Change-Id: I5ba615e26252041023ec8615a00c1777bee6cb12 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446966 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- test/nvmf/common.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/nvmf/common.sh b/test/nvmf/common.sh index ab41ebb2b2f..ea891e71ba2 100755 --- a/test/nvmf/common.sh +++ b/test/nvmf/common.sh @@ -8,6 +8,8 @@ NVMF_TCP_IP_ADDRESS="127.0.0.1" : ${NVMF_APP_SHM_ID="0"}; export NVMF_APP_SHM_ID : ${NVMF_APP="./app/nvmf_tgt/nvmf_tgt -i $NVMF_APP_SHM_ID -e 0xFFFF"}; export NVMF_APP +have_pci_nics=0 + function load_ib_rdma_modules() { if [ `uname` != Linux ]; then @@ -54,6 +56,7 @@ function detect_mlx_5_nics() return 0 fi + have_pci_nics=1 modprobe $mlx_core_driver modprobe $mlx_ib_driver } @@ -66,10 +69,10 @@ function detect_mlx_4_nics() mlx_en_driver="mlx4_en" if [ -z "$nvmf_nic_bdfs" ]; then - echo "No NICs" return 0 fi + have_pci_nics=1 modprobe $mlx_core_driver modprobe $mlx_ib_driver modprobe $mlx_en_driver @@ -79,15 +82,13 @@ function detect_pci_nics() { if ! hash lspci; then - echo "No NICs" return 0 fi - mlx_4_nics=$(detect_mlx_4_nics) - mlx_5_nics=$(detect_mlx_5_nics) + detect_mlx_4_nics + detect_mlx_5_nics - if [ "$mlx_4_nics" == "No NICs" -a "$mlx_5_nics" == "No NICs" ]; then - echo "No NICs" + if [ "$have_pci_nics" -eq "0" ]; then return 0 fi @@ -97,8 +98,8 @@ function detect_pci_nics() function detect_rdma_nics() { - nics=$(detect_pci_nics) - if [ "$nics" == "No NICs" ]; then + detect_pci_nics + if [ "$have_pci_nics" -eq "0" ]; then detect_soft_roce_nics fi }