From: Leon Romanovsky <leonro@xxxxxxxxxxxx> Hi, In order to remove ambiguity on the order of series, I combined three series into one, which does from the beginning (nldev and restrack refactoring through IDs exposure upto initial object cleanup). No change to userspace posted earlier. Thanks ------------------------------------------------------------------------- Changelog: v2->v3: * Rebased on to -rc4 * Removed special XA markings (RES_VISIBLE) * Dropped HW ID allocator for now. * Removed xa_is_err() check in *_byid() function * Reworded commit messages to reflect changes * Fixed compilation warning due to my changes to rdmavt v1->v2: * Added "Fortify .." atch, it helps to find uninitialized paths * Rewrote ".doit" patch v0->v1: * Don't set mark in case restrack entry failed to be added * Fix typos * Move kdoc comments from restrack.h to restrack.c * Rewrote user/kernel marking patch to drop xa_set_mark in favour of "user" field * Fixed two panics with uninitialized values, one for QPs and another for ibdev in CM_ID -------------------------------------------------------------------- 1. Refactoring and ID exposure parts: This part converts internal restrack DB implementation from hash-based to be XArray-based. Such change is needed to allow access per specific index for .doit callbacks. In addition, such index will provide ability to bind/unbind counters to specific QPs, provide valuable debug information about parent object (e.g. PD of specific QP, or context of specific PD) and get list of objects connected to specific context. 2. PD cleanup: In this part, I converted all drivers to use IB/core ib_pd allocation to ensure that ib_device pointer is valid. 3. Parent ID exposure: This small part exposes IDs and parent IDs to use to query specific objects. An example of how it can be extended to support multiple contexts for PD was posted to the ML in previous discussions. Thanks Leon Romanovsky (19): RDMA/nldev: Dynamically generate restrack dumpit callbacks RDMA/nldev: Refactor out PID namespace check RDMA/nldev: Prepare CAP_NET_ADMIN checks for .doit callbacks RDMA/nldev: Prepare code for per-port/per-device separation RDMA/restrack: Convert internal DB from hash to XArray RDMA/core: Simplify restrack interface RDMA/restrack: Translate from ID to restrack object RDMA/nldev: Add resource tracker doit callback RDMA/restrack: Reduce scope of synchronization lock while updating DB RDMA/core: Use ops infrastructure to keep all callbacks in one place RDMA/restrack: Hide restrack DB from IB/core RDMA/restrack: Prepare restrack_root to addition of extra fields per-type RDMA/restrack: Refactor user/kernel restrack additions RDMA/restrack: Add restrack wrappers to get ID and type RDMA/nldev: Share with user-space object IDs RDMA/nldev: Provide parent IDs for PD, MR and QP objects RDMA/core: Share driver structure size with core RDMA: Handle PD allocations by IB/core RDMA: Provide safe ib_alloc_device() function drivers/infiniband/core/cma.c | 8 +- drivers/infiniband/core/core_priv.h | 2 +- drivers/infiniband/core/device.c | 18 +- drivers/infiniband/core/nldev.c | 399 ++++++++++++------ drivers/infiniband/core/restrack.c | 277 +++++++++--- drivers/infiniband/core/uverbs_cmd.c | 21 +- drivers/infiniband/core/uverbs_std_types.c | 2 +- drivers/infiniband/core/uverbs_std_types_cq.c | 2 +- drivers/infiniband/core/verbs.c | 31 +- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 37 +- drivers/infiniband/hw/bnxt_re/ib_verbs.h | 9 +- drivers/infiniband/hw/bnxt_re/main.c | 3 +- drivers/infiniband/hw/cxgb3/iwch.c | 2 +- drivers/infiniband/hw/cxgb3/iwch_provider.c | 25 +- drivers/infiniband/hw/cxgb4/device.c | 2 +- drivers/infiniband/hw/cxgb4/provider.c | 27 +- drivers/infiniband/hw/cxgb4/restrack.c | 2 +- drivers/infiniband/hw/hns/hns_roce_device.h | 7 +- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 29 +- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- drivers/infiniband/hw/hns/hns_roce_main.c | 1 + drivers/infiniband/hw/hns/hns_roce_pd.c | 25 +- drivers/infiniband/hw/i40iw/i40iw_utils.c | 1 - drivers/infiniband/hw/i40iw/i40iw_verbs.c | 34 +- drivers/infiniband/hw/mlx4/main.c | 38 +- drivers/infiniband/hw/mlx5/ib_rep.c | 2 +- drivers/infiniband/hw/mlx5/main.c | 50 ++- drivers/infiniband/hw/mthca/mthca_main.c | 2 +- drivers/infiniband/hw/mthca/mthca_provider.c | 29 +- drivers/infiniband/hw/nes/nes_verbs.c | 34 +- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 3 +- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 92 ++-- drivers/infiniband/hw/ocrdma/ocrdma_verbs.h | 6 +- drivers/infiniband/hw/qedr/main.c | 3 +- drivers/infiniband/hw/qedr/verbs.c | 34 +- drivers/infiniband/hw/qedr/verbs.h | 6 +- drivers/infiniband/hw/usnic/usnic_ib_main.c | 3 +- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 26 +- drivers/infiniband/hw/usnic/usnic_ib_verbs.h | 7 +- .../infiniband/hw/vmw_pvrdma/pvrdma_main.c | 3 +- .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.c | 43 +- .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.h | 7 +- drivers/infiniband/sw/rdmavt/pd.c | 29 +- drivers/infiniband/sw/rdmavt/pd.h | 7 +- drivers/infiniband/sw/rdmavt/vt.c | 3 +- drivers/infiniband/sw/rxe/rxe.c | 8 - drivers/infiniband/sw/rxe/rxe_net.c | 2 +- drivers/infiniband/sw/rxe/rxe_pool.c | 4 - drivers/infiniband/sw/rxe/rxe_pool.h | 1 - drivers/infiniband/sw/rxe/rxe_qp.c | 4 - drivers/infiniband/sw/rxe/rxe_verbs.c | 34 +- drivers/infiniband/sw/rxe/rxe_verbs.h | 2 - include/rdma/ib_verbs.h | 42 +- include/rdma/rdma_cm.h | 2 +- include/rdma/restrack.h | 86 ++-- include/uapi/rdma/rdma_netlink.h | 10 + 56 files changed, 881 insertions(+), 707 deletions(-) -- 2.19.1