mlxsw: spectrum_router: Store nexthops in a hash table
authorIdo Schimmel <idosch@mellanox.com>
Wed, 8 Feb 2017 10:16:30 +0000 (11:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Feb 2017 20:25:16 +0000 (15:25 -0500)
commitc53b8e1b5a6a84da753d8b19c4f59fd8b693d579
tree3e635e40bea26b4e55b495277e11c966a7244af6
parente9ad5e7d8d3cf55ceb204b0f7a26c89bfd4b41fe
mlxsw: spectrum_router: Store nexthops in a hash table

Later in the patchset we'll add the NH_{ADD,DEL} events which will let
us know when a nexthop is considered to be dead. Based on these events
we need to be able to add or remove the nexthop from the device's
tables.

Therefore, store the private nexthop structs in a hash table and use the
kernel's fib_nh struct as the key, so that we'll be able to easily find
them when the events are received.

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.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c