• Petr Machata's avatar
    nexthop: Implement notifiers for resilient nexthop groups · 7c37c7e0
    Petr Machata authored
    Implement the following notifications towards drivers:
    
    - NEXTHOP_EVENT_REPLACE, when a resilient nexthop group is created.
    
    - NEXTHOP_EVENT_BUCKET_REPLACE any time there is a change in assignment of
      next hops to hash table buckets. That includes replacements, deletions,
      and delayed upkeep cycles. Some bucket notifications can be vetoed by the
      driver, to make it possible to propagate bucket busy-ness flags from the
      HW back to the algorithm. Some are however forced, e.g. if a next hop is
      deleted, all buckets that use this next hop simply must be migrated,
      whether the HW wishes so or not.
    
    - NEXTHOP_EVENT_RES_TABLE_PRE_REPLACE, before a resilient nexthop group is
      replaced. Usually the driver will get the bucket notifications as well,
      and could veto those. But in some cases, a bucket may not be migrated
      immediately, but during delayed upkeep, and that is too late to roll the
      transaction back. This notification allows the driver to take a look and
      veto the new proposed group up front, before anything is committed.
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7c37c7e0
nexthop.c 74.4 KB