Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 355368d5 authored by Gal Pressman's avatar Gal Pressman Committed by Saeed Mahameed
Browse files

net/mlx5e: Add rollback on add VLAN failure



When add VLAN rule fails the active vlan bit should be cleared.

Fixes: afb736e9 ("net/mlx5: Ethernet resource handling files")
Signed-off-by: default avatarGal Pressman <galp@mellanox.com>
Reviewed-by: default avatarMaor Gottlieb <maorg@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 2b52a283
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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,