• Ido Schimmel's avatar
    mlxsw: spectrum_router: Use one LPM tree for all virtual routers · fc922bb0
    Ido Schimmel authored
    The number of LPM trees available for lookup is much smaller than the
    number of virtual routers, which are used to implement VRFs. In
    addition, an LPM tree can only be used by one protocol - either IPv4 or
    IPv6.
    
    Therefore, in order to increase the number of supported virtual routers
    to the maximum we need to be able to share LPM trees across virtual
    routers instead of trying to find an optimized tree for each.
    
    Do that by allocating one LPM tree for each protocol, but make sure it
    will only include prefixes that are actually used, so as to not perform
    unnecessary lookups.
    
    Since changing the structure of a bound tree isn't recommended, whenever
    a new tree it required, it's first created and then bound to each
    virtual router, replacing the old one.
    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>
    fc922bb0
spectrum_router.c 131 KB