RDMA: Split the alloc_hw_stats() ops to port and device variants
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 11 Jun 2021 16:00:20 +0000 (19:00 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 16 Jun 2021 23:58:29 +0000 (20:58 -0300)
commit4b5f4d3fb40898a9f2ccf58030e69ea11fbd6eed
treea191b8ab07bb64e542a5c27f37dddc2b58766634
parent570d2b99d00d9e023328c0a0b8000ab485113384
RDMA: Split the alloc_hw_stats() ops to port and device variants

This is being used to implement both the port and device global stats,
which is causing some confusion in the drivers. For instance EFA and i40iw
both seem to be misusing the device stats.

Split it into two ops so drivers that don't support one or the other can
leave the op NULL'd, making the calling code a little simpler to
understand.

Link: https://lore.kernel.org/r/1955c154197b2a159adc2dc97266ddc74afe420c.1623427137.git.leonro@nvidia.com
Tested-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
19 files changed:
drivers/infiniband/core/counters.c
drivers/infiniband/core/device.c
drivers/infiniband/core/nldev.c
drivers/infiniband/core/sysfs.c
drivers/infiniband/hw/bnxt_re/hw_counters.c
drivers/infiniband/hw/bnxt_re/hw_counters.h
drivers/infiniband/hw/bnxt_re/main.c
drivers/infiniband/hw/cxgb4/provider.c
drivers/infiniband/hw/efa/efa.h
drivers/infiniband/hw/efa/efa_main.c
drivers/infiniband/hw/efa/efa_verbs.c
drivers/infiniband/hw/hfi1/verbs.c
drivers/infiniband/hw/irdma/verbs.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx5/counters.c
drivers/infiniband/sw/rxe/rxe_hw_counters.c
drivers/infiniband/sw/rxe/rxe_hw_counters.h
drivers/infiniband/sw/rxe/rxe_verbs.c
include/rdma/ib_verbs.h