* [PATCH net 1/1] via-rhine: fix VLAN receive handling regression.
@ 2015-10-14 22:14 Francois Romieu
2015-10-15 7:24 ` Nick Alcock
2015-10-16 8:02 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Francois Romieu @ 2015-10-14 22:14 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Andrej Ota, Nix
From: Andrej Ota <andrej@ota•si>
Because eth_type_trans() consumes ethernet header worth of bytes, a call
to read TCI from end of packet using rhine_rx_vlan_tag() no longer works
as it's reading from an invalid offset.
Tested to be working on PCEngines Alix board.
Fixes: 810f19bcb862 ("via-rhine: add consistent memory barrier in vlan receive code.")
Signed-off-by: Andrej Ota <andrej@ota•si>
Acked-by: Francois Romieu <romieu@fr•zoreil.com>
---
Applies fine as of 0f8b8e28fb3241f9fd82ce13bac2b40c35e987e0
("tipc: eliminate risk of stalled link synchronization").
Andrej posted it on l-k the 2015/10/04, see
http://marc.info/?l=linux-kernel&m=144398918324349
Kernel v4.2 exhibits the regression. Stable v4.[01] kernels don't.
drivers/net/ethernet/via/via-rhine.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index a832637..2b7550c 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -2134,10 +2134,11 @@ static int rhine_rx(struct net_device *dev, int limit)
}
skb_put(skb, pkt_len);
- skb->protocol = eth_type_trans(skb, dev);
rhine_rx_vlan_tag(skb, desc, data_size);
+ skb->protocol = eth_type_trans(skb, dev);
+
netif_receive_skb(skb);
u64_stats_update_begin(&rp->rx_stats.syncp);
--
2.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net 1/1] via-rhine: fix VLAN receive handling regression.
2015-10-14 22:14 [PATCH net 1/1] via-rhine: fix VLAN receive handling regression Francois Romieu
@ 2015-10-15 7:24 ` Nick Alcock
2015-10-16 8:02 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: Nick Alcock @ 2015-10-15 7:24 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, David Miller, Andrej Ota
On 14 Oct 2015, Francois Romieu told this:
> From: Andrej Ota <andrej@ota•si>
>
> Because eth_type_trans() consumes ethernet header worth of bytes, a call
> to read TCI from end of packet using rhine_rx_vlan_tag() no longer works
> as it's reading from an invalid offset.
>
> Tested to be working on PCEngines Alix board.
LGTM, though not tested because I don't have any vlans set up on my VIA
Rhine box and I can't reboot it at the moment. :)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net 1/1] via-rhine: fix VLAN receive handling regression.
2015-10-14 22:14 [PATCH net 1/1] via-rhine: fix VLAN receive handling regression Francois Romieu
2015-10-15 7:24 ` Nick Alcock
@ 2015-10-16 8:02 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2015-10-16 8:02 UTC (permalink / raw)
To: romieu; +Cc: netdev, andrej, nix
From: Francois Romieu <romieu@fr•zoreil.com>
Date: Thu, 15 Oct 2015 00:14:37 +0200
> From: Andrej Ota <andrej@ota•si>
>
> Because eth_type_trans() consumes ethernet header worth of bytes, a call
> to read TCI from end of packet using rhine_rx_vlan_tag() no longer works
> as it's reading from an invalid offset.
>
> Tested to be working on PCEngines Alix board.
>
> Fixes: 810f19bcb862 ("via-rhine: add consistent memory barrier in vlan receive code.")
> Signed-off-by: Andrej Ota <andrej@ota•si>
> Acked-by: Francois Romieu <romieu@fr•zoreil.com>
Applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net] ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match
@ 2013-08-07 0:34 Hannes Frederic Sowa
2013-08-07 19:58 ` Teco Boot
0 siblings, 1 reply; 5+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-07 0:34 UTC (permalink / raw)
To: netdev; +Cc: teco, yoshfuji, equinox, boutier
In case a subtree did not match we currently stop backtracking and return
NULL (root table from fib_lookup). This could yield in invalid routing
table lookups when using subtrees.
Instead continue to backtrack until a valid subtree or node is found
and return this match.
Also remove unneeded NULL check.
Reported-by: Teco Boot <teco@inf-net•nl>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6•org>
Cc: David Lamparter <equinox@diac24•net>
Cc: <boutier@pps•univ-paris-diderot.fr>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion•org>
---
net/ipv6/ip6_fib.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index ed828d6..73db48e 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -993,14 +993,22 @@ static struct fib6_node * fib6_lookup_1(struct fib6_node *root,
if (ipv6_prefix_equal(&key->addr, args->addr, key->plen)) {
#ifdef CONFIG_IPV6_SUBTREES
- if (fn->subtree)
- fn = fib6_lookup_1(fn->subtree, args + 1);
+ if (fn->subtree) {
+ struct fib6_node *sfn;
+ sfn = fib6_lookup_1(fn->subtree,
+ args + 1);
+ if (!sfn)
+ goto backtrack;
+ fn = sfn;
+ }
#endif
- if (!fn || fn->fn_flags & RTN_RTINFO)
+ if (fn->fn_flags & RTN_RTINFO)
return fn;
}
}
-
+#ifdef CONFIG_IPV6_SUBTREES
+backtrack:
+#endif
if (fn->fn_flags & RTN_ROOT)
break;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net] ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match
2013-08-07 0:34 [PATCH net] ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match Hannes Frederic Sowa
@ 2013-08-07 19:58 ` Teco Boot
2015-12-02 9:55 ` [PATCH net 1/1] via-rhine: fix VLAN receive handling regression Teco Boot
0 siblings, 1 reply; 5+ messages in thread
From: Teco Boot @ 2013-08-07 19:58 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: netdev, yoshfuji, equinox, boutier
Seems to work!!
babe has one entry less than cafe, this is correct.
Tomorrow I'll test with real traffic.
Teco
root@ubuntu:~# ./ipv6-sadr.sh
this is my system:
Linux ubuntu 3.8.0-28-generic #41 SMP Wed Aug 7 11:36:10 PDT 2013 i686 i686 i686 GNU/Linux
CONFIG_IPV6_SUBTREES=y
... clean up for our experiment
... add a link-local
... add default
... add some source address specific defaults
====> now I have this routing table
default from 2001:db8:10::/48 via fe80::10 dev eth0 metric 1024
default from 2001:db8:11::/48 via fe80::11 dev eth0 metric 1024
default from 2001:db8:12::/48 via fe80::12 dev eth0 metric 1024
fe80::1 dev eth0 proto kernel metric 256
default via fe80::ff dev eth0 metric 1024
====> show route to same destination
2001:db8:babe::1 from 2001:db8:10::1 via fe80::10 dev eth0 src ::1 metric 0 \ cache
2001:db8:babe::1 from 2001:db8:11::1 via fe80::11 dev eth0 src ::1 metric 0 \ cache
2001:db8:babe::1 from 2001:db8:12::1 via fe80::12 dev eth0 src ::1 metric 0 \ cache
2001:db8:babe::1 from 2001:db8:1::1 via fe80::ff dev eth0 src ::1 metric 0 \ cache
2001:db8:babe::1 from :: via fe80::ff dev eth0 src ::1 metric 0 \ cache
====> show route to different destinations
2001:db8:cafe::10 from 2001:db8:10::1 via fe80::10 dev eth0 src ::1 metric 0 \ cache
2001:db8:cafe::11 from 2001:db8:11::1 via fe80::11 dev eth0 src ::1 metric 0 \ cache
2001:db8:cafe::12 from 2001:db8:12::1 via fe80::12 dev eth0 src ::1 metric 0 \ cache
2001:db8:cafe::21 from 2001:db8:1::1 via fe80::ff dev eth0 src ::1 metric 0 \ cache
2001:db8:cafe::22 from :: via fe80::ff dev eth0 src ::1 metric 0 \ cache
====> now the route cache is
2001:db8:babe::1 from 2001:db8:10::/48 via fe80::10 dev eth0 metric 0 \ cache
2001:db8:babe::1 from 2001:db8:11::/48 via fe80::11 dev eth0 metric 0 \ cache
2001:db8:babe::1 from 2001:db8:12::/48 via fe80::12 dev eth0 metric 0 \ cache
2001:db8:babe::1 via fe80::ff dev eth0 metric 0 \ cache
2001:db8:cafe::10 from 2001:db8:10::/48 via fe80::10 dev eth0 metric 0 \ cache
2001:db8:cafe::11 from 2001:db8:11::/48 via fe80::11 dev eth0 metric 0 \ cache
2001:db8:cafe::12 from 2001:db8:12::/48 via fe80::12 dev eth0 metric 0 \ cache
2001:db8:cafe::21 via fe80::ff dev eth0 metric 0 \ cache
2001:db8:cafe::22 via fe80::ff dev eth0 metric 0 \ cache
root@ubuntu:~#
Op 7 aug. 2013, om 02:34 heeft Hannes Frederic Sowa <hannes@stressinduktion•org> het volgende geschreven:
> In case a subtree did not match we currently stop backtracking and return
> NULL (root table from fib_lookup). This could yield in invalid routing
> table lookups when using subtrees.
>
> Instead continue to backtrack until a valid subtree or node is found
> and return this match.
>
> Also remove unneeded NULL check.
>
> Reported-by: Teco Boot <teco@inf-net•nl>
> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6•org>
> Cc: David Lamparter <equinox@diac24•net>
> Cc: <boutier@pps•univ-paris-diderot.fr>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion•org>
> ---
> net/ipv6/ip6_fib.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> index ed828d6..73db48e 100644
> --- a/net/ipv6/ip6_fib.c
> +++ b/net/ipv6/ip6_fib.c
> @@ -993,14 +993,22 @@ static struct fib6_node * fib6_lookup_1(struct fib6_node *root,
>
> if (ipv6_prefix_equal(&key->addr, args->addr, key->plen)) {
> #ifdef CONFIG_IPV6_SUBTREES
> - if (fn->subtree)
> - fn = fib6_lookup_1(fn->subtree, args + 1);
> + if (fn->subtree) {
> + struct fib6_node *sfn;
> + sfn = fib6_lookup_1(fn->subtree,
> + args + 1);
> + if (!sfn)
> + goto backtrack;
> + fn = sfn;
> + }
> #endif
> - if (!fn || fn->fn_flags & RTN_RTINFO)
> + if (fn->fn_flags & RTN_RTINFO)
> return fn;
> }
> }
> -
> +#ifdef CONFIG_IPV6_SUBTREES
> +backtrack:
> +#endif
> if (fn->fn_flags & RTN_ROOT)
> break;
>
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net 1/1] via-rhine: fix VLAN receive handling regression.
2013-08-07 19:58 ` Teco Boot
@ 2015-12-02 9:55 ` Teco Boot
2015-12-03 20:11 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Teco Boot @ 2015-12-02 9:55 UTC (permalink / raw)
To: andrej, netdev
I faced this problem on 4.2.6, Debian Jessie, on PC Engines Alix6.
I applied the patch. It solved the problem.
Queue up for -stable?
Teco
>
> From: Francois Romieu <romieu@fr•zoreil.com>
> Date: Thu, 15 Oct 2015 00:14:37 +0200
>
> > From: Andrej Ota <andrej@ota•si>
> >
> > Because eth_type_trans() consumes ethernet header worth of bytes, a call
> > to read TCI from end of packet using rhine_rx_vlan_tag() no longer works
> > as it's reading from an invalid offset.
> >
> > Tested to be working on PCEngines Alix board.
> >
> > Fixes: 810f19bcb862 ("via-rhine: add consistent memory barrier in vlan receive code.")
> > Signed-off-by: Andrej Ota <andrej@ota•si>
> > Acked-by: Francois Romieu <romieu@fr•zoreil.com>
>
> Applied.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger•kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-12-03 20:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-14 22:14 [PATCH net 1/1] via-rhine: fix VLAN receive handling regression Francois Romieu
2015-10-15 7:24 ` Nick Alcock
2015-10-16 8:02 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2013-08-07 0:34 [PATCH net] ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match Hannes Frederic Sowa
2013-08-07 19:58 ` Teco Boot
2015-12-02 9:55 ` [PATCH net 1/1] via-rhine: fix VLAN receive handling regression Teco Boot
2015-12-03 20:11 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox