]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Get or put meter by the index of tc police action
authorJianbo Liu <jianbol@nvidia.com>
Mon, 7 Jun 2021 01:40:16 +0000 (01:40 +0000)
committerSaeed Mahameed <saeedm@nvidia.com>
Sat, 2 Jul 2022 18:58:28 +0000 (11:58 -0700)
commit9544615fcdc538281a4effd891666abb99ecc046
tree8d97af95113f56266bd48d4b7b6d0b8ba4a38a25
parent154b041d552af46337f5a0adb06a74bec0219af5
net/mlx5e: Get or put meter by the index of tc police action

Add functions to create and destroy flow meter aso object.
This object only supports the range allocation. 64 objects are
allocated at a time, and there are two meters in each object.
Usually only one meter is allocated for a flow, so bitmap is used
to manage these 128 meters.

TC police action is mapped to hardware meter. As the index is unique
for each police action, add APIs to allocate or free hardware meter by
the index. If the meter is already created, increment its refcnt,
otherwise create new one. If police action has different parameters,
update hardware meter accordingly.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.h