]> Git Repo - linux.git/commitdiff
net: bridge: vlan: don't notify to switchdev master VLANs without BRENTRY flag
authorVladimir Oltean <[email protected]>
Tue, 15 Feb 2022 17:02:09 +0000 (19:02 +0200)
committerDavid S. Miller <[email protected]>
Wed, 16 Feb 2022 11:21:04 +0000 (11:21 +0000)
When a VLAN is added to a bridge port and it doesn't exist on the bridge
device yet, it gets created for the multicast context, but it is
'hidden', since it doesn't have the BRENTRY flag yet:

ip link add br0 type bridge && ip link set swp0 master br0
bridge vlan add dev swp0 vid 100 # the master VLAN 100 gets created
bridge vlan add dev br0 vid 100 self # that VLAN becomes brentry just now

All switchdev drivers ignore switchdev notifiers for VLAN entries which
have the BRENTRY unset, and for good reason: these are merely private
data structures used by the bridge driver. So we might just as well not
notify those at all.

Cleanup in the switchdev drivers that check for the BRENTRY flag is now
possible, and will be handled separately, since those checks just became
dead code.

Signed-off-by: Vladimir Oltean <[email protected]>
Acked-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/bridge/br_vlan.c

index 7e99f84afb87c60b6cf5197afdeec2a7b46d2783..33c879c1ecf38a52ac4d393163e772fec4ae0e7a 100644 (file)
@@ -284,9 +284,12 @@ static int __vlan_add(struct net_bridge_vlan *v, u16 flags,
                }
                br_multicast_port_ctx_init(p, v, &v->port_mcast_ctx);
        } else {
-               err = br_switchdev_port_vlan_add(dev, v->vid, flags, extack);
-               if (err && err != -EOPNOTSUPP)
-                       goto out;
+               if (br_vlan_should_use(v)) {
+                       err = br_switchdev_port_vlan_add(dev, v->vid, flags,
+                                                        extack);
+                       if (err && err != -EOPNOTSUPP)
+                               goto out;
+               }
                br_multicast_ctx_init(br, v, &v->br_mcast_ctx);
                v->priv_flags |= BR_VLFLAG_GLOBAL_MCAST_ENABLED;
        }
This page took 0.063661 seconds and 4 git commands to generate.