• Petr Machata's avatar
    mlxsw: spectrum_router: Use the available router pointer for netevent handling · 14304e70
    Petr Machata authored
    This code handles NETEVENT_DELAY_PROBE_TIME_UPDATE, which is invoked every
    time the delay_probe_time changes. mlxsw router currently only maintains
    one timer, so the last delay_probe_time set wins.
    
    Currently, mlxsw uses mlxsw_sp_port_lower_dev_hold() to find a reference to
    the router. This is no longer necessary. But as a side effect, this makes
    sure that only updates to "interesting netdevices" (ones that have a
    physical netdevice lower) are projected.
    
    Retain that side effect by calling mlxsw_sp_port_dev_lower_find_rcu() and
    punting if there is none. Then just proceed using the router pointer that's
    already at hand in the helper.
    
    Note that previously, the code took and put a reference of the netdevice.
    Because the mlxsw_sp pointer is now obtained from the notifier block, the
    port pointer (non-) NULL-ness is all that's relevant, and the reference
    does not need to be taken anymore.
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarAmit Cohen <amcohen@nvidia.com>
    Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    14304e70
spectrum_router.c 288 KB