aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed
diff options
context:
space:
mode:
authorSlava Shwartsman <slavash@FreeBSD.org>2018-12-05 13:19:21 +0000
committerSlava Shwartsman <slavash@FreeBSD.org>2018-12-05 13:19:21 +0000
commit475c8de7bf2dc86d9806709a04e9c8f524d4ec32 (patch)
tree61cfbb65daa3d8f1f80164fc1270ee1666f4d365 /sys/ofed
parent4b9b52a1bd135c17149fb598b246dec1955fa250 (diff)
Notes
Diffstat (limited to 'sys/ofed')
-rw-r--r--sys/ofed/drivers/infiniband/core/ib_cma.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/ofed/drivers/infiniband/core/ib_cma.c b/sys/ofed/drivers/infiniband/core/ib_cma.c
index 0e20a04b3464..4a45efc5852e 100644
--- a/sys/ofed/drivers/infiniband/core/ib_cma.c
+++ b/sys/ofed/drivers/infiniband/core/ib_cma.c
@@ -621,16 +621,19 @@ static int cma_acquire_dev(struct rdma_id_private *id_priv,
if (listen_id_priv) {
cma_dev = listen_id_priv->cma_dev;
port = listen_id_priv->id.port_num;
- gidp = rdma_protocol_roce(cma_dev->device, port) ?
- &iboe_gid : &gid;
- ret = cma_validate_port(cma_dev->device, port,
- rdma_protocol_ib(cma_dev->device, port) ?
- IB_GID_TYPE_IB :
- listen_id_priv->gid_type, gidp, dev_addr);
- if (!ret) {
- id_priv->id.port_num = port;
- goto out;
+ if (rdma_is_port_valid(cma_dev->device, port)) {
+ gidp = rdma_protocol_roce(cma_dev->device, port) ?
+ &iboe_gid : &gid;
+
+ ret = cma_validate_port(cma_dev->device, port,
+ rdma_protocol_ib(cma_dev->device, port) ?
+ IB_GID_TYPE_IB :
+ listen_id_priv->gid_type, gidp, dev_addr);
+ if (!ret) {
+ id_priv->id.port_num = port;
+ goto out;
+ }
}
}