]> asedeno.scripts.mit.edu Git - linux.git/commit
RDMA/core: Add command to set ib_core device net namspace sharing mode
authorParav Pandit <parav@mellanox.com>
Tue, 26 Feb 2019 12:01:49 +0000 (14:01 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 28 Mar 2019 17:52:02 +0000 (14:52 -0300)
commit2b34c558022673c0d6393dd7941d417f1b5a7236
tree033a3fa72e47d1ab80fcd977f8a0c8d1e667814d
parentcb7e0e130503cb8e5ee6a7e8983bf71ed408516f
RDMA/core: Add command to set ib_core device net namspace sharing mode

Add netlink command that enables/disables sharing rdma device among
multiple net namespaces.

Using rdma tool,
$rdma sys set netns shared (default mode)

When rdma subsystem netns mode is set to shared mode, rdma devices
will be accessible in all net namespaces.

Using rdma tool,
$rdma sys set netns exclusive

When rdma subsystem netns mode is set to exclusive mode, devices
will be accessible in only one net namespace at any given
point of time.

If there are any net namespaces other than default init_net exists,
while executing this command, it will fail and mode cannot be changed.

To change this mode, netlink command is used instead of sysctl, because
netlink command allows to auto load a module.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/core_priv.h
drivers/infiniband/core/device.c
drivers/infiniband/core/nldev.c
include/uapi/rdma/rdma_netlink.h