Skip to content

Commit

Permalink
net/mlx5e: Add rollback on add VLAN failure
Browse files Browse the repository at this point in the history
When add VLAN rule fails the active vlan bit should be cleared.

Fixes: afb736e ("net/mlx5: Ethernet resource handling files")
Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Gal Pressman authored and Saeed Mahameed committed Nov 9, 2017
1 parent 2b52a28 commit 355368d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
Original file line number Diff line number Diff line change
@@ -309,10 +309,15 @@ int mlx5e_vlan_rx_add_vid(struct net_device *dev, __always_unused __be16 proto,
u16 vid)
{
struct mlx5e_priv *priv = netdev_priv(dev);
int err;

set_bit(vid, priv->fs.vlan.active_cvlans);

return mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_MATCH_CTAG_VID, vid);
err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_MATCH_CTAG_VID, vid);
if (err)
clear_bit(vid, priv->fs.vlan.active_cvlans);

return err;
}

int mlx5e_vlan_rx_kill_vid(struct net_device *dev, __always_unused __be16 proto,

0 comments on commit 355368d

Please sign in to comment.