]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: DR, Fix matcher disconnect error flow
authorRongwei Liu <rongweil@nvidia.com>
Wed, 26 Oct 2022 13:51:41 +0000 (14:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 15:00:34 +0000 (00:00 +0900)
commitafefb43dfb1aec055e7f102da9c1cfb946905981
tree2fc5d19af2816ff25799bb708fcad182913112f1
parenta23a0aacbba726ab68ed08c8ae5f947e7ddf7776
net/mlx5: DR, Fix matcher disconnect error flow

[ Upstream commit 4ea9891d66410da5030dababb4b825d8e41cd7bb ]

When 2nd flow rules arrives, it will merge together with the
1st one if matcher criteria is the same.

If merge fails, driver will rollback the merge contents, and
reject the 2nd rule. At rollback stage, matcher can't be
disconnected unconditionally, otherise the 1st rule can't be
hit anymore.

Add logic to check if the matcher should be disconnected or not.

Fixes: cc2295cd54e4 ("net/mlx5: DR, Improve steering for empty or RX/TX-only matchers")
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/20221026135153.154807-4-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c