diff options
| author | Patrisious Haddad <phaddad@nvidia.com> | 2025-03-13 16:18:42 +0200 |
|---|---|---|
| committer | Leon Romanovsky <leon@kernel.org> | 2025-03-18 06:18:37 -0400 |
| commit | 7e53b31acc7f976d01a0718724a4c36f1fddf739 (patch) | |
| tree | a4d4d0235f73ead1cf81ba99000ffb275c24736d /include/rdma | |
| parent | d375db42a8effdfeb7973d4f1b0b5985e066fd28 (diff) | |
| download | linux-7e53b31acc7f976d01a0718724a4c36f1fddf739.tar.gz linux-7e53b31acc7f976d01a0718724a4c36f1fddf739.tar.bz2 linux-7e53b31acc7f976d01a0718724a4c36f1fddf739.zip | |
RDMA/core: Create and destroy rdma_counter using rdma_zalloc_drv_obj()
Change rdma_counter allocation to use rdma_zalloc_drv_obj() instead of,
explicitly allocating at core, in order to be contained inside driver
specific structures.
Adjust all drivers that use it to have their containing structure, and
add driver specific initialization operation.
This change is needed to allow upcoming patches to implement
optional-counters binding whereas inside each driver specific counter
struct his bound optional-counters will be maintained.
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/a5a484f421fc2e5595158e61a354fba43272b02d.1741875070.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'include/rdma')
| -rw-r--r-- | include/rdma/ib_verbs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 9941f4185c79..90e93297d59e 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -2666,6 +2666,11 @@ struct ib_device_ops { int (*counter_update_stats)(struct rdma_counter *counter); /** + * counter_init - Initialize the driver specific rdma counter struct. + */ + void (*counter_init)(struct rdma_counter *counter); + + /** * Allows rdma drivers to add their own restrack attributes * dumped via 'rdma stat' iproute2 command. */ @@ -2716,6 +2721,7 @@ struct ib_device_ops { DECLARE_RDMA_OBJ_SIZE(ib_srq); DECLARE_RDMA_OBJ_SIZE(ib_ucontext); DECLARE_RDMA_OBJ_SIZE(ib_xrcd); + DECLARE_RDMA_OBJ_SIZE(rdma_counter); }; struct ib_core_device { |
