]> git.itanic.dy.fi Git - linux-stable/commit
net/mlx5: DR, Manage definers with refcounts
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Thu, 25 Aug 2022 12:35:59 +0000 (15:35 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 9 Dec 2022 00:10:54 +0000 (16:10 -0800)
commit1339678fdde1c84ea8b4d6e3627f7742c87f95fa
tree229a5dd1c41db21ece1ee922cbf46a141544eb53
parentc72a57ad6e9183eeb6739ae688b6417df4a512ac
net/mlx5: DR, Manage definers with refcounts

In many cases different actions will ask for the same definer format.
Instead of allocating new definer general object and running out of
definers, have an xarray of allocated definers and keep track of their
usage with refcounts: allocate a new definer only when there isn't
one with the same format already created, and destroy definer only
when its refcount runs down to zero.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_definer.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h
drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h