Skip to content

Commit 465e7ba

Browse files
maorgottliebSaeed Mahameed
authored andcommitted
net/mlx5: Fix deletion of duplicate rules
When a rule is duplicated, the refcount of the rule is increased so only the second deletion of the rule should cause destruction of the FTE. Currently, the FTE will be destroyed in the first deletion of rule since the modify_mask will be 0. Fix it and call to destroy FTE only if all the rules (FTE's children) have been removed. Fixes: 718ce4d ("net/mlx5: Consolidate update FTE for all removal changes") Signed-off-by: Maor Gottlieb <maorg@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent f42139b commit 465e7ba

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,10 +2010,11 @@ void mlx5_del_flow_rules(struct mlx5_flow_handle *handle)
20102010
down_write_ref_node(&fte->node, false);
20112011
for (i = handle->num_rules - 1; i >= 0; i--)
20122012
tree_remove_node(&handle->rule[i]->node, true);
2013-
if (fte->modify_mask && fte->dests_size) {
2014-
modify_fte(fte);
2013+
if (fte->dests_size) {
2014+
if (fte->modify_mask)
2015+
modify_fte(fte);
20152016
up_write_ref_node(&fte->node, false);
2016-
} else {
2017+
} else if (list_empty(&fte->node.children)) {
20172018
del_hw_fte(&fte->node);
20182019
/* Avoid double call to del_hw_fte */
20192020
fte->node.del_hw_func = NULL;

0 commit comments

Comments
 (0)