aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/cma.c
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2018-07-16 04:50:12 -0400
committerJason Gunthorpe <jgg@mellanox.com>2018-07-26 11:47:47 -0400
commitd274e45ce1ed0bc5750f4d3f066bfc164843216b (patch)
treedd2be54e2fe5b568f550a94d23fe888387cc2ca0 /drivers/infiniband/core/cma.c
parentcee104334c98dd04e9dd4d9a4fa4784f7f6aada9 (diff)
RDMA/cma: Consider netdevice for RoCE ports
When netdevice is not found for a request, and if it for RoCE port, currently it allows matching the listener as long as port number matches by ignoring the netdevice. Now that we always prefer to have netdevice associated with RoCE, when netdevice is not found, don't consider RoCE ports. In other words, a NULL netdevice with RoCE is not acceptable. Therefore, remove this confusing RoCE port ignorance check. Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/cma.c')
-rw-r--r--drivers/infiniband/core/cma.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 693e025a1585..2eb4022f1790 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1470,10 +1470,9 @@ static bool cma_match_net_dev(const struct rdma_cm_id *id,
1470 const struct rdma_addr *addr = &id->route.addr; 1470 const struct rdma_addr *addr = &id->route.addr;
1471 1471
1472 if (!net_dev) 1472 if (!net_dev)
1473 /* This request is an AF_IB request or a RoCE request */ 1473 /* This request is an AF_IB request */
1474 return (!id->port_num || id->port_num == port_num) && 1474 return (!id->port_num || id->port_num == port_num) &&
1475 (addr->src_addr.ss_family == AF_IB || 1475 (addr->src_addr.ss_family == AF_IB);
1476 rdma_protocol_roce(id->device, port_num));
1477 1476
1478 return !addr->dev_addr.bound_dev_if || 1477 return !addr->dev_addr.bound_dev_if ||
1479 (net_eq(dev_net(net_dev), addr->dev_addr.net) && 1478 (net_eq(dev_net(net_dev), addr->dev_addr.net) &&