diff options
author | Jiri Pirko <jiri@mellanox.com> | 2016-10-25 11:25:57 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-28 19:43:56 +0200 |
commit | 8b99becdc89ee7635137725e9fa76f304bb168f5 (patch) | |
tree | c36e71c6b5f4743cb3af7f1b47172356962667b6 /drivers/net/ethernet/mellanox | |
parent | mlxsw: spectrum_router: Save requested prefix bitlist when creating tree (diff) | |
download | linux-8b99becdc89ee7635137725e9fa76f304bb168f5.tar.xz linux-8b99becdc89ee7635137725e9fa76f304bb168f5.zip |
mlxsw: spectrum_router: Compare only trees which are in use during tree get
Only trees which are in use should be compared to requested prefix usage.
Fixes: 53342023eed9 ("mlxsw: spectrum_router: Implement LPM trees management")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 4cff4c043d11..4573da2c5560 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -345,7 +345,8 @@ mlxsw_sp_lpm_tree_get(struct mlxsw_sp *mlxsw_sp, for (i = 0; i < MLXSW_SP_LPM_TREE_COUNT; i++) { lpm_tree = &mlxsw_sp->router.lpm_trees[i]; - if (lpm_tree->proto == proto && + if (lpm_tree->ref_count != 0 && + lpm_tree->proto == proto && mlxsw_sp_prefix_usage_eq(&lpm_tree->prefix_usage, prefix_usage)) goto inc_ref_count; |