• Vladimir Oltean's avatar
    net: dsa: offload bridge port VLANs on foreign interfaces · 164f861b
    Vladimir Oltean authored
    DSA now explicitly handles VLANs installed with the 'self' flag on the
    bridge as host VLANs, instead of just replicating every bridge port VLAN
    also on the CPU port and never deleting it, which is what it did before.
    
    However, this leaves a corner case uncovered, as explained by
    Tobias Waldekranz:
    https://patchwork.kernel.org/project/netdevbpf/patch/20220209213044.2353153-6-vladimir.oltean@nxp.com/#24735260
    
    Forwarding towards a bridge port VLAN installed on a bridge port foreign
    to DSA (separate NIC, Wi-Fi AP) used to work by virtue of the fact that
    DSA itself needed to have at least one port in that VLAN (therefore, it
    also had the CPU port in said VLAN). However, now that the CPU port may
    not be member of all VLANs that user ports are members of, we need to
    ensure this isn't the case if software forwarding to a foreign interface
    is required.
    
    The solution is to treat bridge port VLANs on standalone interfaces in
    the exact same way as host VLANs. From DSA's perspective, there is no
    difference between local termination and software forwarding; packets in
    that VLAN must reach the CPU in both cases.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    164f861b
dsa2.c 40.3 KB