• Ido Schimmel's avatar
    mlxsw: spectrum: Add support for VLAN devices bridging · 26f0e7fb
    Ido Schimmel authored
    All the member VLAN devices in a bridge need to share the same vFID.
    
    To achieve that, expand the vFID struct to include the associated bridge
    device (or lack of) and allow one to lookup a vFID based on a bridge
    device.
    
    When joining a bridge, lookup the relevant vFID or create one if none
    exists. Next, make the VLAN device use the vFID.
    
    Leaving a bridge can either occur because a user removed the VLAN device
    from a bridge or because the VLAN device was deleted by the user. In the
    latter case the bridge's teardown sequence is invoked after the hardware
    vPort is already gone. Therefore, when unlinking the VLAN device from
    the real device, check if the associated vPort is bridged and act
    accordingly. The bridge's notification will be ignored in this case.
    
    Note that bridging a VLAN interface with an ordinary port netdev is
    currently not supported, but not forbidden. This will be addressed in a
    follow-up patchset.
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    26f0e7fb
spectrum.h 7.04 KB