From 86a33ae1ca06a58629c4d0d80ac6d099ff932ae0 Mon Sep 17 00:00:00 2001 From: Roi Dayan Date: Wed, 30 Nov 2016 17:59:41 +0200 Subject: [PATCH] net/mlx5e: Correct cleanup order when deleting offloaded TC rules According to the reverse unwinding principle, on delete time we should first handle deletion of the steering rule and later handle the vlan deletion from the eswitch. Fixes: 8b32580df1cb ("net/mlx5e: Add TC vlan action for SRIOV offloads") Signed-off-by: Roi Dayan Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index dd6d95473ade..4d71445d4a91 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -151,11 +151,11 @@ static void mlx5e_tc_del_flow(struct mlx5e_priv *priv, counter = mlx5_flow_rule_counter(rule); + mlx5_del_flow_rules(rule); + if (esw && esw->mode == SRIOV_OFFLOADS) mlx5_eswitch_del_vlan_action(esw, attr); - mlx5_del_flow_rules(rule); - mlx5_fc_destroy(priv->mdev, counter); if (!mlx5e_tc_num_filters(priv) && (priv->fs.tc.t)) { -- 2.30.2