]> asedeno.scripts.mit.edu Git - linux.git/commit
mlxsw: spectrum_router: Use one LPM tree for all virtual routers
authorIdo Schimmel <idosch@mellanox.com>
Mon, 14 Aug 2017 08:54:05 +0000 (10:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Aug 2017 18:14:03 +0000 (11:14 -0700)
commitfc922bb0dd9406dd9897fd47df958789891c380e
tree0f6fdc1f263b39e0128169fc59150148ff9beb39
parent0adb214ba2c04489eb13bdbd145c5bf77d78b078
mlxsw: spectrum_router: Use one LPM tree for all virtual routers

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: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c