summaryrefslogtreecommitdiff
path: root/net/smc/smc_pnet.c
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.vnet.ibm.com>2017-04-10 15:57:58 +0300
committerDavid S. Miller <davem@davemloft.net>2017-04-12 06:01:14 +0300
commit5da7e4d35507992da2af6c89434c33a69802de9c (patch)
tree97a8922e4c97321630d8a0b2af0f5984da7ec49e /net/smc/smc_pnet.c
parent249633a443fd12485d6f352d6cbe41efc92db233 (diff)
downloadlinux-5da7e4d35507992da2af6c89434c33a69802de9c.tar.xz
net/smc: return active RoCE port only
SMC requires an active ib port on the RoCE device. smc_pnet_find_roce_resource() determines the matching RoCE device port according to the configured PNET table. Do not return the found RoCE device port, if it is not flagged active. Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_pnet.c')
-rw-r--r--net/smc/smc_pnet.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c
index f1cff0159980..78f7af28ae4f 100644
--- a/net/smc/smc_pnet.c
+++ b/net/smc/smc_pnet.c
@@ -523,8 +523,11 @@ void smc_pnet_find_roce_resource(struct sock *sk,
read_lock(&smc_pnettable.lock);
list_for_each_entry(pnetelem, &smc_pnettable.pnetlist, list) {
if (dst->dev == pnetelem->ndev) {
- *smcibdev = pnetelem->smcibdev;
- *ibport = pnetelem->ib_port;
+ if (smc_ib_port_active(pnetelem->smcibdev,
+ pnetelem->ib_port)) {
+ *smcibdev = pnetelem->smcibdev;
+ *ibport = pnetelem->ib_port;
+ }
break;
}
}