Commit 93c098af authored by Kamal Heib's avatar Kamal Heib Committed by David S. Miller

net/mlx4_en: Fix the return value of a failure in VLAN VID add/kill

Modify mlx4_en_vlan_rx_[add/kill]_vid to return error value in case of
failure.

Fixes: 8e586137 ('net: make vlan ndo_vlan_rx_[add/kill]_vid return error value')
Signed-off-by: default avatarKamal Heib <kamalh@mellanox.com>
Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 27777daa
...@@ -406,14 +406,18 @@ static int mlx4_en_vlan_rx_add_vid(struct net_device *dev, ...@@ -406,14 +406,18 @@ static int mlx4_en_vlan_rx_add_vid(struct net_device *dev,
mutex_lock(&mdev->state_lock); mutex_lock(&mdev->state_lock);
if (mdev->device_up && priv->port_up) { if (mdev->device_up && priv->port_up) {
err = mlx4_SET_VLAN_FLTR(mdev->dev, priv); err = mlx4_SET_VLAN_FLTR(mdev->dev, priv);
if (err) if (err) {
en_err(priv, "Failed configuring VLAN filter\n"); en_err(priv, "Failed configuring VLAN filter\n");
goto out;
}
} }
if (mlx4_register_vlan(mdev->dev, priv->port, vid, &idx)) err = mlx4_register_vlan(mdev->dev, priv->port, vid, &idx);
en_dbg(HW, priv, "failed adding vlan %d\n", vid); if (err)
mutex_unlock(&mdev->state_lock); en_dbg(HW, priv, "Failed adding vlan %d\n", vid);
return 0; out:
mutex_unlock(&mdev->state_lock);
return err;
} }
static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev, static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev,
...@@ -421,7 +425,7 @@ static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev, ...@@ -421,7 +425,7 @@ static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev,
{ {
struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_en_dev *mdev = priv->mdev;
int err; int err = 0;
en_dbg(HW, priv, "Killing VID:%d\n", vid); en_dbg(HW, priv, "Killing VID:%d\n", vid);
...@@ -438,7 +442,7 @@ static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev, ...@@ -438,7 +442,7 @@ static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev,
} }
mutex_unlock(&mdev->state_lock); mutex_unlock(&mdev->state_lock);
return 0; return err;
} }
static void mlx4_en_u64_to_mac(unsigned char dst_mac[ETH_ALEN + 2], u64 src_mac) static void mlx4_en_u64_to_mac(unsigned char dst_mac[ETH_ALEN + 2], u64 src_mac)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment