net/mlx5: fix meter statistics
authorShun Hao <shunh@nvidia.com>
Tue, 20 Apr 2021 10:55:10 +0000 (13:55 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 21 Apr 2021 06:27:46 +0000 (08:27 +0200)
commit83306d6c465ad2320ecc5dfa8275b1d21a6cec6e
tree3a84e361ada737d1adf100a06b71dea7fb045f04
parent21091aba4ecd232a6999db6a7ba39f2c58296534
net/mlx5: fix meter statistics

Currently, packets after meter will be steered to a global policer
table,
which includes green/red color rules for every meter, so as to have
counter statistics of each color in every meter.

There's a bug that all the rules in global policer table are matching
only color criteria, so all packets will be counted to one meter only,
and other meter statistics are always zero.

This patch does these:
1. The rules in policer table matches both meter index and color, so
packet after meter could be counted to the correct meter counter.
2. The meter index and flow index are now sharing the available
register bits dynamically. Meter index starts from lsb, and flow
index starts from msb.

Fixes: 46a5e6bc6a85 ("net/mlx5: prepare meter flow tables")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/mlx5.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