Commit 80c91e4e authored by Seth Howell's avatar Seth Howell Committed by Daniel Verkamp
Browse files

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: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/370992


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent e8b1c452
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -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