]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit01229e02aede185903614716fe7cc81fc460be64
tree3e635e40bea26b4e55b495277e11c966a7244af6
parent18ba48473bd05a6aba49d9554e7bad262d378846
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