Browse Source

mlxsw: spectrum_router: Save requested prefix bitlist when creating tree

Currently, the prefix bitlist is not saved for LPM trees, causing the
compare to always fail which causes the tree to be destroyed and created
for every inserted and removed FIB entry. So fix this by saving
the bitlist as it should have been done from the very beginning.

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>
Jiri Pirko 8 years ago
parent
commit
2083d36790
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

+ 2 - 0
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

@@ -320,6 +320,8 @@ mlxsw_sp_lpm_tree_create(struct mlxsw_sp *mlxsw_sp,
 						lpm_tree);
 						lpm_tree);
 	if (err)
 	if (err)
 		goto err_left_struct_set;
 		goto err_left_struct_set;
+	memcpy(&lpm_tree->prefix_usage, prefix_usage,
+	       sizeof(lpm_tree->prefix_usage));
 	return lpm_tree;
 	return lpm_tree;
 
 
 err_left_struct_set:
 err_left_struct_set: