Skip to content

Commit 202854e

Browse files
mishuang2017Saeed Mahameed
authored andcommitted
net/mlx5: Properly deal with flow counters when deleting rules
When deleting a flow counter, the modify mask should be the action and the flow counter. Otherwise the flow counter is not deleted and we'll get a firmware warning when deleting the remaining destinations on the same FTE. It only happens in the presence of flow counter and multiple vport destinations. If there is only one vport destination, there is no need to update the FTE when deleting the only vport destination, we just delete the FTE. Fixes: ae05831 ("net/mlx5: Add option to add fwd rule with counter") Signed-off-by: Chris Mi <[email protected]> Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 99beaa2 commit 202854e

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ static void del_sw_hw_rule(struct fs_node *node)
482482

483483
if (rule->dest_attr.type == MLX5_FLOW_DESTINATION_TYPE_COUNTER &&
484484
--fte->dests_size) {
485-
modify_mask = BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_ACTION);
485+
modify_mask = BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_ACTION) |
486+
BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_FLOW_COUNTERS);
486487
fte->action.action &= ~MLX5_FLOW_CONTEXT_ACTION_COUNT;
487488
update_fte = true;
488489
goto out;

0 commit comments

Comments
 (0)