mlxsw: spectrum_router: Add support for nexthop group consolidation for IPv6
authorArkadi Sharshevsky <arkadis@mellanox.com>
Mon, 14 Aug 2017 19:09:20 +0000 (21:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Aug 2017 05:23:32 +0000 (22:23 -0700)
commite6f3b379c0c599a870bc0e7d8a0cbb0b316502f5
tree9a0060c8f47419902d1531fa1ca46a9569411978
parentba31d3666924adf1b4ad8e19400324a06b99c52c
mlxsw: spectrum_router: Add support for nexthop group consolidation for IPv6

Due to limited ASIC resources the maximum number of routes is limited by
the nexthop resource. In order to improve the routing scale nexthop
consolidation should be performed.

This patch adds support for IPv6 neighbor consolidation. The hash value
is calculated based on the nexthop set, by performing bitwise xor on the
ifindexs of the nexthops, in a similar way to IPv4's kernel implementation.
In case of collision a full match is performed between the sets which
include address and ifindex comparison.

Non gateway nexthop groups are not inserted to the hash table due to
lack of nexthop device (ifindex).

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-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