]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/test/nvmf/target/srq_overwhelm.sh
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / test / nvmf / target / srq_overwhelm.sh
CommitLineData
9f95a23c
TL
1#!/usr/bin/env bash
2
3testdir=$(readlink -f $(dirname $0))
4rootdir=$(readlink -f $testdir/../../..)
5source $rootdir/test/common/autotest_common.sh
6source $rootdir/test/nvmf/common.sh
7
8MALLOC_BDEV_SIZE=64
9MALLOC_BLOCK_SIZE=512
10
11rpc_py="$rootdir/scripts/rpc.py"
12
13set -e
14
15timing_enter srq_overwhelm
16nvmftestinit
17
18if check_ip_is_soft_roce $NVMF_FIRST_TARGET_IP; then
19 echo "Using software RDMA, Likely not enough memory to run this test. aborting."
20 exit 0
21fi
22
23nvmfappstart "-m 0xF"
24
25# create the rdma transport with an intentionally small SRQ depth
26$rpc_py nvmf_create_transport -t $TEST_TRANSPORT -u 8192 -s 1024
27
28for i in $(seq 0 5); do
29 $rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode$i -a -s SPDK00000000000001
30 $rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc$i
31 $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode$i Malloc$i
32 $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode$i -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
33 nvme connect -t $TEST_TRANSPORT -n "nqn.2016-06.io.spdk:cnode${i}" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" -i 16
34 waitforblk "nvme${i}n1"
35done
36
37# by running 6 different FIO jobs, each with 13 subjobs, we end up with 78 fio threads trying to write to
38# our target at once. This completely overwhelms the target SRQ, but allows us to verify that rnr_retry is
39# working even at very high queue depths because the rdma qpair doesn't fail.
40# It is normal to see the initiator timeout and reconnect waiting for completions from an overwhelmmed target,
41# but the connection should come up and FIO should complete without errors.
42$rootdir/scripts/fio.py -p nvmf -i 1048576 -d 128 -t read -r 10 -n 13
43
44sync
45
46for i in $(seq 0 5); do
47 nvme disconnect -n "nqn.2016-06.io.spdk:cnode${i}"
48 $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode$i
49done
50
51trap - SIGINT SIGTERM EXIT
52
53nvmfcleanup
54nvmftestfini
55timing_exit srq_overwhelm