mlxsw: spectrum_router: Implement LPM trees management
authorJiri Pirko <jiri@mellanox.com>
Mon, 4 Jul 2016 06:23:08 +0000 (08:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2016 01:25:14 +0000 (18:25 -0700)
commit53342023eed997503c497cedc18b0441b0674b6e
tree60589c31a616d6790be94e7278118e517b17106a
parent20ae4053e9ba21d6b96e4d86b0c63155769ef056
mlxsw: spectrum_router: Implement LPM trees management

Introduce basic LPM tree management allowing to share the trees in
between tables if the used prefixes in the tables are the same.
Build the tree structure according to the used prefixes. Although it is
not optimal for many use cases, this initial implementation does only
simple linear left-tree. More advanced structures will be introduced
later on, possibly including mechanisms to change trees on the fly.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c