aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2017-10-08 05:53:26 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-08 13:05:27 -0400
commita69518cf0b4cbf02c6bc1239cdeb8750a9eb8077 (patch)
tree3b9ce1d50117a1ad187714628b8ccda0cb5b0c88
parent8fe2d6ccd52b086268f2f36e5e2fc0fe3aeffa80 (diff)
mlxsw: spectrum_router: Avoid expensive lookup during route removal
In commit fc922bb0dd94 ("mlxsw: spectrum_router: Use one LPM tree for all virtual routers") I increased the scale of supported VRFs by having all of them share the same LPM tree. In order to avoid look-ups for prefix lengths that don't exist, each route removal would trigger an aggregation across all the active virtual routers to see which prefix lengths are in use and which aren't and structure the tree accordingly. With the way the data structures are currently laid out, this is a very expensive operation. When preformed repeatedly - due to the invocation of the abort mechanism - and with enough VRFs, this can result in a hung task. For now, avoid this optimization until it can be properly re-added in net-next. Fixes: fc922bb0dd94 ("mlxsw: spectrum_router: Use one LPM tree for all virtual routers") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reported-by: David Ahern <dsa@cumulusnetworks.com> Tested-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 032089efc1a0..c16718d296d3 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -3505,20 +3505,6 @@ static int mlxsw_sp_fib_lpm_tree_link(struct mlxsw_sp *mlxsw_sp,
3505static void mlxsw_sp_fib_lpm_tree_unlink(struct mlxsw_sp *mlxsw_sp, 3505static void mlxsw_sp_fib_lpm_tree_unlink(struct mlxsw_sp *mlxsw_sp,
3506 struct mlxsw_sp_fib *fib) 3506 struct mlxsw_sp_fib *fib)
3507{ 3507{
3508 struct mlxsw_sp_prefix_usage req_prefix_usage = {{ 0 } };
3509 struct mlxsw_sp_lpm_tree *lpm_tree;
3510
3511 /* Aggregate prefix lengths across all virtual routers to make
3512 * sure we only have used prefix lengths in the LPM tree.
3513 */
3514 mlxsw_sp_vrs_prefixes(mlxsw_sp, fib->proto, &req_prefix_usage);
3515 lpm_tree = mlxsw_sp_lpm_tree_get(mlxsw_sp, &req_prefix_usage,
3516 fib->proto);
3517 if (IS_ERR(lpm_tree))
3518 goto err_tree_get;
3519 mlxsw_sp_vrs_lpm_tree_replace(mlxsw_sp, fib, lpm_tree);
3520
3521err_tree_get:
3522 if (!mlxsw_sp_prefix_usage_none(&fib->prefix_usage)) 3508 if (!mlxsw_sp_prefix_usage_none(&fib->prefix_usage))
3523 return; 3509 return;
3524 mlxsw_sp_vr_lpm_tree_unbind(mlxsw_sp, fib); 3510 mlxsw_sp_vr_lpm_tree_unbind(mlxsw_sp, fib);