Skip to content

Commit e62cfdd

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

3 files changed

Lines changed: 19 additions & 6 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_rxe=${use_rxe:-""}
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
@@ -439,6 +440,18 @@ stop_soft_rdma() {
439440
} >>"$FULL"
440441
}
441442

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

582595
setup_rdma() {
583-
start_soft_rdma
596+
start_rdma
584597
(
585598
echo "RDMA interfaces:"
586599
cd /sys/class/infiniband &&
@@ -599,7 +612,7 @@ teardown_uncond() {
599612
killall -9 multipathd >&/dev/null
600613
rm -f /etc/multipath.conf
601614
stop_target
602-
stop_soft_rdma
615+
stop_rdma
603616
_exit_null_blk
604617
}
605618

tests/nvme/rc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ _nvme_requires() {
4646
_have_program rdma
4747
if [ -n "$use_rxe" ]; then
4848
_have_driver rdma_rxe
49-
else
49+
elif [ -z "$use_hw_rdma" ]; then
5050
_have_driver siw
5151
fi
5252
;;
@@ -372,7 +372,7 @@ _cleanup_nvmet() {
372372
fi
373373
modprobe -rq nvmet 2>/dev/null
374374
if [[ "${nvme_trtype}" == "rdma" ]]; then
375-
stop_soft_rdma
375+
stop_rdma
376376
fi
377377

378378
_cleanup_blkdev
@@ -386,7 +386,7 @@ _setup_nvmet() {
386386
fi
387387
modprobe -q nvme-"${nvme_trtype}"
388388
if [[ "${nvme_trtype}" == "rdma" ]]; then
389-
start_soft_rdma
389+
start_rdma
390390
for i in $(rdma_network_interfaces)
391391
do
392392
if [[ "${nvme_adrfam}" == "ipv6" ]]; then

tests/srp/rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ group_requires() {
5353
_have_module rdma_cm
5454
if [ -n "$use_rxe" ]; then
5555
_have_module rdma_rxe
56-
else
56+
elif [ -z "$use_hw_rdma" ]; then
5757
_have_module siw
5858
_have_kver 5 5
5959
_have_iproute2 190404

0 commit comments

Comments
 (0)