From 80c91e4e46340a7c958ce807612dc68664b70787 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Mon, 24 Jul 2017 10:04:32 -0700 Subject: [PATCH] test/nvmf: add logic to include soft-roce nics in NVMF tests This will allow us to virtualize all of our tests. Change-Id: Ic9697c1622e516d0021c8af37c0cd4c0f65d430a Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/370992 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp Reviewed-by: Ben Walker --- test/nvmf/common.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/nvmf/common.sh b/test/nvmf/common.sh index c39cf63c9c..15ba89d5a1 100755 --- a/test/nvmf/common.sh +++ b/test/nvmf/common.sh @@ -29,6 +29,17 @@ function load_ib_rdma_modules() modprobe rdma_ucm } + +function detect_soft_roce_nics() +{ + if hash rxe_cfg; then + interface="$(ifconfig | grep "RUNNING" -m 1 | awk '{print $1}' | sed s/://)" + rxe_cfg add $interface + rxe_cfg start + export SOFT_ROCE=true + fi +} + function detect_mellanox_nics() { if ! hash lspci; then @@ -69,12 +80,18 @@ function detect_mellanox_nics() function detect_rdma_nics() { - # could be add other nics, so wrap it detect_mellanox_nics + detect_soft_roce_nics } function allocate_nic_ips() { + # If a Soft-RoCE nic was allocated, it already has an ip address atached to it + # and we use it in preference to any other RDMA nics attached to the device. + if [ $SOFT_ROCE == true ]; then + return 0 + fi + let count=$NVMF_IP_LEAST_ADDR for nic_type in `ls /sys/class/infiniband`; do for nic_name in `ls /sys/class/infiniband/${nic_type}/device/net`; do