• Petr Machata's avatar
    mlxsw: spectrum: Permit enslavement to netdevices with uppers · 2c5ffe8d
    Petr Machata authored
    Enslaving of front panel ports (and their uppers) to netdevices that
    already have uppers is currently forbidden. In the previous patches, a
    number of replays have been added. Those ensure that various bits of state,
    such as next hops or switchdev objects, are offloaded when they become
    relevant due to a mlxsw lower being introduced into the topology.
    
    However the act of actually, for example, enslaving a front-panel port to
    a bridge with uppers, has been vetoed so far. In this patch, remove the
    vetoes and permit the operation.
    
    mlxsw currently validates creation of "interesting" uppers. Thus creating
    VLAN netdevices on top of 802.1ad bridges is forbidden if the bridge has an
    mlxsw lower, but permitted in general. This validation code never gets run
    when a port is introduced as a lower of an existing netdevice structure.
    
    Thus when enslaving an mlxsw netdevice to netdevices with uppers, invoke
    the PRECHANGEUPPER event handler for each netdevice above the one that the
    front panel port is being enslaved to. This way the tower of netdevices
    above the attachment point is validated.
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarDanielle Ratson <danieller@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2c5ffe8d
spectrum.c 155 KB