]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
RDMA/cma: Update RoCE multicast routines to use net namespace
authorParav Pandit <parav@mellanox.com>
Tue, 9 Jan 2018 13:58:57 +0000 (15:58 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 22 Jan 2018 18:39:50 +0000 (11:39 -0700)
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 <parav@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cma.c

index 2784512f597f826e8ce117b1b96af21e459a2b50..84812b9dea9b938343c117104b4f526da1d6c439 100644 (file)
@@ -3930,7 +3930,7 @@ static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast)
                struct rdma_dev_addr *dev_addr =
                        &id_priv->id.route.addr.dev_addr;
                struct net_device *ndev =
-                       dev_get_by_index(&init_net, dev_addr->bound_dev_if);
+                       dev_get_by_index(dev_addr->net, dev_addr->bound_dev_if);
                enum ib_gid_type gid_type =
                        id_priv->cma_dev->default_gid_type[id_priv->id.port_num -
                        rdma_start_port(id_priv->cma_dev->device)];
@@ -4120,7 +4120,7 @@ static int cma_iboe_join_multicast(struct rdma_id_private *id_priv,
                mc->multicast.ib->rec.qkey = cpu_to_be32(RDMA_UDP_QKEY);
 
        if (dev_addr->bound_dev_if)
-               ndev = dev_get_by_index(&init_net, dev_addr->bound_dev_if);
+               ndev = dev_get_by_index(dev_addr->net, dev_addr->bound_dev_if);
        if (!ndev) {
                err = -ENODEV;
                goto out2;
@@ -4238,7 +4238,7 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
                                        struct net_device *ndev = NULL;
 
                                        if (dev_addr->bound_dev_if)
-                                               ndev = dev_get_by_index(&init_net,
+                                               ndev = dev_get_by_index(dev_addr->net,
                                                                        dev_addr->bound_dev_if);
                                        if (ndev) {
                                                cma_igmp_send(ndev,