From: Leon Romanovsky <leonro@xxxxxxxxxxxx> >From Jason, This extends the uverbs_uapi to have the notion of a disabled object and in turn disabled methods. Objects that are not supported by the driver become disabled and all the uAPI entry points are removed. The same approach is extended to the write() interface by harmonizing the write() method description with ioctl within the uverbs_api. Blocking commands very early on makes it harder to exploit any error path bugs that may exist, and provides the necessary infrastructure for an API introspection feature down the road. Along the way this introduces the next step towards making the specs macros saner but introducing a list-base description of the specs at the top level of the tree instead of the existing tree based description. This reworking is necessary to allow splitting data describing objects across multiple files. The introduction of meta-data for write() interface commands is the first step toward unifying the write/write_ex/ioctl command path into a consistent and interchangeable flow. Later series will add additional meta-data using this same framework. Thanks Jason Gunthorpe (10): RDMA/mlx5: Do not generate the uabi specs unconditionally RDMA/uverbs: Use a linear list to describe the compiled-in uapi RDMA/uverbs: Factor out the add/get pattern into a helper RDMA/uverbs: Add helpers to mark uapi functions as unsupported RDMA/mlx5: Use the uapi disablement APIs instead of code RDMA/uverbs: Require all objects to have a driver destroy function RDMA/verbs: Store the write/write_ex uapi entry points in the uverbs_api RDMA/uverbs: Convert the write interface to use uverbs_api RDMA/uverbs: Make all the method functions in uverbs_cmd static RDMA/uverbs: Check for NULL driver methods for every write call drivers/infiniband/core/rdma_core.h | 50 +- drivers/infiniband/core/uverbs.h | 62 --- drivers/infiniband/core/uverbs_cmd.c | 485 +++++++++++------ drivers/infiniband/core/uverbs_main.c | 127 +---- drivers/infiniband/core/uverbs_std_types.c | 47 +- .../core/uverbs_std_types_counters.c | 6 + drivers/infiniband/core/uverbs_std_types_cq.c | 6 + drivers/infiniband/core/uverbs_std_types_dm.c | 6 + .../core/uverbs_std_types_flow_action.c | 7 + drivers/infiniband/core/uverbs_std_types_mr.c | 6 + drivers/infiniband/core/uverbs_uapi.c | 515 +++++++++++++++--- drivers/infiniband/hw/mlx5/devx.c | 25 +- drivers/infiniband/hw/mlx5/flow.c | 20 +- drivers/infiniband/hw/mlx5/main.c | 56 +- drivers/infiniband/hw/mlx5/mlx5_ib.h | 12 +- include/rdma/ib_verbs.h | 2 +- include/rdma/uverbs_ioctl.h | 194 ++++++- include/rdma/uverbs_named_ioctl.h | 11 +- include/rdma/uverbs_std_types.h | 9 - 19 files changed, 1093 insertions(+), 553 deletions(-) -- 2.19.1