diff options
author | 2017-09-14 16:24:19 +0300 | |
---|---|---|
committer | 2017-11-09 13:26:56 +0900 | |
commit | 355368d530460aa19b9d4291e2da2c6fd8929c76 (patch) | |
tree | dd688497eeecfa3055d8b6498c93c516119b0b68 /drivers/net/ethernet/mellanox | |
parent | net/mlx5e: Rename VLAN related variables and functions (diff) | |
download | linux-355368d530460aa19b9d4291e2da2c6fd8929c76.tar.gz linux-355368d530460aa19b9d4291e2da2c6fd8929c76.tar.bz2 linux-355368d530460aa19b9d4291e2da2c6fd8929c76.zip |
net/mlx5e: Add rollback on add VLAN failure
When add VLAN rule fails the active vlan bit should be cleared.
Fixes: afb736e9330a ("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>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c index 53901537778b..d3d775a93183 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c @@ -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, |