All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net-next 0/2] mlxsw: spectrum_router: Couple of fixes
@ 2017-09-01  8:58 Jiri Pirko
  2017-09-01  8:58 ` [patch net-next 1/2] mlxsw: spectrum_router: Trap packets hitting anycast routes Jiri Pirko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiri Pirko @ 2017-09-01  8:58 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

Ido Schimmel (2):
  mlxsw: spectrum_router: Trap packets hitting anycast routes
  mlxsw: spectrum_router: Set abort trap in all virtual routers

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

-- 
2.9.3

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

* [patch net-next 1/2] mlxsw: spectrum_router: Trap packets hitting anycast routes
  2017-09-01  8:58 [patch net-next 0/2] mlxsw: spectrum_router: Couple of fixes Jiri Pirko
@ 2017-09-01  8:58 ` Jiri Pirko
  2017-09-01  8:58 ` [patch net-next 2/2] mlxsw: spectrum_router: Set abort trap in all virtual routers Jiri Pirko
  2017-09-01 17:01 ` [patch net-next 0/2] mlxsw: spectrum_router: Couple of fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2017-09-01  8:58 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, mlxsw

From: Ido Schimmel <idosch@mellanox.com>

I relied on the fact that anycast routes use the loopback device as
their nexthop device to trap packets hitting them to the CPU.

After commit 4832c30d5458 ("net: ipv6: put host and anycast routes on
device with address") this is no longer the case and such routes are
programmed with a forward action (note the 'offload' flag):

anycast cafe:: dev enp3s0np7 proto kernel metric 0 offload pref medium

This will prevent the router from locally receiving packets destined to
the Subnet-Router anycast address.

Fix this by specifically programming anycast routes with action trap,
which results in the following output:

anycast cafe:: dev enp3s0np7 proto kernel metric 0 pref medium

Fixes: 4832c30d5458 ("net: ipv6: put host and anycast routes on device with address")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 0cf6810..00e3aec 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -3659,7 +3659,7 @@ static void mlxsw_sp_fib6_entry_type_set(struct mlxsw_sp_fib_entry *fib_entry,
 	 * local, which will cause them to be trapped with a lower
 	 * priority than packets that need to be locally received.
 	 */
-	if (rt->rt6i_flags & RTF_LOCAL)
+	if (rt->rt6i_flags & (RTF_LOCAL | RTF_ANYCAST))
 		fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_TRAP;
 	else if (rt->rt6i_flags & RTF_REJECT)
 		fib_entry->type = MLXSW_SP_FIB_ENTRY_TYPE_LOCAL;
-- 
2.9.3

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

* [patch net-next 2/2] mlxsw: spectrum_router: Set abort trap in all virtual routers
  2017-09-01  8:58 [patch net-next 0/2] mlxsw: spectrum_router: Couple of fixes Jiri Pirko
  2017-09-01  8:58 ` [patch net-next 1/2] mlxsw: spectrum_router: Trap packets hitting anycast routes Jiri Pirko
@ 2017-09-01  8:58 ` Jiri Pirko
  2017-09-01 17:01 ` [patch net-next 0/2] mlxsw: spectrum_router: Couple of fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2017-09-01  8:58 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, mlxsw

From: Ido Schimmel <idosch@mellanox.com>

When the abort mechanism is invoked a default route directing packets to
the CPU is programmed in all the virtual routers currently in use. This
can result in packet loss in case a new VRF is configured.

Upon abort, program the default route in all virtual routers, whether
they are in use or not.

The patch is directed at net-next since post-abort fixes aren't critical
and packet loss due to a missing default route will be insignificant
compared to packet loss caused by the CPU port policer.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 00e3aec..de15eac 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -3993,9 +3993,6 @@ static int __mlxsw_sp_router_set_abort_trap(struct mlxsw_sp *mlxsw_sp,
 		char raltb_pl[MLXSW_REG_RALTB_LEN];
 		char ralue_pl[MLXSW_REG_RALUE_LEN];
 
-		if (!mlxsw_sp_vr_is_used(vr))
-			continue;
-
 		mlxsw_reg_raltb_pack(raltb_pl, vr->id, proto, tree_id);
 		err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(raltb),
 				      raltb_pl);
-- 
2.9.3

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

* Re: [patch net-next 0/2] mlxsw: spectrum_router: Couple of fixes
  2017-09-01  8:58 [patch net-next 0/2] mlxsw: spectrum_router: Couple of fixes Jiri Pirko
  2017-09-01  8:58 ` [patch net-next 1/2] mlxsw: spectrum_router: Trap packets hitting anycast routes Jiri Pirko
  2017-09-01  8:58 ` [patch net-next 2/2] mlxsw: spectrum_router: Set abort trap in all virtual routers Jiri Pirko
@ 2017-09-01 17:01 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-09-01 17:01 UTC (permalink / raw)
  To: jiri; +Cc: netdev, idosch, mlxsw

From: Jiri Pirko <jiri@resnulli.us>
Date: Fri,  1 Sep 2017 10:58:54 +0200

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Ido Schimmel (2):
>   mlxsw: spectrum_router: Trap packets hitting anycast routes
>   mlxsw: spectrum_router: Set abort trap in all virtual routers

Series applied.

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

end of thread, other threads:[~2017-09-01 17:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01  8:58 [patch net-next 0/2] mlxsw: spectrum_router: Couple of fixes Jiri Pirko
2017-09-01  8:58 ` [patch net-next 1/2] mlxsw: spectrum_router: Trap packets hitting anycast routes Jiri Pirko
2017-09-01  8:58 ` [patch net-next 2/2] mlxsw: spectrum_router: Set abort trap in all virtual routers Jiri Pirko
2017-09-01 17:01 ` [patch net-next 0/2] mlxsw: spectrum_router: 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.