From 1cf827c8a1f2084638d8da2cf97c8d9612dc4938 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 22 Feb 2019 14:53:14 -0800 Subject: [PATCH] tests/srp/rc: Avoid triggering "QP creation failed" error messages Instead of trying to log in to each target port from each initiator port, only log in to the target ports associated with the RDMA HCA from which the log in request is sent. This avoids that the SRP initiator driver logs the following error message when e.g. attempting to log in to interface lo from an Ethernet interface: "QP creation failed". Signed-off-by: Bart Van Assche --- tests/srp/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/srp/rc b/tests/srp/rc index bf906de..696d94e 100755 --- a/tests/srp/rc +++ b/tests/srp/rc @@ -132,7 +132,7 @@ do_ib_cm_login() { add_param=$4 gid=$(<"/sys/class/infiniband/$ibdev/ports/$port/gids/0") gid=${gid//:} - for p in /sys/class/infiniband_srp/*; do + for p in "/sys/class/infiniband_srp/srp-${2}-"*; do [ -e "$p" ] || continue srp_single_login "id_ext=$ioc_guid,ioc_guid=$ioc_guid,dgid=$gid,pkey=7fff,service_id=$ioc_guid,$add_param" "$p/add_target" done @@ -159,7 +159,7 @@ do_rdma_cm_login() { [ -n "$a" ] && dests+=("${a}:${srp_rdma_cm_port}") [ -n "$b" ] && dests+=("[${b}]:${srp_rdma_cm_port}") for dest in "${dests[@]}"; do - for p in /sys/class/infiniband_srp/*; do + for p in "/sys/class/infiniband_srp/srp-${2}-"*; do [ -e "$p" ] || continue srp_single_login "id_ext=$ioc_guid,ioc_guid=$ioc_guid,dest=$dest,$add_param" "$p/add_target" done -- 2.50.1