net/mlx5: CT: Fix header-rewrite re-use for tupels
authorPaul Blakey <paulb@nvidia.com>
Mon, 23 May 2022 16:12:21 +0000 (19:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:12 +0000 (18:36 +0200)
commite5a1557906da1592adfa577659dd76e411d4f989
tree93e5a1873cc287293ffd8a948f958c8a8fa45051
parent4a333ec73dee15e860a56a0308b8b07f02e930e1
net/mlx5: CT: Fix header-rewrite re-use for tupels

[ Upstream commit 1f2856cde64baa78475e6d3c601fb7b7f693a161 ]

Tuple entries that don't have nat configured for them
which are added to the ct nat table will always create
a new modify header, as we don't check for possible
re-use on them. The same for tuples that have nat configured
for them but are added to ct table.

Fix the above by only avoiding wasteful re-use lookup
for actually natted entries in ct nat table.

Fixes: 7fac5c2eced3 ("net/mlx5: CT: Avoid reusing modify header context for natted entries")
Signed-off-by: Paul Blakey <paulb@nvidia.com>
Reviewed-by: Ariel Levkovich <lariel@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c