• Ido Schimmel's avatar
    mlxsw: spectrum_router: Populate adjacency entries according to weights · eb789980
    Ido Schimmel authored
    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: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    eb789980
spectrum_router.c 177 KB