RDMA/core: Add interface to read device namespace sharing mode

Add an interface via netlink command to query whether rdma devices are
shared among multiple net namespaces or not. When using RDMAtool, it can
be queried as,

$rdma system show netns
netns shared

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Parav Pandit 2019-02-26 14:01:48 +02:00 • committed by Jason Gunthorpe
commit cb7e0e1305
4 changed files with 42 additions and 2 deletions

View file

@ -261,7 +261,8 @@ enum rdma_nldev_command {
RDMA_NLDEV_CMD_PORT_GET, /* can dump */
/* 6 - 8 are free to use */
RDMA_NLDEV_CMD_SYS_GET, /* can dump */
/* 7 - 8 are free to use */
RDMA_NLDEV_CMD_RES_GET = 9, /* can dump */
@ -472,6 +473,12 @@ enum rdma_nldev_attr {
*/
RDMA_NLDEV_ATTR_LINK_TYPE, /* string */
/*
* net namespace mode for rdma subsystem:
* either shared or exclusive among multiple net namespaces.
*/
RDMA_NLDEV_SYS_ATTR_NETNS_MODE, /* u8 */
/*
* Always the end
*/