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>
This commit is contained in:
parent
249633a443
commit
5da7e4d355
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue