aboutsummaryrefslogtreecommitdiff
path: root/lib/test_uuid.c
diff options
context:
space:
mode:
authorParav Pandit2019-04-15 13:22:50 +0300
committerJason Gunthorpe2019-04-22 14:44:58 -0300
commitdecbc7a6b0073f55b200d80a3ecf5a5e205edd06 (patch)
tree1f39165c9656f4829b2b93e1f82157fcfefed175 /lib/test_uuid.c
parent3042492bd1f9a08e9cf4c1a4621e359fb0f9a126 (diff)
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 'lib/test_uuid.c')
0 files changed, 0 insertions, 0 deletions