2017-01-09 14:24:37 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
2018-02-27 22:14:08 +00:00
|
|
|
source $rootdir/test/common/autotest_common.sh
|
2017-01-09 14:24:37 +00:00
|
|
|
source $rootdir/test/nvmf/common.sh
|
|
|
|
|
|
|
|
MALLOC_BDEV_SIZE=128
|
|
|
|
MALLOC_BLOCK_SIZE=512
|
2017-12-19 14:01:11 +00:00
|
|
|
NVMF_SUBSYS=11
|
2017-01-09 14:24:37 +00:00
|
|
|
|
|
|
|
rpc_py="python $rootdir/scripts/rpc.py"
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-07-25 15:39:51 +00:00
|
|
|
RDMA_IP_LIST=$(get_available_rdma_ips)
|
|
|
|
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
|
|
|
|
if [ -z $NVMF_FIRST_TARGET_IP ]; then
|
2017-01-09 14:24:37 +00:00
|
|
|
echo "no NIC for nvmf test"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-12-19 14:01:11 +00:00
|
|
|
# SoftRoce does not have enough queues available for
|
|
|
|
# multiconnection tests. Detect if we're using software RDMA.
|
|
|
|
# If so - lower the number of subsystems for test.
|
|
|
|
if check_ip_is_soft_roce $NVMF_FIRST_TARGET_IP; then
|
|
|
|
echo "Using software RDMA, lowering number of NVMeOF subsystems."
|
|
|
|
NVMF_SUBSYS=1
|
|
|
|
fi
|
|
|
|
|
2017-01-09 14:24:37 +00:00
|
|
|
timing_enter multiconnection
|
2017-05-27 00:13:55 +00:00
|
|
|
timing_enter start_nvmf_tgt
|
2017-01-09 14:24:37 +00:00
|
|
|
# Start up the NVMf target in another process
|
2017-05-27 00:13:55 +00:00
|
|
|
$NVMF_APP -c $testdir/../nvmf.conf &
|
2017-01-09 14:24:37 +00:00
|
|
|
pid=$!
|
|
|
|
|
|
|
|
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
|
|
|
|
2017-11-09 23:33:29 +00:00
|
|
|
waitforlisten $pid
|
2017-05-27 00:13:55 +00:00
|
|
|
timing_exit start_nvmf_tgt
|
2017-01-09 14:24:37 +00:00
|
|
|
|
|
|
|
modprobe -v nvme-rdma
|
|
|
|
|
2017-12-19 14:01:11 +00:00
|
|
|
for i in `seq 1 $NVMF_SUBSYS`
|
2017-01-09 14:24:37 +00:00
|
|
|
do
|
|
|
|
bdevs="$($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
|
2017-08-30 20:21:12 +00:00
|
|
|
$rpc_py construct_nvmf_subsystem nqn.2016-06.io.spdk:cnode${i} "trtype:RDMA traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" '' -a -s SPDK${i} -n "$bdevs"
|
2017-01-09 14:24:37 +00:00
|
|
|
done
|
|
|
|
|
2017-12-19 14:01:11 +00:00
|
|
|
for i in `seq 1 $NVMF_SUBSYS`; do
|
2018-04-16 20:28:16 +00:00
|
|
|
k=$[$i-1]
|
2017-01-09 14:24:37 +00:00
|
|
|
nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"
|
2018-04-16 20:28:16 +00:00
|
|
|
|
2018-05-31 07:19:15 +00:00
|
|
|
waitforblk "nvme${k}n1"
|
2017-01-09 14:24:37 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
$testdir/../fio/nvmf_fio.py 262144 64 read 10
|
|
|
|
$testdir/../fio/nvmf_fio.py 262144 64 randwrite 10
|
|
|
|
|
|
|
|
sync
|
2017-12-19 14:01:11 +00:00
|
|
|
for i in `seq 1 $NVMF_SUBSYS`; do
|
2017-03-03 23:53:59 +00:00
|
|
|
nvme disconnect -n "nqn.2016-06.io.spdk:cnode${i}" || true
|
2017-01-09 14:24:37 +00:00
|
|
|
$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode${i}
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -f ./local-job0-0-verify.state
|
|
|
|
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
nvmfcleanup
|
|
|
|
killprocess $pid
|
|
|
|
timing_exit multiconnection
|