Commit 66c74d74 authored by Parav Pandit's avatar Parav Pandit Committed by Jason Gunthorpe

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: default avatarParav Pandit <parav@mellanox.com>
Reviewed-by: default avatarMark Bloch <markb@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 2493a57b
...@@ -628,7 +628,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port, ...@@ -628,7 +628,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port,
return ret; return ret;
if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port)) { 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) if (!ndev)
return ret; return ret;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment