net/mlx5: fix flow split combined with counter
authorDekel Peled <dekelp@nvidia.com>
Sun, 17 Jan 2021 09:40:46 +0000 (11:40 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Jan 2021 17:16:07 +0000 (18:16 +0100)
commit63f4d5693ed8459f8867a23d0b87cf9c60983767
treed9d159b142e819735886d30e1e566b33cfad1977
parent5f8ae44dd454b29843bf91d24646ce88cbdd465a
net/mlx5: fix flow split combined with counter

Currently, for a flow containing a count action, if flow is split to
sub-flows, a new counter will be created for each sub-flow.
However only the counter created for the last sub-flow will be queried
on flow query and cleared on flow removal.

This behavior is wrong, causing a leak of resources.
Need to create just one counter per flow, and use it for all sub-flows.

This patch adds the required check to make sure a counter is
created just once per flow, and used by all sub-flows.

Fixes: fa2d01c87d2b ("net/mlx5: support flow aging")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/mlx5_flow_dv.c