OSDN Git Service

mlxsw: spectrum_router: Store nexthop groups in a hash table
authorIdo Schimmel <idosch@mellanox.com>
Wed, 8 Feb 2017 10:16:29 +0000 (11:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Feb 2017 20:25:15 +0000 (15:25 -0500)
commite9ad5e7d8d3cf55ceb204b0f7a26c89bfd4b41fe
tree8b42a9a04d40fdf9a3ac8409698531fd4fd2781a
parente58be79e2dc818b0e2b3c69ea3d3fefcbc8c709b
mlxsw: spectrum_router: Store nexthop groups in a hash table

Currently, when we're notified about a new RTN_UNICAST route we perform
a lookup on the nexthop group list looking for a group with a matching
configuration to that found in the FIB info. This is quite inefficient.

Instead, we can simply rely on the kernel to consolidate several FIB
configurations into the same FIB info and use the FIB info as the key
for our private nexthop group struct.

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