Skip to content

Commit 961e897

Browse files
roidayandavem330
authored andcommitted
net/mlx5e: Refactor tc del flow to accept mlx5e_tc_flow instance
Change the function that deletes offloaded TC rule to get struct mlx5e_tc_flow instance which contains both the flow handle and flow attributes. This is a cleanup needed for downstream patches, it doesn't change any functionality. Signed-off-by: Roi Dayan <roid@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 86a33ae commit 961e897

File tree

1 file changed

+6
-7
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,17 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
143143
}
144144

145145
static void mlx5e_tc_del_flow(struct mlx5e_priv *priv,
146-
struct mlx5_flow_handle *rule,
147-
struct mlx5_esw_flow_attr *attr)
146+
struct mlx5e_tc_flow *flow)
148147
{
149148
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
150149
struct mlx5_fc *counter = NULL;
151150

152-
counter = mlx5_flow_rule_counter(rule);
151+
counter = mlx5_flow_rule_counter(flow->rule);
153152

154-
mlx5_del_flow_rules(rule);
153+
mlx5_del_flow_rules(flow->rule);
155154

156155
if (esw && esw->mode == SRIOV_OFFLOADS)
157-
mlx5_eswitch_del_vlan_action(esw, attr);
156+
mlx5_eswitch_del_vlan_action(esw, flow->attr);
158157

159158
mlx5_fc_destroy(priv->mdev, counter);
160159

@@ -1005,7 +1004,7 @@ int mlx5e_delete_flower(struct mlx5e_priv *priv,
10051004

10061005
rhashtable_remove_fast(&tc->ht, &flow->node, tc->ht_params);
10071006

1008-
mlx5e_tc_del_flow(priv, flow->rule, flow->attr);
1007+
mlx5e_tc_del_flow(priv, flow);
10091008

10101009
if (flow->attr->action & MLX5_FLOW_CONTEXT_ACTION_ENCAP)
10111010
mlx5e_detach_encap(priv, flow);
@@ -1065,7 +1064,7 @@ static void _mlx5e_tc_del_flow(void *ptr, void *arg)
10651064
struct mlx5e_tc_flow *flow = ptr;
10661065
struct mlx5e_priv *priv = arg;
10671066

1068-
mlx5e_tc_del_flow(priv, flow->rule, flow->attr);
1067+
mlx5e_tc_del_flow(priv, flow);
10691068
kfree(flow);
10701069
}
10711070

0 commit comments

Comments
 (0)