aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/nldev.c
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2019-04-15 13:22:50 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-04-22 14:44:58 -0300
commitdecbc7a6b0073f55b200d80a3ecf5a5e205edd06 (patch)
tree1f39165c9656f4829b2b93e1f82157fcfefed175 /drivers/infiniband/core/nldev.c
parentRDMA/core: Avoid freeing netdevs in disable_device() (diff)
downloadlinux-dev-decbc7a6b0073f55b200d80a3ecf5a5e205edd06.tar.xz
linux-dev-decbc7a6b0073f55b200d80a3ecf5a5e205edd06.zip
RDMA/core: Introduce a helper function to change net namespace of rdma device
Introduce a helper function that changes rdma device's net namespace which performs mini disable/enable sequence to have device visible only in assigned net namespace. Device unregistration, device rename and device change net namespace may be invoked concurrently. (a) device unregistration needs to wait if a device change (rename or net namespace change) operation is in progress. (b) device net namespace change should not proceed if the unregistration has started. (c) while one cpu is changing device net namespace, other cpu should not be able to rename or change net namespace. To address above concurrency, (a) Use unreg_mutex to synchronize between ib_unregister_device() and net namespace change operation (b) In cases where unregister_device() has started unregistration before change_netns got chance to acquire unreg_mutex, validate the refcount - if it dropped to zero, abort the net namespace change operation. Finally use the helper function to change net namespace of ib device to move the device back to init_net when such net is deleted. Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/nldev.c')
0 files changed, 0 insertions, 0 deletions