net/mlx5e: Fix enabling sriov while tc nic rules are offloaded
authorPaul Blakey <paulb@nvidia.com>
Wed, 22 Jun 2022 10:11:18 +0000 (13:11 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:17 +0000 (21:24 +0200)
commit3a5e734ec002905dabb6fb8fff6b5b65be0472f0
tree27bd3c26134cba9ee7ad5b53661456145dbeda85
parent5adcc5ded58ad6333f101030c5882178dbeb41f2
net/mlx5e: Fix enabling sriov while tc nic rules are offloaded

[ Upstream commit 0c9d876545a56aebed30fa306d0460a4d28d271a ]

There is a total of four 4M entries flow tables. In sriov disabled
mode, ct, ct_nat and post_act take three of them. When adding the
first tc nic rule in this mode, it will take another 4M table
for the tc <chain,prio> table. If user then enables sriov, the legacy
flow table tries to take another 4M and fails, and so enablement fails.

To fix that, have legacy fdb take the next available maximum
size from the fs ft pool.

Fixes: 4a98544d1827 ("net/mlx5: Move chains ft pool to be used by all firmware steering")
Signed-off-by: Paul Blakey <paulb@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c