From: Parav Pandit Date: Tue, 9 Jan 2018 13:58:56 +0000 (+0200) Subject: RDMA/cma: Update cma_validate_port to honor net namespace X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=66c74d746db127152fadb33f75b2a8ffa4a02b27;p=openwrt%2Fstaging%2Fblogic.git RDMA/cma: Update cma_validate_port to honor net namespace cma_validate_port uses rdma_dev_addr to validate the port of the cm_id. It needs to honor the net namespace which is setup during cm_id creation when finding netdevice. Signed-off-by: Parav Pandit Reviewed-by: Mark Bloch Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 575ee4676252..2784512f597f 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -628,7 +628,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port, return ret; if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port)) { - ndev = dev_get_by_index(&init_net, bound_if_index); + ndev = dev_get_by_index(dev_addr->net, bound_if_index); if (!ndev) return ret; } else {