]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | #!/usr/bin/env bash |
2 | ||
3 | testdir=$(readlink -f $(dirname $0)) | |
4 | rootdir=$(readlink -f $testdir/../../..) | |
5 | source $rootdir/test/common/autotest_common.sh | |
6 | source $rootdir/test/nvmf/common.sh | |
7 | ||
8 | MALLOC_BDEV_SIZE=64 | |
9 | MALLOC_BLOCK_SIZE=512 | |
10 | ||
11 | rpc_py="$rootdir/scripts/rpc.py" | |
12 | ||
13 | set -e | |
14 | ||
15 | timing_enter srq_overwhelm | |
16 | nvmftestinit | |
17 | ||
18 | if 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 | |
21 | fi | |
22 | ||
23 | nvmfappstart "-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 | ||
28 | for 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" | |
35 | done | |
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 | ||
44 | sync | |
45 | ||
46 | for 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 | |
49 | done | |
50 | ||
51 | trap - SIGINT SIGTERM EXIT | |
52 | ||
53 | nvmfcleanup | |
54 | nvmftestfini | |
55 | timing_exit srq_overwhelm |