All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net 0/2] mlxsw: Couple of fixes
@ 2016-10-25  9:25 Jiri Pirko
  2016-10-25  9:25 ` [patch net 1/2] mlxsw: spectrum_router: Save requested prefix bitlist when creating tree Jiri Pirko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiri Pirko @ 2016-10-25  9:25 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, ogerlitz

From: Jiri Pirko <jiri@mellanox.com>

Couple of LPM tree management fixes.

Jiri Pirko (2):
  mlxsw: spectrum_router: Save requested prefix bitlist when creating
    tree
  mlxsw: spectrum_router: Compare only trees which are in use during
    tree get

 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch net 1/2] mlxsw: spectrum_router: Save requested prefix bitlist when creating tree
  2016-10-25  9:25 [patch net 0/2] mlxsw: Couple of fixes Jiri Pirko
@ 2016-10-25  9:25 ` Jiri Pirko
  2016-10-25  9:25 ` [patch net 2/2] mlxsw: spectrum_router: Compare only trees which are in use during tree get Jiri Pirko
  2016-10-28 17:44 ` [patch net 0/2] mlxsw: Couple of fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2016-10-25  9:25 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, ogerlitz

From: Jiri Pirko <jiri@mellanox.com>

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>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index f3d50d3..4cff4c0 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -320,6 +320,8 @@ mlxsw_sp_lpm_tree_create(struct mlxsw_sp *mlxsw_sp,
 						lpm_tree);
 	if (err)
 		goto err_left_struct_set;
+	memcpy(&lpm_tree->prefix_usage, prefix_usage,
+	       sizeof(lpm_tree->prefix_usage));
 	return lpm_tree;
 
 err_left_struct_set:
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch net 2/2] mlxsw: spectrum_router: Compare only trees which are in use during tree get
  2016-10-25  9:25 [patch net 0/2] mlxsw: Couple of fixes Jiri Pirko
  2016-10-25  9:25 ` [patch net 1/2] mlxsw: spectrum_router: Save requested prefix bitlist when creating tree Jiri Pirko
@ 2016-10-25  9:25 ` Jiri Pirko
  2016-10-28 17:44 ` [patch net 0/2] mlxsw: Couple of fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2016-10-25  9:25 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, eladr, yotamg, nogahf, ogerlitz

From: Jiri Pirko <jiri@mellanox.com>

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>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 4cff4c0..4573da2 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;
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch net 0/2] mlxsw: Couple of fixes
  2016-10-25  9:25 [patch net 0/2] mlxsw: Couple of fixes Jiri Pirko
  2016-10-25  9:25 ` [patch net 1/2] mlxsw: spectrum_router: Save requested prefix bitlist when creating tree Jiri Pirko
  2016-10-25  9:25 ` [patch net 2/2] mlxsw: spectrum_router: Compare only trees which are in use during tree get Jiri Pirko
@ 2016-10-28 17:44 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-10-28 17:44 UTC (permalink / raw)
  To: jiri; +Cc: netdev, idosch, eladr, yotamg, nogahf, ogerlitz

From: Jiri Pirko <jiri@resnulli.us>
Date: Tue, 25 Oct 2016 11:25:55 +0200

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Couple of LPM tree management fixes.

Series applied, thanks Jiri.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-28 17:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25  9:25 [patch net 0/2] mlxsw: Couple of fixes Jiri Pirko
2016-10-25  9:25 ` [patch net 1/2] mlxsw: spectrum_router: Save requested prefix bitlist when creating tree Jiri Pirko
2016-10-25  9:25 ` [patch net 2/2] mlxsw: spectrum_router: Compare only trees which are in use during tree get Jiri Pirko
2016-10-28 17:44 ` [patch net 0/2] mlxsw: Couple of fixes David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.