netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: Allow non-gateway ECMP for IPv6
@ 2018-04-30 21:15 Thomas Winter
  2018-05-01  2:59 ` David Ahern
  2018-05-01 18:23 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Winter @ 2018-04-30 21:15 UTC (permalink / raw)
  To: netdev
  Cc: Thomas Winter, David Ahern, David S. Miller, Alexey Kuznetsov,
	Hideaki YOSHIFUJI

It is valid to have static routes where the nexthop
is an interface not an address such as tunnels.
For IPv4 it was possible to use ECMP on these routes
but not for IPv6.

Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Cc: David Ahern <dsahern@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
---
 include/net/ip6_route.h | 3 +--
 net/ipv6/ip6_fib.c      | 3 ---
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 08b132381984..abceb5864d99 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -68,8 +68,7 @@ static inline bool rt6_need_strict(const struct in6_addr *daddr)
 
 static inline bool rt6_qualify_for_ecmp(const struct rt6_info *rt)
 {
-	return (rt->rt6i_flags & (RTF_GATEWAY|RTF_ADDRCONF|RTF_DYNAMIC)) ==
-	       RTF_GATEWAY;
+	return (rt->rt6i_flags & (RTF_ADDRCONF | RTF_DYNAMIC)) == 0;
 }
 
 void ip6_route_input(struct sk_buff *skb);
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index deab2db6692e..3c97c29d4401 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -934,9 +934,6 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
 			 * list.
 			 * Only static routes (which don't have flag
 			 * RTF_EXPIRES) are used for ECMPv6.
-			 *
-			 * To avoid long list, we only had siblings if the
-			 * route have a gateway.
 			 */
 			if (rt_can_ecmp &&
 			    rt6_qualify_for_ecmp(iter))
-- 
2.17.0

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

* Re: [PATCH] ipv6: Allow non-gateway ECMP for IPv6
  2018-04-30 21:15 [PATCH] ipv6: Allow non-gateway ECMP for IPv6 Thomas Winter
@ 2018-05-01  2:59 ` David Ahern
  2018-05-01 13:20   ` Ido Schimmel
  2018-05-01 18:23 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: David Ahern @ 2018-05-01  2:59 UTC (permalink / raw)
  To: Thomas Winter, netdev
  Cc: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	Ido Schimmel

On 4/30/18 3:15 PM, Thomas Winter wrote:
> It is valid to have static routes where the nexthop
> is an interface not an address such as tunnels.
> For IPv4 it was possible to use ECMP on these routes
> but not for IPv6.
> 
> Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> ---
>  include/net/ip6_route.h | 3 +--
>  net/ipv6/ip6_fib.c      | 3 ---
>  2 files changed, 1 insertion(+), 5 deletions(-)
> 

Interesting. Existing code inserts the dev nexthop as a separate route.

Change looks good to me.

Acked-by: David Ahern <dsahern@gmail.com>

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

* Re: [PATCH] ipv6: Allow non-gateway ECMP for IPv6
  2018-05-01  2:59 ` David Ahern
@ 2018-05-01 13:20   ` Ido Schimmel
  0 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2018-05-01 13:20 UTC (permalink / raw)
  To: David Ahern
  Cc: Thomas Winter, netdev, David S. Miller, Alexey Kuznetsov,
	Hideaki YOSHIFUJI

On Mon, Apr 30, 2018 at 08:59:10PM -0600, David Ahern wrote:
> On 4/30/18 3:15 PM, Thomas Winter wrote:
> > It is valid to have static routes where the nexthop
> > is an interface not an address such as tunnels.
> > For IPv4 it was possible to use ECMP on these routes
> > but not for IPv6.
> > 
> > Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
> > Cc: David Ahern <dsahern@gmail.com>
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> > Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> > ---
> >  include/net/ip6_route.h | 3 +--
> >  net/ipv6/ip6_fib.c      | 3 ---
> >  2 files changed, 1 insertion(+), 5 deletions(-)
> > 
> 
> Interesting. Existing code inserts the dev nexthop as a separate route.
> 
> Change looks good to me.
> 
> Acked-by: David Ahern <dsahern@gmail.com>

Thanks for the Cc, David. I'll need to adjust mlxsw to support this.
Specifically, mlxsw_sp_fib6_rt_can_mp().

BTW, I hit this bug while looking into this:
https://patchwork.ozlabs.org/patch/907050/

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

* Re: [PATCH] ipv6: Allow non-gateway ECMP for IPv6
  2018-04-30 21:15 [PATCH] ipv6: Allow non-gateway ECMP for IPv6 Thomas Winter
  2018-05-01  2:59 ` David Ahern
@ 2018-05-01 18:23 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-05-01 18:23 UTC (permalink / raw)
  To: Thomas.Winter; +Cc: netdev, dsahern, kuznet, yoshfuji

From: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Date: Tue,  1 May 2018 09:15:29 +1200

> It is valid to have static routes where the nexthop
> is an interface not an address such as tunnels.
> For IPv4 it was possible to use ECMP on these routes
> but not for IPv6.
> 
> Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>

Applied, thank you.

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

end of thread, other threads:[~2018-05-01 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-30 21:15 [PATCH] ipv6: Allow non-gateway ECMP for IPv6 Thomas Winter
2018-05-01  2:59 ` David Ahern
2018-05-01 13:20   ` Ido Schimmel
2018-05-01 18:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).