• Ido Schimmel's avatar
    mlxsw: spectrum_router: Update adjacency index more efficiently · ff47fa13
    Ido Schimmel authored
    The device supports an operation that allows the driver to issue one
    request to update the adjacency index for all the routes in a given
    virtual router (VR) from old index and size to new ones. This is useful
    in case the configuration of a certain nexthop group is updated and its
    adjacency index changes.
    
    Currently, the driver does not use this operation in an efficient
    manner. It iterates over all the routes using the nexthop group and
    issues an update request for the VR if it is not the same as the
    previous VR.
    
    Instead, use the VR tracking added in the previous patch to update the
    adjacency index once for each VR currently using the nexthop group.
    
    Example:
    
    8k IPv6 routes were added in an alternating manner to two VRFs. All the
    routes are using the same nexthop object ('nhid 1').
    
    Before:
    
    # perf stat -e devlink:devlink_hwmsg --filter='incoming==0' -- ip nexthop replace id 1 via 2001:db8:1::2 dev swp3
    
     Performance counter stats for 'ip n...
    ff47fa13
spectrum_router.c 250 KB