Skip to content

Commit

Permalink
test/nvmf: change reporting strategy for NICs.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446966
Tested-by: SPDK CI Jenkins <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
Reviewed-by: Ben Walker <[email protected]>
  • Loading branch information
Seth5141 authored and Changpeng Liu committed Mar 7, 2019
1 parent 5dff037 commit 9f03bee
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/nvmf/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54,6 +56,7 @@ function detect_mlx_5_nics()
return 0
fi

have_pci_nics=1
modprobe $mlx_core_driver
modprobe $mlx_ib_driver
}
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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
}
Expand Down

0 comments on commit 9f03bee

Please sign in to comment.