aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2016-08-24 06:00:25 -0400
committerDavid S. Miller <davem@davemloft.net>2016-08-24 12:41:12 -0400
commit640be7b7177dbe026cf7ae387b21f6917f0fc44f (patch)
tree097a19dd92b0e6172b95435a4c8f22ef7492a45a
parentf7a8f6cec38a549ffcc559a9eb14cab539100d97 (diff)
mlxsw: spectrum: Don't abort on first error when removing VLANs
When removing VLANs from the VLAN-aware bridge we shouldn't abort on the first error, as we'll otherwise have resources that will never be freed. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index 2f3831058bfe..e5cf8a5da5d0 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -1001,29 +1001,17 @@ static int mlxsw_sp_port_obj_add(struct net_device *dev,
1001static int __mlxsw_sp_port_vlans_del(struct mlxsw_sp_port *mlxsw_sp_port, 1001static int __mlxsw_sp_port_vlans_del(struct mlxsw_sp_port *mlxsw_sp_port,
1002 u16 vid_begin, u16 vid_end) 1002 u16 vid_begin, u16 vid_end)
1003{ 1003{
1004 struct net_device *dev = mlxsw_sp_port->dev;
1005 u16 vid, pvid; 1004 u16 vid, pvid;
1006 int err;
1007 1005
1008 if (!mlxsw_sp_port->bridged) 1006 if (!mlxsw_sp_port->bridged)
1009 return -EINVAL; 1007 return -EINVAL;
1010 1008
1011 pvid = mlxsw_sp_port->pvid; 1009 pvid = mlxsw_sp_port->pvid;
1012 if (pvid >= vid_begin && pvid <= vid_end) { 1010 if (pvid >= vid_begin && pvid <= vid_end)
1013 err = mlxsw_sp_port_pvid_set(mlxsw_sp_port, 0); 1011 mlxsw_sp_port_pvid_set(mlxsw_sp_port, 0);
1014 if (err) {
1015 netdev_err(dev, "Unable to del PVID %d\n", pvid);
1016 return err;
1017 }
1018 }
1019 1012
1020 err = __mlxsw_sp_port_vlans_set(mlxsw_sp_port, vid_begin, vid_end, 1013 __mlxsw_sp_port_vlans_set(mlxsw_sp_port, vid_begin, vid_end, false,
1021 false, false); 1014 false);
1022 if (err) {
1023 netdev_err(dev, "Unable to del VIDs %d-%d\n", vid_begin,
1024 vid_end);
1025 return err;
1026 }
1027 1015
1028 mlxsw_sp_port_fid_leave(mlxsw_sp_port, vid_begin, vid_end); 1016 mlxsw_sp_port_fid_leave(mlxsw_sp_port, vid_begin, vid_end);
1029 1017