diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2021-06-11 18:00:20 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-06-17 01:58:29 +0200 |
commit | 4b5f4d3fb40898a9f2ccf58030e69ea11fbd6eed (patch) | |
tree | a191b8ab07bb64e542a5c27f37dddc2b58766634 /drivers/infiniband/hw/cxgb4/provider.c | |
parent | RDMA/rxe: Disallow MR dereg and invalidate when bound (diff) | |
download | linux-4b5f4d3fb40898a9f2ccf58030e69ea11fbd6eed.tar.xz linux-4b5f4d3fb40898a9f2ccf58030e69ea11fbd6eed.zip |
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>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/provider.c')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/provider.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index 3f1893e180dd..4e453d1dde11 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c @@ -377,14 +377,11 @@ static const char * const names[] = { [IP6OUTRSTS] = "ip6OutRsts" }; -static struct rdma_hw_stats *c4iw_alloc_stats(struct ib_device *ibdev, - u32 port_num) +static struct rdma_hw_stats *c4iw_alloc_device_stats(struct ib_device *ibdev) { BUILD_BUG_ON(ARRAY_SIZE(names) != NR_COUNTERS); - if (port_num != 0) - return NULL; - + /* FIXME: these look like port stats */ return rdma_alloc_hw_stats_struct(names, NR_COUNTERS, RDMA_HW_STATS_DEFAULT_LIFESPAN); } @@ -455,7 +452,7 @@ static const struct ib_device_ops c4iw_dev_ops = { .driver_id = RDMA_DRIVER_CXGB4, .uverbs_abi_ver = C4IW_UVERBS_ABI_VERSION, - .alloc_hw_stats = c4iw_alloc_stats, + .alloc_hw_device_stats = c4iw_alloc_device_stats, .alloc_mr = c4iw_alloc_mr, .alloc_pd = c4iw_allocate_pd, .alloc_ucontext = c4iw_alloc_ucontext, |