> -----Original Message----- > From: Jason Gunthorpe <jgg@xxxxxxxx> > Sent: Friday, January 11, 2019 4:46 PM > To: Leon Romanovsky <leon@xxxxxxxxxx> > Cc: Doug Ledford <dledford@xxxxxxxxxx>; Leon Romanovsky > <leonro@xxxxxxxxxxxx>; RDMA mailing list <linux-rdma@xxxxxxxxxxxxxxx>; > Parav Pandit <parav@xxxxxxxxxxxx> > Subject: Re: [PATCH rdma-next 6/7] IB/ipoib: Read net namespace of parent > rdma device and set for netdev > > On Tue, Dec 18, 2018 at 02:28:35PM +0200, Leon Romanovsky wrote: > > From: Parav Pandit <parav@xxxxxxxxxxxx> > > > > When IPoIB netdevice is created for a rdma device, use the net > > namespace of rdma device for which a given IPoIB netdevice is created. > > > > Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx> > > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > drivers/infiniband/ulp/ipoib/ipoib_main.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c > > b/drivers/infiniband/ulp/ipoib/ipoib_main.c > > index 5224c42f9d08..2ff0f6651f04 100644 > > +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c > > @@ -2433,6 +2433,7 @@ static struct net_device *ipoib_add_port(const > char *format, > > return ndev; > > } > > priv = ipoib_priv(ndev); > > + dev_net_set(ndev, rdma_dev_net(hca)); > > I don't think it is appropriate for ULPs to auto-setup, that should be > historical behavior for the init_net only. > > Orchestration will get very confused if it moves a RDMA device and > eventually IPoIB devices it has no idea about, and can't control (ie to set the > right pkey), appear in the namespace. > Ok. Orchestration software can setup necessary things in the net namespace where it moved the rdma device. But at the same time it can explicitly move the IPoIB device too. So its fine. I will drop this patch in updated series and will move rdma_dev_net() to core_priv.h as ULP doesn't need it. > Jason