summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_mst.c
diff options
context:
space:
mode:
authorTobias Waldekranz <tobias@waldekranz.com>2022-03-16 16:08:47 +0100
committerJakub Kicinski <kuba@kernel.org>2022-03-17 16:49:58 -0700
commit6284c723d9b9995cc27ab3c6368a9d95d67111ff (patch)
treeeac9b2532e621791c439a34a0588523b1b9a254c /net/bridge/br_mst.c
parent87c167bb94ee3fd49569d4aa2038b9b8840d906f (diff)
downloadlinux-6284c723d9b9995cc27ab3c6368a9d95d67111ff.tar.bz2
net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations
Whenever a VLAN moves to a new MSTI, send a switchdev notification so that switchdevs can track a bridge's VID to MSTI mappings. Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> Acked-by: Nikolay Aleksandrov <razor@blackwall.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/bridge/br_mst.c')
-rw-r--r--net/bridge/br_mst.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/bridge/br_mst.c b/net/bridge/br_mst.c
index 43ca6b97c5c3..29266174e6b4 100644
--- a/net/bridge/br_mst.c
+++ b/net/bridge/br_mst.c
@@ -69,13 +69,26 @@ static void br_mst_vlan_sync_state(struct net_bridge_vlan *pv, u16 msti)
int br_mst_vlan_set_msti(struct net_bridge_vlan *mv, u16 msti)
{
+ struct switchdev_attr attr = {
+ .id = SWITCHDEV_ATTR_ID_VLAN_MSTI,
+ .orig_dev = mv->br->dev,
+ .u.vlan_msti = {
+ .vid = mv->vid,
+ .msti = msti,
+ },
+ };
struct net_bridge_vlan_group *vg;
struct net_bridge_vlan *pv;
struct net_bridge_port *p;
+ int err;
if (mv->msti == msti)
return 0;
+ err = switchdev_port_attr_set(mv->br->dev, &attr, NULL);
+ if (err && err != -EOPNOTSUPP)
+ return err;
+
mv->msti = msti;
list_for_each_entry(p, &mv->br->port_list, list) {