Skip to content

Commit

Permalink
rdma: Add support for running the rdma tests over hardware
Browse files Browse the repository at this point in the history
Signed-off-by: Kamal Heib <[email protected]>
  • Loading branch information
Kamalheib committed Oct 12, 2023
1 parent b6a7ca0 commit e62cfdd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
17 changes: 15 additions & 2 deletions common/multipath-over-rdma
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fio_aux_path=/tmp/fio-state-files
memtotal=$(sed -n 's/^MemTotal:[[:blank:]]*\([0-9]*\)[[:blank:]]*kB$/\1/p' /proc/meminfo)
max_ramdisk_size=$((1<<25))
use_rxe=${use_rxe:-""}
use_hw_rdma=${use_hw_rdma:-""}
ramdisk_size=$((memtotal*(1024/16))) # in bytes
if [ $ramdisk_size -gt $max_ramdisk_size ]; then
ramdisk_size=$max_ramdisk_size
Expand Down Expand Up @@ -439,6 +440,18 @@ stop_soft_rdma() {
} >>"$FULL"
}

start_rdma() {
if [ -z "$use_hw_rdma" ]; then
start_soft_rdma
fi
}

stop_rdma() {
if [ -z "$use_hw_rdma" ]; then
stop_soft_rdma
fi
}

# Look up the block device below the filesystem for directory $1.
block_dev_of_dir() {
df "$1" | {
Expand Down Expand Up @@ -580,7 +593,7 @@ configure_null_blk() {
}

setup_rdma() {
start_soft_rdma
start_rdma
(
echo "RDMA interfaces:"
cd /sys/class/infiniband &&
Expand All @@ -599,7 +612,7 @@ teardown_uncond() {
killall -9 multipathd >&/dev/null
rm -f /etc/multipath.conf
stop_target
stop_soft_rdma
stop_rdma
_exit_null_blk
}

Expand Down
6 changes: 3 additions & 3 deletions tests/nvme/rc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ _nvme_requires() {
_have_program rdma
if [ -n "$use_rxe" ]; then
_have_driver rdma_rxe
else
elif [ -z "$use_hw_rdma" ]; then
_have_driver siw
fi
;;
Expand Down Expand Up @@ -372,7 +372,7 @@ _cleanup_nvmet() {
fi
modprobe -rq nvmet 2>/dev/null
if [[ "${nvme_trtype}" == "rdma" ]]; then
stop_soft_rdma
stop_rdma
fi

_cleanup_blkdev
Expand All @@ -386,7 +386,7 @@ _setup_nvmet() {
fi
modprobe -q nvme-"${nvme_trtype}"
if [[ "${nvme_trtype}" == "rdma" ]]; then
start_soft_rdma
start_rdma
for i in $(rdma_network_interfaces)
do
if [[ "${nvme_adrfam}" == "ipv6" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion tests/srp/rc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ group_requires() {
_have_module rdma_cm
if [ -n "$use_rxe" ]; then
_have_module rdma_rxe
else
elif [ -z "$use_hw_rdma" ]; then
_have_module siw
_have_kver 5 5
_have_iproute2 190404
Expand Down

0 comments on commit e62cfdd

Please sign in to comment.