Skip to content

Commit fc51b21

Browse files
committed
rdma: Add support for running the rdma tests over hardware
Signed-off-by: Kamal Heib <[email protected]>
1 parent f51ee53 commit fc51b21

4 files changed

Lines changed: 28 additions & 7 deletions

File tree

common/multipath-over-rdma

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ fio_aux_path=/tmp/fio-state-files
1313
memtotal=$(sed -n 's/^MemTotal:[[:blank:]]*\([0-9]*\)[[:blank:]]*kB$/\1/p' /proc/meminfo)
1414
max_ramdisk_size=$((1<<25))
1515
use_siw=${use_siw:-""}
16+
use_hw_rdma=${use_hw_rdma:-""}
1617
ramdisk_size=$((memtotal*(1024/16))) # in bytes
1718
if [ $ramdisk_size -gt $max_ramdisk_size ]; then
1819
ramdisk_size=$max_ramdisk_size
@@ -438,6 +439,18 @@ stop_soft_rdma() {
438439
} >>"$FULL"
439440
}
440441

442+
start_rdma() {
443+
if [ -z "$use_hw_rdma" ]; then
444+
start_soft_rdma
445+
fi
446+
}
447+
448+
stop_rdma() {
449+
if [ -z "$use_hw_rdma" ]; then
450+
stop_soft_rdma
451+
fi
452+
}
453+
441454
# Look up the block device below the filesystem for directory $1.
442455
block_dev_of_dir() {
443456
df "$1" | {
@@ -579,7 +592,7 @@ configure_null_blk() {
579592
}
580593

581594
setup_rdma() {
582-
start_soft_rdma
595+
start_rdma
583596
(
584597
echo "RDMA interfaces:"
585598
cd /sys/class/infiniband &&
@@ -598,7 +611,7 @@ teardown_uncond() {
598611
killall -9 multipathd >&/dev/null
599612
rm -f /etc/multipath.conf
600613
stop_target
601-
stop_soft_rdma
614+
stop_rdma
602615
_exit_null_blk
603616
}
604617

tests/nvme/rc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ _nvme_requires() {
3030
_have_modules nvmet nvme-core nvme-rdma nvmet-rdma
3131
_have_configfs
3232
_have_program rdma
33-
_have_modules rdma_rxe || _have_modules siw
33+
if [ -z "$use_hw_rdma" ]; then
34+
_have_modules rdma_rxe || _have_modules siw
35+
fi
3436
;;
3537
*)
3638
SKIP_REASON="unsupported nvme_trtype=${nvme_trtype}"
@@ -131,7 +133,7 @@ _cleanup_nvmet() {
131133
fi
132134
modprobe -r nvmet 2>/dev/null
133135
if [[ "${nvme_trtype}" == "rdma" ]]; then
134-
stop_soft_rdma
136+
stop_rdma
135137
fi
136138
}
137139

@@ -143,7 +145,7 @@ _setup_nvmet() {
143145
fi
144146
modprobe nvme-"${nvme_trtype}"
145147
if [[ "${nvme_trtype}" == "rdma" ]]; then
146-
start_soft_rdma
148+
start_rdma
147149
for i in $(rdma_network_interfaces)
148150
do
149151
ipv4_addr=$(get_ipv4_addr "$i")

tests/nvmeof-mp/rc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ and multipathing has been enabled in the nvme_core kernel module"
3535
ib_umad
3636
nvme-rdma
3737
nvmet-rdma
38-
rdma_rxe
3938
scsi_dh_alua
4039
scsi_dh_emc
4140
scsi_dh_rdac
4241
)
4342
_have_modules "${required_modules[@]}" || return
4443

44+
if [ -z "$use_hw_rdma" ]; then
45+
_have_modules rdma_rxe || _have_modules siw
46+
fi
47+
4548
for p in mkfs.ext4 mkfs.xfs multipath multipathd pidof rdma fio; do
4649
_have_program "$p" || return
4750
done

tests/srp/rc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ group_requires() {
4646
ib_uverbs
4747
null_blk
4848
rdma_cm
49-
rdma_rxe
5049
scsi_debug
5150
scsi_dh_alua
5251
scsi_dh_emc
@@ -59,6 +58,10 @@ group_requires() {
5958
)
6059
_have_modules "${required_modules[@]}" || return
6160

61+
if [ -z "$use_hw_rdma" ]; then
62+
_have_modules rdma_rxe || _have_modules siw
63+
fi
64+
6265
for p in mkfs.ext4 mkfs.xfs multipath multipathd pidof rdma \
6366
sg_reset fio; do
6467
_have_program "$p" || return

0 commit comments

Comments
 (0)