• Petr Machata's avatar
    mlxsw: spectrum_switchdev: Replay switchdev objects on port join · ec4643ca
    Petr Machata authored
    Currently it never happens that a netdevice that is already a bridge slave
    would suddenly become mlxsw upper. The only case where this might be
    possible as far as mlxsw is concerned, is with LAG netdevices. But if a LAG
    has any upper (e.g. is enslaved), enlaving mlxsw port to that LAG is
    forbidden. Thus the only way to install a LAG between a bridge and a mlxsw
    port is by first enslaving the port to the LAG, and then enslaving that LAG
    to a bridge. At that point there are no bridge objects (such as port VLANs)
    to replay. Those are added afterwards, and notified as they are created.
    This holds even for the PVID.
    
    However in the following patches, the requirement that ports be only
    enslaved to masters without uppers, is going to be relaxed. It will
    therefore be necessary to replay the existing bridge objects. Without this
    replay, e.g. the mlxsw bridge_port_vlan objects are not instantiated, which
    causes issues later, as a lot of code relies on their presence.
    
    To that end, add a new notifier block whose sole role is to filter out
    events related to the one relevant upper, and forward those to the existing
    switchdev notifier block. Pass the new notifier block to
    switchdev_bridge_port_offload() when the bridge port is created.
    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>
    ec4643ca
spectrum.h 51.4 KB