• Petr Machata's avatar
    mlxsw: spectrum_switchdev: Handle SWITCHDEV_PORT_OBJ_ADD/_DEL · 52a227b3
    Petr Machata authored
    Following patches will change the way of distributing port object
    changes from a switchdev operation to a switchdev notifier. The
    switchdev code currently recursively descends through layers of lower
    devices, eventually calling the op on a front-panel port device. The
    notifier will instead be sent referencing the bridge port device, which
    may be a stacking device that's one of front-panel ports uppers, or a
    completely unrelated device.
    
    To handle SWITCHDEV_PORT_OBJ_ADD and _DEL, subscribe to the blocking
    notifier chain. Dispatch to mlxsw_sp_port_obj_add() resp. _del() to
    maintain the behavior that the switchdev operation based code currently
    has. Defer to switchdev_handle_port_obj_add() / _del() to handle the
    recursive descend, because mlxsw supports a number of upper types.
    Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
    Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    52a227b3
spectrum_switchdev.c 86.6 KB