Skip to content

Commit

Permalink
net/mlx5: DR, Fix matcher disconnect error flow
Browse files Browse the repository at this point in the history
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: cc2295c ("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>
  • Loading branch information
Rongwei Liu authored and Jakub Kicinski committed Oct 27, 2022
1 parent 212b4d7 commit 4ea9891
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,8 @@ dr_rule_create_rule_nic(struct mlx5dr_rule *rule,
}

remove_from_nic_tbl:
mlx5dr_matcher_remove_from_tbl_nic(dmn, nic_matcher);
if (!nic_matcher->rules)
mlx5dr_matcher_remove_from_tbl_nic(dmn, nic_matcher);

free_hw_ste:
mlx5dr_domain_nic_unlock(nic_dmn);
Expand Down

0 comments on commit 4ea9891

Please sign in to comment.