summaryrefslogtreecommitdiffstats
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-01-27 21:29:41 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-30 00:42:46 +0100
commitf123f2fbedc7c2723ceb050cd88c2ea1d6a8be32 (patch)
tree71a6966faf693bb9bb83c1c9640d5ccfa5a9cb5a /net/dsa/slave.c
parentnet: dsa: move bridge device in dsa_port (diff)
downloadlinux-f123f2fbedc7c2723ceb050cd88c2ea1d6a8be32.tar.xz
linux-f123f2fbedc7c2723ceb050cd88c2ea1d6a8be32.zip
net: dsa: pass bridge device when a port leaves
Upon reception of the NETDEV_CHANGEUPPER, a leaving port is already unbridged, so reflect this by assigning the port's bridge_dev pointer to NULL before calling the port_bridge_leave DSA driver operation. Now that the bridge_dev pointer is exposed to the drivers, reflecting the current state of the DSA switch fabric is necessary for the drivers to adjust their port based VLANs correctly. Pass the bridge device pointer to the port_bridge_leave operation so that drivers have all information to re-program their chips properly, and do not need to cache it anymore. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/dsa/slave.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index cdb1df87e111..08725286f79d 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -565,16 +565,16 @@ static int dsa_slave_bridge_port_join(struct net_device *dev,
return ret == -EOPNOTSUPP ? 0 : ret;
}
-static void dsa_slave_bridge_port_leave(struct net_device *dev)
+static void dsa_slave_bridge_port_leave(struct net_device *dev,
+ struct net_device *br)
{
struct dsa_slave_priv *p = netdev_priv(dev);
struct dsa_switch *ds = p->dp->ds;
+ p->dp->bridge_dev = NULL;
if (ds->ops->port_bridge_leave)
- ds->ops->port_bridge_leave(ds, p->dp->index);
-
- p->dp->bridge_dev = NULL;
+ ds->ops->port_bridge_leave(ds, p->dp->index, br);
/* Port left the bridge, put in BR_STATE_DISABLED by the bridge layer,
* so allow it to be in BR_STATE_FORWARDING to be kept functional
@@ -1343,7 +1343,7 @@ static int dsa_slave_port_upper_event(struct net_device *dev,
if (info->linking)
err = dsa_slave_bridge_port_join(dev, upper);
else
- dsa_slave_bridge_port_leave(dev);
+ dsa_slave_bridge_port_leave(dev, upper);
}
break;