net/mlx5: support meter creation with policy
authorLi Zhang <lizh@nvidia.com>
Tue, 27 Apr 2021 10:43:52 +0000 (13:43 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Tue, 27 Apr 2021 11:20:35 +0000 (13:20 +0200)
commit4443201863933b27274a2ffc0d648bebc90e6b9b
treecb18b0dc9ce6d7cf6451057f1537767a1c01f51c
parentafb4aa4f122b93f5b66f3a7dade139c024450890
net/mlx5: support meter creation with policy

Create a meter with the new pre-defined policy.

The following cases to be considered:
1.Add entry match with meter_id in global drop table.
2.For non-termination policy (policy id 0),
  add jump rule to suffix table for green and
  jump rule to drop table for red.
3.Allocate counter per meter in drop table.
4.Allocate meter resource per domain per color.
5.It can work with both ASO and legacy meter HW objects.

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/linux/mlx5_os.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow.h
drivers/net/mlx5/mlx5_flow_dv.c
drivers/net/mlx5/mlx5_flow_meter.c