Skip to content

Commit 052eac6

Browse files
paravmellanoxjgunthorpe
authored andcommitted
RDMA/cma: Update RoCE multicast routines to use net namespace
rdma_dev_addr contains the net namespace pointer, while referring bound_dev_if of the rdma_dev_addr, refer to the net namespace of rdma_cm_id stored in rdma_dev_addr. 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 66c74d7 commit 052eac6

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

drivers/infiniband/core/cma.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3930,7 +3930,7 @@ static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast)
39303930
struct rdma_dev_addr *dev_addr =
39313931
&id_priv->id.route.addr.dev_addr;
39323932
struct net_device *ndev =
3933-
dev_get_by_index(&init_net, dev_addr->bound_dev_if);
3933+
dev_get_by_index(dev_addr->net, dev_addr->bound_dev_if);
39343934
enum ib_gid_type gid_type =
39353935
id_priv->cma_dev->default_gid_type[id_priv->id.port_num -
39363936
rdma_start_port(id_priv->cma_dev->device)];
@@ -4120,7 +4120,7 @@ static int cma_iboe_join_multicast(struct rdma_id_private *id_priv,
41204120
mc->multicast.ib->rec.qkey = cpu_to_be32(RDMA_UDP_QKEY);
41214121

41224122
if (dev_addr->bound_dev_if)
4123-
ndev = dev_get_by_index(&init_net, dev_addr->bound_dev_if);
4123+
ndev = dev_get_by_index(dev_addr->net, dev_addr->bound_dev_if);
41244124
if (!ndev) {
41254125
err = -ENODEV;
41264126
goto out2;
@@ -4238,7 +4238,7 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
42384238
struct net_device *ndev = NULL;
42394239

42404240
if (dev_addr->bound_dev_if)
4241-
ndev = dev_get_by_index(&init_net,
4241+
ndev = dev_get_by_index(dev_addr->net,
42424242
dev_addr->bound_dev_if);
42434243
if (ndev) {
42444244
cma_igmp_send(ndev,

0 commit comments

Comments
 (0)