Skip to content

Commit 99b8202

Browse files
vladimirolteankuba-moo
authored andcommitted
net: dsa: fix SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING getting ignored
The bridge emits VLAN filtering events and quite a few others via switchdev with orig_dev = br->dev. After the blamed commit, these events started getting ignored. The point of the patch was to not offload switchdev objects for ports that didn't go through dsa_port_bridge_join, because the configuration is unsupported: - ports that offload a bonding/team interface go through dsa_port_bridge_join when that bonding/team interface is later bridged with another switch port or LAG - ports that don't offload LAG don't get notified of the bridge that is on top of that LAG. Sadly, a check is missing, which is that the orig_dev is equal to the bridge device. This check is compatible with the original intention, because ports that don't offload bridging because they use a software LAG don't have dp->bridge_dev set. On a semi-related note, we should not offload switchdev objects or populate dp->bridge_dev if the driver doesn't implement .port_bridge_join either. However there is no regression associated with that, so it can be done separately. Fixes: 5696c8a ("net: dsa: Don't offload port attributes on standalone ports") Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Tobias Waldekranz <[email protected]> Tested-by: Tobias Waldekranz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 75b8f78 commit 99b8202

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

net/dsa/dsa_priv.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,15 @@ static inline bool dsa_port_offloads_netdev(struct dsa_port *dp,
191191
/* Switchdev offloading can be configured on: */
192192

193193
if (dev == dp->slave)
194-
/* DSA ports directly connected to a bridge. */
194+
/* DSA ports directly connected to a bridge, and event
195+
* was emitted for the ports themselves.
196+
*/
197+
return true;
198+
199+
if (dp->bridge_dev == dev)
200+
/* DSA ports connected to a bridge, and event was emitted
201+
* for the bridge.
202+
*/
195203
return true;
196204

197205
if (dp->lag_dev == dev)

0 commit comments

Comments
 (0)