Skip to content

Commit

Permalink
net: dsa: Don't offload port attributes on standalone ports
Browse files Browse the repository at this point in the history
In a situation where a standalone port is indirectly attached to a
bridge (e.g. via a LAG) which is not offloaded, do not offload any
port attributes either. The port should behave as a standard NIC.

Previously, on mv88e6xxx, this meant that in the following setup:

     br0
     /
  team0
   / \
swp0 swp1

If vlan filtering was enabled on br0, swp0's and swp1's QMode was set
to "secure". This caused all untagged packets to be dropped, as their
default VID (0) was not loaded into the VTU.

Signed-off-by: Tobias Waldekranz <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
wkz authored and kuba-moo committed Jan 15, 2021
1 parent 32d4c56 commit 5696c8a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ static int dsa_slave_port_attr_set(struct net_device *dev,
struct dsa_port *dp = dsa_slave_to_port(dev);
int ret;

if (attr->orig_dev != dev)
return -EOPNOTSUPP;

switch (attr->id) {
case SWITCHDEV_ATTR_ID_PORT_STP_STATE:
ret = dsa_port_set_state(dp, attr->u.stp_state);
Expand Down

0 comments on commit 5696c8a

Please sign in to comment.