net/mlx5: optimize meter statistics
authorLi Zhang <lizh@nvidia.com>
Tue, 20 Apr 2021 10:55:11 +0000 (13:55 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 21 Apr 2021 06:27:49 +0000 (08:27 +0200)
commit5df35867d97f95d07de042dff1b215526313820c
treeb826da4bc0891edca6fe03b3b8637d7f2dccdc03
parent83306d6c465ad2320ecc5dfa8275b1d21a6cec6e
net/mlx5: optimize meter statistics

Meter statistics are each policer action each counter.
Totally 4 counters per each meter.
It causes cache missed
and lead to data forwarding performance low.

To optimize it, support pass counter for green
and drop counter for red.
Totally two counters per each meter.
Also use the global drop statistics for
all meter drop action.

Limitations as below:
1. It does not support yellow counter and return 0.
2. All the meter colors with drop action will be
   counted only by the global drop statistics.
3. Red color must be with drop action.

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