On Sun, Jun 2, 2019 at 9:08 PM David Ahern wrote:
>
> From: David Ahern
>
> Add struct nexthop and nh_list list_head to fib6_info. nh_list is the
> fib6_info side of the nexthop <-> fib_info relationship. Since a fib6_info
> referencing a nexthop object can not have 'sibling' entries (the old way
On Mon, Jun 3, 2019 at 1:42 PM David Ahern wrote:
>
> On 6/3/19 12:09 PM, Wei Wang wrote:
> >> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> >> index fada5a13bcb2..51cb5cb027ae 100644
> >> --- a/net/ipv6/route.c
> >> +++ b/net/ipv6/route.c
> &
On Mon, Jun 3, 2019 at 3:35 PM David Ahern wrote:
>
> On 6/3/19 3:58 PM, Wei Wang wrote:
> > Hmm... I am still a bit concerned with the ip6_create_rt_rcu() call.
> > If we have a blackholed nexthop, the lookup code here always tries to
> > create an rt cache entry for ev
On Mon, Jun 3, 2019 at 4:18 PM David Ahern wrote:
>
> On 6/3/19 5:05 PM, Wei Wang wrote:
> > On Mon, Jun 3, 2019 at 3:35 PM David Ahern wrote:
> >>
> >> On 6/3/19 3:58 PM, Wei Wang wrote:
> >>> Hmm... I am still a bit concerned with the ip6_create_rt
On Tue, Jun 4, 2019 at 2:13 PM David Ahern wrote:
>
> On 6/4/19 3:06 PM, Martin Lau wrote:
> > On Tue, Jun 04, 2019 at 02:17:28PM -0600, David Ahern wrote:
> >> On 6/3/19 11:29 PM, Martin Lau wrote:
> >>> On Mon, Jun 03, 2019 at 07:36:06PM -0600, David Ahern wrote:
> On 6/3/19 6:58 PM, Martin
On Fri, Jun 7, 2019 at 8:09 AM David Ahern wrote:
>
> From: David Ahern
>
> Add a hook in rt6_flush_exceptions, rt6_remove_exception_rt,
> rt6_update_exception_stamp_rt, and rt6_age_exceptions to handle
> nexthop struct in a fib6_info.
>
> Signed-off-by: David Ahern
> ---
> net/ipv6/route.c | 1
On Fri, Jun 7, 2019 at 4:06 PM David Ahern wrote:
>
> From: David Ahern
>
> Use nexthop_for_each_fib6_nh and fib6_nh_find_match to find the
> fib6_nh in a nexthop that correlates to the device and gateway
> in the rt6_info.
>
> Signed-off-by: David Ahern
> ---
> net/ipv6/route.c | 20 ++
| 31 +-
> net/ipv6/route.c | 458
> +++--
> .../selftests/net/fib_nexthop_multiprefix.sh | 290 +
> .../selftests/net/forwarding/router_mpath_nh.sh| 359 ++++++++
> tools/testing/selftests/net/icmp_redirect.sh | 49 +++
> tools/testing/selftests/net/pmtu.sh| 237 ---
> 12 files changed, 1672 insertions(+), 113 deletions(-)
> create mode 100755 tools/testing/selftests/net/fib_nexthop_multiprefix.sh
> create mode 100755 tools/testing/selftests/net/forwarding/router_mpath_nh.sh
>
> --
> 2.11.0
>
For all ipv6 patches:
Reviewed-By: Wei Wang
y: Martin Zaharinov
Suggested-by: Jakub Kicinski
Signed-off-by: Wei Wang
Cc: Alexander Duyck
Cc: Eric Dumazet
Cc: Paolo Abeni
Cc: Hannes Frederic Sowa
---
include/linux/netdevice.h | 2 ++
net/core/dev.c| 14 +-
2 files changed, 15 insertions(+), 1 deletion(-)
d
From: Wei Wang
This patch specifically converts the rule lookup logic to honor this
flag and not release refcnt when traversing each rule and calling
lookup() on each routing table.
Similar to previous patch, we also need some special handling of dst
entries in uncached list because there is
From: Wei Wang
Ipv6 route lookup code always grabs refcnt on the dst for the caller.
But for certain cases, grabbing refcnt is not always necessary if the
call path is rcu protected and the caller does not cache the dst.
Another issue in the route lookup logic is:
When there are multiple custom
From: Wei Wang
This new flag is to instruct the route lookup function to not take
refcnt on the dst entry. The user which does route lookup with this flag
must properly use rcu protection.
ip6_pol_route() is the major route lookup function for both tx and rx
path.
In this function:
Do not take
From: Wei Wang
ip6_route_input() is the key function to do the route lookup in the
rx data path. All the callers to this function are already holding rcu
lock. So it is fairly easy to convert it to not take refcnt on the dst:
We pass in flag RT6_LOOKUP_F_DST_NOREF and do skb_dst_set_noref
From: Wei Wang
Initialize rt6->rt6i_uncached on the following pre-allocated dsts:
net->ipv6.ip6_null_entry
net->ipv6.ip6_prohibit_entry
net->ipv6.ip6_blk_hole_entry
This is a preparation patch for later commits to be able to distinguish
dst entries in uncached list by doing:
!li
From: Wei Wang
For tx path, in most cases, we still have to take refcnt on the dst
cause the caller is caching the dst somewhere. But it still is
beneficial to make use of RT6_LOOKUP_F_DST_NOREF flag while doing the
route lookup. It is cause this flag prevents manipulating refcnt on
net->i
On Wed, Jun 19, 2019 at 9:07 AM David Miller wrote:
>
> From: Wei Wang
> Date: Tue, 18 Jun 2019 11:25:41 -0700
>
> > @@ -237,13 +240,16 @@ static int __fib6_rule_action(struct fib_rule *rule,
> > struct flowi *flp,
> > goto out;
> >
From: Wei Wang
Initialize rt6->rt6i_uncached on the following pre-allocated dsts:
net->ipv6.ip6_null_entry
net->ipv6.ip6_prohibit_entry
net->ipv6.ip6_blk_hole_entry
This is a preparation patch for later commits to be able to distinguish
dst entries in uncached list by doing:
!li
From: Wei Wang
ip6_route_input() is the key function to do the route lookup in the
rx data path. All the callers to this function are already holding rcu
lock. So it is fairly easy to convert it to not take refcnt on the dst:
We pass in flag RT6_LOOKUP_F_DST_NOREF and do skb_dst_set_noref
From: Wei Wang
This patch specifically converts the rule lookup logic to honor this
flag and not release refcnt when traversing each rule and calling
lookup() on each routing table.
Similar to previous patch, we also need some special handling of dst
entries in uncached list because there is
From: Wei Wang
For tx path, in most cases, we still have to take refcnt on the dst
cause the caller is caching the dst somewhere. But it still is
beneficial to make use of RT6_LOOKUP_F_DST_NOREF flag while doing the
route lookup. It is cause this flag prevents manipulating refcnt on
net->i
From: Wei Wang
This new flag is to instruct the route lookup function to not take
refcnt on the dst entry. The user which does route lookup with this flag
must properly use rcu protection.
ip6_pol_route() is the major route lookup function for both tx and rx
path.
In this function:
Do not take
From: Wei Wang
Ipv6 route lookup code always grabs refcnt on the dst for the caller.
But for certain cases, grabbing refcnt is not always necessary if the
call path is rcu protected and the caller does not cache the dst.
Another issue in the route lookup logic is:
When there are multiple custom
On Wed, Jun 19, 2019 at 4:12 PM David Ahern wrote:
>
> On 6/19/19 4:31 PM, Wei Wang wrote:
> > diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
> > index bcfae13409b5..d22b6c140f23 100644
> > --- a/net/ipv6/fib6_rules.c
> > +++ b/net/ipv6/fib6_rules.c
&g
On Wed, Jun 19, 2019 at 4:21 PM David Ahern wrote:
>
> On 6/19/19 4:31 PM, Wei Wang wrote:
> > diff --git a/include/net/l3mdev.h b/include/net/l3mdev.h
> > index e942372b077b..d8c37317bb86 100644
> > --- a/include/net/l3mdev.h
> > +++ b/include/net/l3mdev.h
> >
On Thu, Jun 20, 2019 at 12:05 PM David Ahern wrote:
>
> From: David Ahern
>
> Gateway validation does not need a dst_entry, it only needs the fib
> entry to validate the gateway resolution and egress device. So,
> convert ip6_nh_lookup_table from ip6_pol_route to fib6_table_lookup
> and ip6_route
From: Wei Wang
For tx path, in most cases, we still have to take refcnt on the dst
cause the caller is caching the dst somewhere. But it still is
beneficial to make use of RT6_LOOKUP_F_DST_NOREF flag while doing the
route lookup. It is cause this flag prevents manipulating refcnt on
net->i
From: Wei Wang
Ipv6 route lookup code always grabs refcnt on the dst for the caller.
But for certain cases, grabbing refcnt is not always necessary if the
call path is rcu protected and the caller does not cache the dst.
Another issue in the route lookup logic is:
When there are multiple custom
From: Wei Wang
This new flag is to instruct the route lookup function to not take
refcnt on the dst entry. The user which does route lookup with this flag
must properly use rcu protection.
ip6_pol_route() is the major route lookup function for both tx and rx
path.
In this function:
Do not take
From: Wei Wang
ip6_route_input() is the key function to do the route lookup in the
rx data path. All the callers to this function are already holding rcu
lock. So it is fairly easy to convert it to not take refcnt on the dst:
We pass in flag RT6_LOOKUP_F_DST_NOREF and do skb_dst_set_noref
From: Wei Wang
Initialize rt6->rt6i_uncached on the following pre-allocated dsts:
net->ipv6.ip6_null_entry
net->ipv6.ip6_prohibit_entry
net->ipv6.ip6_blk_hole_entry
This is a preparation patch for later commits to be able to distinguish
dst entries in uncached list by doing:
!li
From: Wei Wang
This patch specifically converts the rule lookup logic to honor this
flag and not release refcnt when traversing each rule and calling
lookup() on each routing table.
Similar to previous patch, we also need some special handling of dst
entries in uncached list because there is
fib-onlink-tests.sh and fib_tests.sh are used to
> verify the changes.
>
> Signed-off-by: David Ahern
Reviewed-by: Wei Wang
> ---
> v2
> - use in6_dev_get versus __in6_dev_get + in6_dev_hold (comment from Wei)
> - updated commit message
>
> net/ipv6/route.c | 118
&g
From: Wei Wang
In tcp_select_initial_window(), we only set rcv_wnd to
tcp_default_init_rwnd() if current mss > (1 << wscale). Otherwise,
rcv_wnd is kept at the full receive space of the socket which is a
value way larger than tcp_default_init_rwnd().
With larger initial rcv_wnd value
_call_chain+0x2d/0x40 kernel/notifier.c:401
> call_netdevice_notifiers_info+0x32/0x70 net/core/dev.c:1707
> call_netdevice_notifiers net/core/dev.c:1725 [inline]
> __dev_notify_flags+0x262/0x430 net/core/dev.c:6960
> dev_change_flags+0xf5/0x140 net/core/dev.c:6994
> devinet_ioc
From: Wei Wang
syzcaller reported the following use-after-free issue in rt6_select():
BUG: KASAN: use-after-free in rt6_select net/ipv6/route.c:755 [inline] at addr
8800bc6994e8
BUG: KASAN: use-after-free in ip6_pol_route.isra.46+0x1429/0x1470
net/ipv6/route.c:1084 at addr 8800bc6994e8
From: Wei Wang
In fib6_add(), it is possible that fib6_add_1() picks an intermediate
node and sets the node's fn->leaf to NULL in order to add this new
route. However, if fib6_add_rt2node() fails to add the new
route for some reason, fn->leaf will be left as NULL and could
potent
From: Wei Wang
We currently keep rt->rt6i_node pointing to the fib6_node for the route.
And some functions make use of this pointer to dereference the fib6_node
from rt structure, e.g. rt6_check(). However, as there is neither
refcount nor rcu taken when dereferencing rt->rt6i_node, it
>> + return status;
>> +
> extra newline.
>
Thanks. Will remove it in v2.
Wei
On Fri, Aug 18, 2017 at 7:20 PM, Martin KaFai Lau wrote:
> On Fri, Aug 18, 2017 at 05:36:55PM -0700, Wei Wang wrote:
>> From: Wei Wang
>>
>> We currently keep rt->r
From: Wei Wang
We currently keep rt->rt6i_node pointing to the fib6_node for the route.
And some functions make use of this pointer to dereference the fib6_node
from rt structure, e.g. rt6_check(). However, as there is neither
refcount nor rcu taken when dereferencing rt->rt6i_node, it
e my change and resubmit.
Sorry for the confusion.
Thanks.
Wei
On Sun, Aug 20, 2017 at 7:59 PM, David Miller wrote:
> From: Wei Wang
> Date: Sat, 19 Aug 2017 17:34:08 -0700
>
>> From: Wei Wang
>>
>> We currently keep rt->rt6i_node pointing to the fib6_node for the
From: Wei Wang
We currently keep rt->rt6i_node pointing to the fib6_node for the route.
And some functions make use of this pointer to dereference the fib6_node
from rt structure, e.g. rt6_check(). However, as there is neither
refcount nor rcu taken when dereferencing rt->rt6i_node, it
te the dst_hold performed by xfrm_lookup
> when a per-socket policy is in use. This means that when a
> socket policy is in use, dst entries returned by xfrm_lookup have
> a refcount of 2, and are not freed when no longer in use.
>
> Cc: Wei Wang
> Fixes: 52df157f17 ("xfrm: take re
From: Wei Wang
Commit c5cff8561d2d adds rcu grace period before freeing fib6_node. This
generates a new sparse warning on rt->rt6i_node related code:
net/ipv6/route.c:1394:30: error: incompatible types in comparison
expression (different address spaces)
./include/net/ip6_fib.h:187
On Mon, Mar 18, 2019 at 12:48 PM David Ahern wrote:
>
> On 3/18/19 12:36 PM, Xin Long wrote:
> > diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> > index 4ef4bbd..754777d 100644
> > --- a/net/ipv6/route.c
> > +++ b/net/ipv6/route.c
> > @@ -1040,13 +1040,17 @@ static struct rt6_info *ip6_create_r
>
> So we fix it by simply making ip6_create_rt_rcu() return ip6_null_entry
> instead of NULL.
>
> v1->v2:
> - move down 'fallback:' to make it more readable.
>
> Fixes: e873e4b9cc7e ("ipv6: use fib6_info_hold_safe() when necessary")
> Reported-by:
On Wed, Mar 20, 2019 at 9:24 AM David Ahern wrote:
>
> From: David Ahern
>
> net and null_fallback are redundant. Remove null_fallback in favor of
> !net check.
>
> Signed-off-by: David Ahern
> ---
Acked-by: Wei Wang
> net/ipv6/route.c | 13 ++---
>
On Wed, Mar 20, 2019 at 12:03 PM Julian Wiedmann wrote:
>
> Get rid of some obsolete gc-related documentation and macros that were
> missed in commit 5b7c9a8ff828 ("net: remove dst gc related code").
>
> CC: Wei Wang
> Signed-off-by: Julian Wiedmann
> ---
Acked-b
c R09: 0004c0d1
> R10: 02341940 R11: 000000000246 R12:
> R13: 7ffeafc2a7f0 R14: 0004c065 R15: 7ffeafc2a800
>
> Fixes: a68886a69180 ("net/ipv6: Make from in rt6_info rcu protected")
> Signed-off-by: Eric
king is also needed on rt->from for a similar reason.
>Note that inet6_rtm_getroute() is using RTNL_FLAG_DOIT_UNLOCKED.
>
> Fixes: a68886a69180 ("net/ipv6: Make from in rt6_info rcu protected")
> Signed-off-by: Martin KaFai Lau
> ---
Acked-by: Wei Wang
Nice fix. Tha
Thanks Mikael for reporting this issue. And thanks David for the bisection.
Let me spend some time to reproduce it and see what is going on.
From: David Ahern
Date: Mon, May 13, 2019 at 8:35 PM
To: Mikael Magnusson, , Martin KaFai Lau, Wei Wang
> On 5/13/19 1:22 PM, Mikael Magnusson wr
#endif
}
Why do we need to check that the route is not gateway and has next hop
for updating rt6i_src? I checked the git history and it seems this
part was there from very early on (with some refactor in between)...
From: Stefano Brivio
Date: Tue, May 14, 2019 at 7:33 AM
To: Mikael Mag
From: Wei Wang
When inserting route cache into the exception table, the key is
generated with both src_addr and dest_addr with src addr routing.
However, current logic always assumes the src_addr used to generate the
key is a /128 host address. This is not true in the following scenarios:
1
)
calls rt6_find_cached_rt() to find the cached route first. And
rt6_find_cached_rt() is taken care of to find the cached route
according to both passed in src addr and f6i->fib6_src.
So I think we are good here.
From: David Ahern
Date: Wed, May 15, 2019 at 9:38 AM
To: Wei Wang, David Miller,
From: Wei Wang
Date: Wed, May 15, 2019 at 10:25 AM
To: David Ahern
Cc: Wei Wang, David Miller, Linux Kernel Network Developers, Martin
KaFai Lau, Mikael Magnusson, Eric Dumazet
> >
> > What about rt6_remove_exception_rt?
> >
> > You can add a 'cache' hook to
From: David Ahern
Date: Wed, May 15, 2019 at 10:33 AM
To: Wei Wang
Cc: Wei Wang, David Miller, Linux Kernel Network Developers, Martin
KaFai Lau, Mikael Magnusson, Eric Dumazet
> On 5/15/19 11:28 AM, Wei Wang wrote:
> > From: Wei Wang
> > Date: Wed, May 15, 2019 at 10:25 AM
>
On Wed, May 15, 2019 at 11:06 AM Martin Lau wrote:
>
> On Tue, May 14, 2019 at 12:33:25PM -0700, Wei Wang wrote:
> > I think the bug is because when creating exceptions, src_addr is not
> > always set even though fib6_info is in the subtree. (because of
> > rt6_is
On Wed, May 15, 2019 at 2:51 PM Martin Lau wrote:
>
> On Tue, May 14, 2019 at 05:46:10PM -0700, Wei Wang wrote:
> > From: Wei Wang
> >
> > When inserting route cache into the exception table, the key is
> > generated with both src_addr and dest_addr with src addr
>
> I decided to add another boolean (fib6_destroying) instead
> of reusing/renaming exception_bucket_flushed to ease stable backports,
> and properly document the memory barriers used to implement this fix.
>
> This patch has been co-developped with Wei Wang.
>
> Fixes: 93531c674315 (&
On Wed, May 15, 2019 at 5:07 PM David Ahern wrote:
>
> On 5/15/19 6:03 PM, Wei Wang wrote:
> > Thanks Martin.
> > Changing __rt6_find_exception_xxx() might not be easy cause other
> > callers of this function does not really need to back off and use
> > another sa
From: Wei Wang
When inserting route cache into the exception table, the key is
generated with both src_addr and dest_addr with src addr routing.
However, current logic always assumes the src_addr used to generate the
key is a /128 host address. This is not true in the following scenarios:
1
On Thu, May 16, 2019 at 12:15 PM Martin Lau wrote:
>
> On Thu, May 16, 2019 at 11:16:20AM -0700, Wei Wang wrote:
> > From: Wei Wang
> >
> > When inserting route cache into the exception table, the key is
> > generated with both src_addr and dest_addr with src addr
From: Wei Wang
When inserting route cache into the exception table, the key is
generated with both src_addr and dest_addr with src addr routing.
However, current logic always assumes the src_addr used to generate the
key is a /128 host address. This is not true in the following scenarios:
1
From: Wei Wang
If we move all cached dst into the exception table under the main route,
current rt6_mtu_change() will no longer be able to access them.
This commit makes rt6_mtu_change_route() function to also go through all
cached routes in the exception table under the main route and do proper
From: Wei Wang
fib6_locate() is used to find the fib6_node according to the passed in
prefix address key. It currently tries to find the fib6_node with the
exact match of the passed in key. However, when we move cached routes
into the exception table, fib6_locate() will fail to find the
From: Wei Wang
Currently, fib6 table is protected by rwlock. During route lookup,
reader lock is taken and during route insertion, deletion or
modification, writer lock is taken. This is a very inefficient
implementation because the fastpath always has to do the operation
to grab the reader lock
From: Wei Wang
Add a hash table into struct rt6_info in order to store dst caches
created by pmtu discovery and ip redirect in ipv6 routing code.
APIs to add dst cache, delete dst cache, find dst cache and update
dst cache in the hash table are implemented and will be used in later
commits.
This
From: Wei Wang
fib6_add() logic currently calls fib6_add_1() to figure out what node
should be used for the newly added route and then call
fib6_add_rt2node() to insert the route to the node.
And during the call of fib6_add_1(), fn_sernum is updated for all nodes
that share the same prefix as
From: Wei Wang
After rwlock is replaced with rcu and spinlock, fib6_lookup() could
potentially return an intermediate node if other thread is doing
fib6_del() on a route which is the only route on the node so that
fib6_repair_tree() will be called on this node and potentially assigns
fn->leaf
From: Wei Wang
This commit makes use of the exception hash table implementation to
store dst caches created by pmtu discovery and ip redirect into the hash
table under the rt_info and no longer inserts these routes into fib6
tree.
This makes the fib6 tree only contain static configured routes
From: Wei Wang
Currently, most of the rt6_stats are not hooked up correctly. As the
last part of this patch series, hook up all existing rt6_stats and add
one new stat fib_rt_uncache to indicate the number of routes in the
uncached list.
For details of the stats, please refer to the comments
From: Wei Wang
If rwlock is replaced with rcu and spinlock, it is possible that the
reader thread will see fn->leaf as NULL in the following scenarios:
1. fib6_add() is in progress and we have already inserted a new node but
not yet inserted the route.
2. fib6_del_route() is in progress and
From: Wei Wang
With all the preparation work before, we are now ready to replace rwlock
with rcu and spinlock in fib6_table.
That means now all fib6_node in fib6_table are protected by rcu. And
when freeing fib6_node, call_rcu() is used to wait for the rcu grace
period before releasing the
From: Wei Wang
After rwlock is replaced with rcu and spinlock, ip6_pol_route() will be
called with only rcu held. That means rt6 route deletion could happen
simultaneously with rt6_make_pcpu_rt(). This could potentially cause
memory leak if rt6_release() is called right before rt6_make_pcpu_rt
From: Wei Wang
After rwlock is replaced with rcu and spinlock, route lookup can happen
simultanously with route deletion.
This patch removes the call to free_percpu(rt->rt6i_pcpu) from
rt6_release() to avoid the race condition between rt6_release() and
rt6_get_pcpu_route(). And as free_percpu
From: Wei Wang
After we move cached dst entries into the exception table under its
parent route, current fib6_remove_prefsrc() no longer can access them.
This commit makes fib6_remove_prefsrc() also go through all routes
in the exception table to remove the pref src.
This is a preparation patch
From: Wei Wang
If we move all cached dst into the exception table under the main route,
current rt6_clean_tohost() will no longer be able to access them.
This commit makes fib6_clean_tohost() to also go through all cached
routes in exception table and removes cached gateway routes to the
passed
From: Wei Wang
This function takes a route as input and tries to update the sernum in
the fib6_node this route is associated with. It will be used in later
commit when adding a cached route into the exception table under that
route.
Signed-off-by: Wei Wang
Signed-off-by: Martin KaFai Lau
From: Wei Wang
If all dst cache entries are stored in the exception table under the
main route, we have to go through them during fib6_age() when doing
garbage collecting.
Introduce a new function rt6_age_exception() which goes through all dst
entries in the exception table and remove those
From: Wei Wang
With rwlock, it is safe to call dst_hold() in the read thread because
read thread is guaranteed to be separated from write thread.
However, after we replace rwlock with rcu, it is no longer safe to use
dst_hold(). A dst might already have been deleted but is waiting for the
rcu
On Fri, Oct 6, 2017 at 4:57 PM, 吉藤英明 wrote:
> Hi,
>
> 2017-10-07 4:06 GMT+09:00 Wei Wang :
>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
>> index 941c062389d2..aeb349aea429 100644
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
> :
>&g
From: Wei Wang
This patch replaces rcu_deference() with rcu_dereference_bh() in
ipv6_route_seq_next() to avoid the following warning:
[ 19.431685] WARNING: suspicious RCU usage
[ 19.433451] 4.14.0-rc3-00914-g66f5d6c #118 Not tainted
[ 19.435509] -
[ 19.437267
er suspect to me. I
>> believe this is fixed by using & instead to just check the
>> RTF_CACHE entry bit.
> Good catch. LGTM. If rt does not have RTF_CACHE set, it should not be in the
> exception table.
>
> Acked-by: Martin KaFai Lau
>
Thanks a lot for catching this
1457734, #1457747 ("Wrong operator used")
>
> Fixes: 35732d01fe31 ("ipv6: introduce a hash table to store dst cache")
> Signed-off-by: Colin Ian King
> ---
Acked-by: Wei Wang
> net/ipv6/route.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(
From: Wei Wang
In fib6_locate(), we need to first make sure fn is not NULL before doing
FIB6_SUBTREE(fn) to avoid crash.
This fixes the following static checker warning:
net/ipv6/ip6_fib.c:1462 fib6_locate()
warn: variable dereferenced before check 'fn' (see line 1459)
From: Wei Wang
In order to not dirty the cacheline too often, we try to only update
dst->__use and dst->lastusetime at most once per jiffy.
As dst->lastusetime is only used by ipv6 garbage collector, it should
be good enough time resolution.
And __use is only used in ipv6_route_seq_
On Tue, Oct 17, 2017 at 10:40 AM, Paolo Abeni wrote:
> After the commit 2b760fcf5cfb ("ipv6: hook up exception table to
> store dst cache"), entries in the routing cache are not shown by:
>
> ip route show cache
>
> because the per route exception table containing such routes is not
> traversed by
timer will run for whatever time needed to properly
> clean the table.
>
> Fixes: 2b760fcf5cfb ("ipv6: hook up exception table to store dst cache")
> Signed-off-by: Paolo Abeni
> ---
Acked-by: Wei Wang
Totally true. Thanks for catching this.
> net/ipv6/route.c | 4 +
On Tue, Oct 17, 2017 at 10:40 AM, Paolo Abeni wrote:
> The commit 2b760fcf5cfb ("ipv6: hook up exception table to store
> dst cache") partially reverted 1e2ea8ad37be ("ipv6: set
> dst.obsolete when a cached route has expired").
>
> This change brings back the dst obsoleting and push it a step
> fa
On Tue, Oct 17, 2017 at 1:02 PM, Paolo Abeni wrote:
> On Tue, 2017-10-17 at 11:58 -0700, Wei Wang wrote:
>> On Tue, Oct 17, 2017 at 10:40 AM, Paolo Abeni wrote:
>> > The commit 2b760fcf5cfb ("ipv6: hook up exception table to store
>> > dst cache") partia
From: Wei Wang
When receiving multiple packets with the same ts ecr value, only try
to compute rcv_rtt sample with the earliest received packet.
This is because the rcv_rtt calculated by later received packets
could possibly include long idle time or other types of delay.
For example:
(1) server
On Sun, Feb 25, 2018 at 11:47 AM, David Ahern wrote:
> Introduce fib6_nh structure and move nexthop related data from
> rt6_info and rt6_info.dst to fib6_nh. References to dev, gateway or
> lwtstate from a FIB lookup perspective are converted to use fib6_nh;
> datapath references to dst version ar
On Sun, Feb 25, 2018 at 11:47 AM, David Ahern wrote:
> Add expires to rt6_info for FIB entries, and add fib6 helpers to
> manage it. Data path use of dst.expires remains.
>
> Signed-off-by: David Ahern
> ---
> include/net/ip6_fib.h | 26 +-
> net/ipv6/addrconf.c | 6 ++
On Sun, Feb 25, 2018 at 11:47 AM, David Ahern wrote:
> IPv6 FIB will only contain FIB entries with exception routes added to
> the FIB entry. Remove CACHE and dst checks from fib6 add and delete since
> they can never happen once the data type changes.
>
> Fixup the lookup functions to use a f6i n
On Mon, Feb 26, 2018 at 2:47 PM, David Ahern wrote:
> On 2/26/18 3:28 PM, Wei Wang wrote:
>> On Sun, Feb 25, 2018 at 11:47 AM, David Ahern wrote:
>>> Introduce fib6_nh structure and move nexthop related data from
>>> rt6_info and rt6_info.dst to fib6_nh. Re
On Mon, Feb 26, 2018 at 2:55 PM, David Ahern wrote:
> On 2/26/18 3:28 PM, Wei Wang wrote:
>>> @@ -213,11 +234,6 @@ static inline void rt6_set_expires(struct rt6_info
>>> *rt, unsigned long expires)
>>>
>>> static inline void rt6_update_ex
On Mon, Feb 26, 2018 at 3:02 PM, David Ahern wrote:
> On 2/26/18 3:29 PM, Wei Wang wrote:
>> On Sun, Feb 25, 2018 at 11:47 AM, David Ahern wrote:
>>> IPv6 FIB will only contain FIB entries with exception routes added to
>>> the FIB entry. Remove CACHE and dst chec
>> This is why I suggested to replace the BUG() in another mail
>>
>> So :
>>
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index
>> f535779d9dc1dfe36934c2abba4e43d053ac5d6f..220cd12456754876edf2d3ef13195e82d70d5c74
>> 100644
>> --- a/include/linux/netdevice.h
>> +++ b/in
>>> bisected again and same result:
>>> b838d5e1c5b6e57b10ec8af2268824041e3ea911 is the first bad commit
>>> commit b838d5e1c5b6e57b10ec8af2268824041e3ea911
>>> Author: Wei Wang
>>> Date: Sat Jun 17 10:42:32 2017 -0700
>>>
>>&g
,7 +271,7 @@ static inline void dst_use_noref(struct dst_entry
*dst, unsigned long time)
static inline struct dst_entry *dst_clone(struct dst_entry *dst)
{
if (dst)
- atomic_inc(&dst->__refcnt);
+ dst_hold(dst);
return dst;
}
Thanks.
We
up to commit 44ebe79149ff ("net: add debug
> atomic_inc_not_zero() in dst_hold()")
>
> In net-next we will convert dst atomic_t to refcount_t for peace of
> mind.
>
> Fixes: a4c2fd7f7891 ("net: remove DST_NOCACHE flag")
> Signed-off-by: Eric Dumazet
> Cc
1 - 100 of 275 matches
Mail list logo