• Petr Machata's avatar
    mlxsw: spectrum_span: Suppress VLAN on BRIDGE_VLAN_INFO_UNTAGGED · 1fc68bb7
    Petr Machata authored
    When offloading mirroring to gretap or ip6gretap netdevices, an 802.1q
    bridge is one of the soft devices permissible in the underlay when
    resolving the packet path. After the packet path is resolved to a
    particular bridge egress device, flags on packet VLAN determine whether
    the egressed packet should be tagged.
    
    The current logic however only ever sets the VLAN tag, never suppresses
    it. Thus if there's a VLAN netdevice above the bridge that determines
    the packet VLAN, that VLAN is never unset, and mirroring is configured
    with VLAN tagging.
    
    Fix by setting the packet VLAN on both branches: set to zero (for unset)
    when BRIDGE_VLAN_INFO_UNTAGGED, copy the resolved VLAN (e.g. from bridge
    PVID) otherwise.
    
    Fixes: 946a11e7 ("mlxsw: spectrum_span: Allow bridge for gretap mirror")
    Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1fc68bb7
spectrum_span.c 27.6 KB