Skip to content

Commit 66c74d7

Browse files
paravmellanoxjgunthorpe
authored andcommitted
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 <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 2493a57 commit 66c74d7

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/core

1 file changed

+1
-1
lines changed

drivers/infiniband/core/cma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port,
628628
return ret;
629629

630630
if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port)) {
631-
ndev = dev_get_by_index(&init_net, bound_if_index);
631+
ndev = dev_get_by_index(dev_addr->net, bound_if_index);
632632
if (!ndev)
633633
return ret;
634634
} else {

0 commit comments

Comments
 (0)