IB/mlx5: Add counters create and destroy support

This patch implements the device counters create and destroy APIs and
introducing some internal management structures.

Downstream patches in this series will add the functionality to support
flow counters binding and reading.

Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Raed Salem <raeds@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Raed Salem
2018-05-31 16:43:38 +03:00
committed by Leon Romanovsky
parent b6ba4a9aa5
commit b29e2a1309
2 changed files with 33 additions and 0 deletions

View File

@@ -813,6 +813,16 @@ struct mlx5_memic {
DECLARE_BITMAP(memic_alloc_pages, MLX5_MAX_MEMIC_PAGES);
};
struct mlx5_ib_mcounters {
struct ib_counters ibcntrs;
};
static inline struct mlx5_ib_mcounters *
to_mcounters(struct ib_counters *ibcntrs)
{
return container_of(ibcntrs, struct mlx5_ib_mcounters, ibcntrs);
}
struct mlx5_ib_dev {
struct ib_device ib_dev;
struct mlx5_core_dev *mdev;