net/mlx5e: Delete forward rule for ct or sample action
authorChris Mi <cmi@nvidia.com>
Thu, 2 Dec 2021 03:18:02 +0000 (11:18 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 23 Dec 2021 04:38:49 +0000 (20:38 -0800)
When there is ct or sample action, the ct or sample rule will be deleted
and return. But if there is an extra mirror action, the forward rule can't
be deleted because of the return.

Fix it by removing the return.

Fixes: 69e2916ebce4 ("net/mlx5: CT: Add support for mirroring")
Fixes: f94d6389f6a8 ("net/mlx5e: TC, Add support to offload sample action")
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index 3d45f4ae80c0a41ce89240314c94b5aafd8bf121..f633448c3cc7ed9f2aaa8896a319bae9310c9440 100644 (file)
@@ -1196,21 +1196,16 @@ void mlx5e_tc_unoffload_fdb_rules(struct mlx5_eswitch *esw,
        if (attr->flags & MLX5_ESW_ATTR_FLAG_SLOW_PATH)
                goto offload_rule_0;
 
-       if (flow_flag_test(flow, CT)) {
-               mlx5_tc_ct_delete_flow(get_ct_priv(flow->priv), flow, attr);
-               return;
-       }
-
-       if (flow_flag_test(flow, SAMPLE)) {
-               mlx5e_tc_sample_unoffload(get_sample_priv(flow->priv), flow->rule[0], attr);
-               return;
-       }
-
        if (attr->esw_attr->split_count)
                mlx5_eswitch_del_fwd_rule(esw, flow->rule[1], attr);
 
+       if (flow_flag_test(flow, CT))
+               mlx5_tc_ct_delete_flow(get_ct_priv(flow->priv), flow, attr);
+       else if (flow_flag_test(flow, SAMPLE))
+               mlx5e_tc_sample_unoffload(get_sample_priv(flow->priv), flow->rule[0], attr);
+       else
 offload_rule_0:
-       mlx5_eswitch_del_offloaded_rule(esw, flow->rule[0], attr);
+               mlx5_eswitch_del_offloaded_rule(esw, flow->rule[0], attr);
 }
 
 struct mlx5_flow_handle *