• I
    mlxsw: spectrum_router: Populate adjacency entries according to weights · eb789980
    Ido Schimmel 提交于
    Up until now the driver assumed all the nexthops have an equal weight
    and wrote each to a single adjacency entry.
    
    This patch takes the `weight` parameter into account and populates the
    adjacency group according to the relative weight of each nexthop.
    
    Specifically, the weights of all the nexthops that should be offloaded
    are first normalized and then used to calculate the upper adjacency
    index of each nexthop. This is done according to the hash-threshold
    algorithm used by the kernel for IPv4 multi-path routing.
    
    Adjacency groups are currently limited to 32 entries which limits the
    weights that can be used, but follow-up patches will introduce groups of
    512 entries.
    Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: NJiri Pirko <jiri@mellanox.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    eb789980
spectrum_router.c 177.2 KB