aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/ib_verbs.h
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2019-02-26 13:56:13 +0200
committerJason Gunthorpe <jgg@mellanox.com>2019-03-28 14:52:02 -0300
commit4e0f7b9070726a34bbd87a74e407d4cced6d49ab (patch)
treee3c106a91fa5612c05d6b91210b96b37fac9cab5 /include/rdma/ib_verbs.h
parentRDMA/core: Restrict sysfs entries view to init_net (diff)
downloadlinux-dev-4e0f7b9070726a34bbd87a74e407d4cced6d49ab.tar.xz
linux-dev-4e0f7b9070726a34bbd87a74e407d4cced6d49ab.zip
RDMA/core: Implement compat device/sysfs tree in net namespace
Implement compatibility layer sysfs entries of ib_core so that non init_net net namespaces can also discover rdma devices. Each non init_net net namespace has ib_core_device created in it. Such ib_core_device sysfs tree resembles rdma devices found in init_net namespace. This allows discovering rdma devices in multiple non init_net net namespaces via sysfs entries and helpful to rdma-core userspace. Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r--include/rdma/ib_verbs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 5f9f4fcdc4cc..d42267e72c4b 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2559,6 +2559,7 @@ struct ib_core_device {
* union of ib_core_device and device exists in ib_device.
*/
struct device dev;
+ possible_net_t rdma_net;
struct kobject *ports_kobj;
struct list_head port_list;
struct ib_device *owner; /* reach back to owner ib_device */
@@ -2636,6 +2637,11 @@ struct ib_device {
struct work_struct unregistration_work;
const struct rdma_link_ops *link_ops;
+
+ /* Protects compat_devs xarray modifications */
+ struct mutex compat_devs_mutex;
+ /* Maintains compat devices for each net namespace */
+ struct xarray compat_devs;
};
struct ib_client {