aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/rdma_core.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-11-12 22:59:52 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-11-22 11:57:32 -0700
commit6829c1c2b371674a05562a39d608b5cf48351bea (patch)
tree637fbc743a57f244ff178cc11dc790175dd3f40a /drivers/infiniband/core/rdma_core.h
parentRDMA/uverbs: Factor out the add/get pattern into a helper (diff)
downloadlinux-dev-6829c1c2b371674a05562a39d608b5cf48351bea.tar.xz
linux-dev-6829c1c2b371674a05562a39d608b5cf48351bea.zip
RDMA/uverbs: Add helpers to mark uapi functions as unsupported
We have many cases where parts of the uapi are not supported in a driver, needs a certain protocol, or whatever. It is best to reflect this directly into the struct uverbs_api when it is built so that everything is simply blocked off, and future introspection can report a proper supported list. This is done by adding some additional helpers to the definition list language that disable objects based on a 'supported' call back, and a helper that disables based on a NULL struct ib_device function pointer. Disablement is global. For instance, if a driver disables an object then everything connected to that object is removed, including core methods. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/rdma_core.h')
-rw-r--r--drivers/infiniband/core/rdma_core.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/core/rdma_core.h b/drivers/infiniband/core/rdma_core.h
index e39e9da1ff71..ce042e51fc00 100644
--- a/drivers/infiniband/core/rdma_core.h
+++ b/drivers/infiniband/core/rdma_core.h
@@ -121,6 +121,7 @@ void release_ufile_idr_uobject(struct ib_uverbs_file *ufile);
struct uverbs_api_object {
const struct uverbs_obj_type *type_attrs;
const struct uverbs_obj_type_class *type_class;
+ u8 disabled:1;
};
struct uverbs_api_ioctl_method {
@@ -130,6 +131,7 @@ struct uverbs_api_ioctl_method {
u16 bundle_size;
u8 use_stack:1;
u8 driver_method:1;
+ u8 disabled:1;
u8 key_bitmap_len;
u8 destroy_bkey;
};
@@ -138,7 +140,6 @@ struct uverbs_api_attr {
struct uverbs_attr_spec spec;
};
-struct uverbs_api_object;
struct uverbs_api {
/* radix tree contains struct uverbs_api_* pointers */
struct radix_tree_root radix;
@@ -152,8 +153,7 @@ uapi_get_object(struct uverbs_api *uapi, u16 object_id)
}
char *uapi_key_format(char *S, unsigned int key);
-struct uverbs_api *uverbs_alloc_api(const struct uapi_definition *driver_def,
- enum rdma_driver_id driver_id);
+struct uverbs_api *uverbs_alloc_api(struct ib_device *ibdev);
void uverbs_disassociate_api_pre(struct ib_uverbs_device *uverbs_dev);
void uverbs_disassociate_api(struct uverbs_api *uapi);
void uverbs_destroy_api(struct uverbs_api *uapi);