Skip to content

Commit

Permalink
net/smc: return active RoCE port only
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ursula Braun authored and davem330 committed Apr 12, 2017
1 parent 249633a commit 5da7e4d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/smc/smc_pnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 5da7e4d

Please sign in to comment.