RDMA/mlx5: Extend ODP statistics with operation count
authorChiara Meiohas <cmeiohas@nvidia.com>
Tue, 3 Dec 2024 13:57:11 +0000 (15:57 +0200)
committerLeon Romanovsky <leon@kernel.org>
Tue, 10 Dec 2024 09:09:09 +0000 (04:09 -0500)
commitfbef60de6c753253e1337ea60cf818d079108974
tree11e9195da2512b9571d3843abef7729e956417f1
parentf5afe060b1031a5838bc3b0cb91f4c66a5cbf151
RDMA/mlx5: Extend ODP statistics with operation count

The current ODP counters represent the total number of pages
handled, but it is not enough to understand the effectiveness
of these operations.

Extend the ODP counters to include the number of times page fault
and invalidation events were handled.

Example for a single page fault handling 512 pages:
- page_fault: incremented by 512 (total pages)
- page_fault_handled: incremented by 1 (operation count)

The same example is applicable for page invalidation too.

Previous output:
$ rdma stat mr
dev rocep8s0f0 mrn 8 page_faults 27 page_invalidations 0 page_prefetch 29

New output:
$ rdma stat mr
dev rocep8s0f0 mrn 21 page_faults 512 page_faults_handled 1
page_invalidations 0 page_invalidations_handled 0 page_prefetch 51200

Signed-off-by: Chiara Meiohas <cmeiohas@nvidia.com>
Reviewed-by: Michael Guralnik <michaelgur@nvidia.com>
Link: https://patch.msgid.link/b18f29ed1392996ade66e9e6c45f018925253f6a.1733234165.git.leonro@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/odp.c
drivers/infiniband/hw/mlx5/restrack.c
include/rdma/ib_verbs.h