[bpf-next v1 4/9] net/ipv6: Refactor fib6_rule_action

2018-05-02 Thread David Ahern
Move source address lookup from fib6_rule_action to a helper. It will be used in a later patch by a second variant for fib6_rule_action. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/fib6_rules.c | 52 ++- 1 file chang

[bpf-next v1 1/9] net/ipv6: Rename fib6_lookup to fib6_node_lookup

2018-05-02 Thread David Ahern
Rename fib6_lookup to fib6_node_lookup to better reflect what it returns. The fib6_lookup name will be used in a later patch for an IPv6 equivalent to IPv4's fib_lookup. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 6 +++--- net/ipv6/ip6_fib.c

Re: [PATCH net] ipv4: fix fnhe usage by non-cached routes

2018-05-02 Thread David Ahern
d this is done in the fast path vs gc time. (the existing code does as well; your change is only moving the call to make the input and output paths the same) The change looks correct to me and all of my functional tests passed. Acked-by: David Ahern <dsah...@gmail.com>

Re: [PATCH net-next 1/4] ipv6: Calculate hash thresholds for IPv6 nexthops

2018-05-02 Thread David Ahern
On 5/2/18 2:48 PM, Thomas Winter wrote: > Should I look at reworking this? It would be great to have these ECMP routes > for other purposes. Looking at my IPv6 bug list this change is on it -- allowing ECMP routes to have a device only hop. Let me take a look at it at the same time as a few

Re: [PATCH net-next 1/4] ipv6: Calculate hash thresholds for IPv6 nexthops

2018-05-02 Thread David Ahern
On 5/2/18 12:53 PM, Ido Schimmel wrote: > > So this fixes the issue for me. To reproduce: > > # ip -6 address add 2001:db8::1/64 dev dummy0 > # ip -6 address add 2001:db8::1/64 dev dummy1 > > This reproduces the issue because due to above commit both local routes > are considered siblings... :/

Re: [RFC v2 bpf-next 9/9] samples/bpf: Add examples of ipv4 and ipv6 forwarding in XDP

2018-05-02 Thread David Ahern
On 5/2/18 5:13 AM, Jesper Dangaard Brouer wrote: > > On Sun, 29 Apr 2018 11:07:52 -0700 David Ahern <dsah...@gmail.com> wrote: > >> +/* verify egress index has xdp support */ >> +// TO-DO bpf_map_lookup_elem(_port, ) fails with >> +//

Re: [RFC v2 bpf-next 8/9] bpf: Provide helper to do lookups in kernel FIB table

2018-05-02 Thread David Ahern
On 5/2/18 5:27 AM, Jesper Dangaard Brouer wrote: > On Sun, 29 Apr 2018 11:07:51 -0700 > David Ahern <dsah...@gmail.com> wrote: > >> Initial performance numbers collected by Jesper, forwarded packets/sec: >> >>Full stackXDP FIB lookupXDP

Re: [PATCH net-next v2 2/2] mlxsw: spectrum_router: Return an error for routes added after abort

2018-05-02 Thread David Ahern
break; > + case FIB_EVENT_ENTRY_ADD: > + if (router->aborted) { > + NL_SET_ERR_MSG_MOD(info->extack, "FIB offload was > aborted. Not configuring route"); > + return notifier_from_errno(-EINVAL); > + } > + break; >

Re: [PATCH net-next v2 1/2] mlxsw: spectrum_router: Return an error for non-default FIB rules

2018-05-02 Thread David Ahern
ialization. > > Signed-off-by: Ido Schimmel <ido...@mellanox.com> > --- > drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > Acked-by: David Ahern <dsah...@gmail.com>

Re: [PATCH iproute2-next] Add tc-BPF example for a TCP pure ack recognizer

2018-05-02 Thread David Ahern
On 5/1/18 10:51 PM, Dave Taht wrote: > On Tue, May 1, 2018 at 9:12 PM, David Ahern <dsah...@gmail.com> wrote: >> On 5/1/18 12:32 PM, Dave Taht wrote: >>> ack_recognize can shift pure tcp acks into another flowid. >>> --- >&

Re: [PATCH RFC iproute2-next 1/2] rdma: update rdma_netlink.h to get provider attrs

2018-05-02 Thread David Ahern
On 4/30/18 8:36 AM, Steve Wise wrote: > Signed-off-by: Steve Wise > --- > rdma/include/uapi/rdma/rdma_netlink.h | 37 > ++- > 1 file changed, 36 insertions(+), 1 deletion(-) > > diff --git a/rdma/include/uapi/rdma/rdma_netlink.h >

Re: [PATCH iproute2-next] Add tc-BPF example for a TCP pure ack recognizer

2018-05-01 Thread David Ahern
On 5/1/18 12:32 PM, Dave Taht wrote: > ack_recognize can shift pure tcp acks into another flowid. > --- > examples/bpf/ack_recognize.c | 98 > > 1 file changed, 98 insertions(+) > create mode 100644 examples/bpf/ack_recognize.c > > diff --git

Re: [RFC v2 bpf-next 5/9] net/ipv6: Add fib6_lookup

2018-05-01 Thread David Ahern
On 5/1/18 12:15 PM, Vincent Bernat wrote: > ❦ 29 avril 2018 11:07 -0700, David Ahern <dsah...@gmail.com> : > >> +struct fib6_info *fib6_lookup(struct net *net, int oif, struct flowi6 *fl6, >> + int flags) > > Maybe an EXPORT_SYMBOL_GPL?

Re: [PATCH net-next 1/2] mlxsw: spectrum_router: Return an error for non-default FIB rules

2018-05-01 Thread David Ahern
On 5/1/18 2:16 AM, Ido Schimmel wrote: > Since commit 9776d32537d2 ("net: Move call_fib_rule_notifiers up in > fib_nl_newrule") it is possible to forbid the installation of > unsupported FIB rules. > > Have mlxsw return an error for non-default FIB rules in addition to the > existing extack

Re: [PATCH iproute2-master] iproute: Parse last nexthop in a multipath route

2018-05-01 Thread David Ahern
...@mellanox.com> > --- > ip/iproute.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Acked-by: David Ahern <dsah...@gmail.com>

Re: [PATCH] ipv6: Allow non-gateway ECMP for IPv6

2018-04-30 Thread David Ahern
edtelesis.co.nz> > Cc: David Ahern <dsah...@gmail.com> > Cc: "David S. Miller" <da...@davemloft.net> > Cc: Alexey Kuznetsov <kuz...@ms2.inr.ac.ru> > Cc: Hideaki YOSHIFUJI <yoshf...@linux-ipv6.org> > --- > include/net/ip6_route.h | 3 +-- >

Re: [PATCH bpf-next 2/3] bpf: fix formatting for bpf_get_stack() helper doc

2018-04-30 Thread David Ahern
On 4/30/18 9:08 AM, Alexei Starovoitov wrote: >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h >> index 530ff6588d8f..8daef7326bb7 100644 >> --- a/include/uapi/linux/bpf.h >> +++ b/include/uapi/linux/bpf.h >> @@ -1770,33 +1770,33 @@ union bpf_attr { >> * >> * int

Re: [RFC v2 bpf-next 8/9] bpf: Provide helper to do lookups in kernel FIB table

2018-04-29 Thread David Ahern
On 4/29/18 5:36 PM, Alexei Starovoitov wrote: >> +if (flags & BPF_FIB_LOOKUP_DIRECT) { >> +u32 tbid = l3mdev_fib_table_rcu(dev) ? : RT_TABLE_MAIN; >> +struct fib_table *tb; >> + >> +tb = fib_get_table(net, tbid); >> +if (unlikely(!tb)) >> +

[RFC v2 bpf-next 9/9] samples/bpf: Add examples of ipv4 and ipv6 forwarding in XDP

2018-04-29 Thread David Ahern
Signed-off-by: David Ahern <dsah...@gmail.com> --- samples/bpf/Makefile | 4 + samples/bpf/xdp_fwd_kern.c| 110 samples/bpf/xdp_fwd_user.c| 136 ++ tools/testing/selftests/bpf/bpf_hel

[RFC v2 bpf-next 1/9] net/ipv6: Rename fib6_lookup to fib6_node_lookup

2018-04-29 Thread David Ahern
Rename fib6_lookup to fib6_node_lookup to better reflect what it returns. The fib6_lookup name will be used in a later patch for an IPv6 equivalent to IPv4's fib_lookup. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 6 +++--- net/ipv6/ip6_fib.c

[RFC v2 bpf-next 8/9] bpf: Provide helper to do lookups in kernel FIB table

2018-04-29 Thread David Ahern
. Default is an ingress lookup. Initial performance numbers collected by Jesper, forwarded packets/sec: Full stackXDP FIB lookupXDP Direct lookup IPv4 1,947,969 7,074,156 7,415,333 IPv6 1,728,000 6,165,504 7,262,720 Signed-off-by: David Ahern <d

[RFC v2 bpf-next 4/9] net/ipv6: Refactor fib6_rule_action

2018-04-29 Thread David Ahern
Move source address lookup from fib6_rule_action to a helper. It will be used in a later patch by a second variant for fib6_rule_action. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/fib6_rules.c | 52 ++- 1 file chang

[RFC v2 bpf-next 3/9] net/ipv6: Extract table lookup from ip6_pol_route

2018-04-29 Thread David Ahern
-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 4 net/ipv6/route.c | 39 +-- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 80d76d8dc683..4f7b8f59ea6d

[RFC v2 bpf-next 2/9] net/ipv6: Rename rt6_multipath_select

2018-04-29 Thread David Ahern
Rename rt6_multipath_select to fib6_multipath_select and export it. A later patch wants access to it similar to IPv4's fib_select_path. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 5 + net/ipv6/route.c | 17 + 2 files chang

[RFC v2 bpf-next 7/9] net/ipv6: Add fib lookup stubs for use in bpf helper

2018-04-29 Thread David Ahern
Add stubs to retrieve a handle to an IPv6 FIB table, fib6_get_table, a stub to do a lookup in a specific table, fib6_table_lookup, and a stub for a full route lookup. The stubs are needed for core bpf code to handle the case when the IPv6 module is not builtin. Signed-off-by: David Ahern <d

[RFC v2 bpf-next 0/9] bpf: Add helper to do FIB lookups

2018-04-29 Thread David Ahern
into the kernel and ipv6 may not be built or loaded. Patch 8 adds the bpf helper and 9 adds a sample program. v2 - fixed use of foward helper from cls_act as noted by Daniel - in patch 1 rename fib6_lookup_1 as well for consistency David Ahern (9): net/ipv6: Rename fib6_lookup

[RFC v2 bpf-next 5/9] net/ipv6: Add fib6_lookup

2018-04-29 Thread David Ahern
. Caller must hold rcu lock as no reference is taken on the returned fib entry. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 6 net/ipv6/fib6_rules.c | 86 +-- net/ipv6/ip6_fib.c| 7 + 3 files chang

[RFC v2 bpf-next 6/9] net/ipv6: Update fib6 tracepoint to take fib6_info

2018-04-29 Thread David Ahern
Similar to IPv4, IPv6 should use the FIB lookup result in the tracepoint. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/trace/events/fib6.h | 14 +++--- net/ipv6/route.c| 14 ++ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/i

Re: ip6-in-ip{4,6} ipsec tunnel issues with 1280 MTU

2018-04-28 Thread David Ahern
On 4/27/18 9:44 AM, Ashwanth Goli wrote: > On 2018-04-27 20:18, David Ahern wrote: >> On 4/27/18 5:02 AM, Ashwanth Goli wrote: >>> On 2018-04-26 17:21, Paolo Abeni wrote: >>>> Hi, >>>> >>>> [fixed CC list] >>>> >>&

Re: [RFC bpf-next 8/9] bpf: Provide helper to do lookups in kernel FIB table

2018-04-27 Thread David Ahern
On 4/27/18 10:43 AM, Martin KaFai Lau wrote: >> +#if IS_ENABLED(CONFIG_IPV6) >> +static int bpf_ipv6_fib_lookup(struct xdp_buff *ctx, >> + struct bpf_fib_lookup *params, u32 flags) >> +{ >> +struct net *net = dev_net(ctx->rxq->dev); >> +struct neighbour *neigh; >>

Re: ip6-in-ip{4,6} ipsec tunnel issues with 1280 MTU

2018-04-27 Thread David Ahern
On 4/27/18 5:02 AM, Ashwanth Goli wrote: > On 2018-04-26 17:21, Paolo Abeni wrote: >> Hi, >> >> [fixed CC list] >> >> On Wed, 2018-04-25 at 21:43 +0530, Ashwanth Goli wrote: >>> Hi Pablo, >> >> Actually I'm Paolo, but yours is a recurring mistake ;) >> >>> I am noticing an issue similar to the one

Re: [RFC bpf-next 8/9] bpf: Provide helper to do lookups in kernel FIB table

2018-04-25 Thread David Ahern
On 4/25/18 1:55 PM, Daniel Borkmann wrote: >> @@ -3861,6 +4090,8 @@ sk_filter_func_proto(enum bpf_func_id func_id, const >> struct bpf_prog *prog) >> return _get_socket_cookie_proto; >> case BPF_FUNC_get_socket_uid: >> return _get_socket_uid_proto; >> +case

[RFC bpf-next 2/9] net/ipv6: Rename rt6_multipath_select

2018-04-25 Thread David Ahern
Rename rt6_multipath_select to fib6_multipath_select and export it. A later patch wants access to it similar to IPv4's fib_select_path. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 5 + net/ipv6/route.c | 17 + 2 files chang

[RFC bpf-next 6/9] net/ipv6: Update fib6 tracepoint to take fib6_info

2018-04-25 Thread David Ahern
Similar to IPv4, IPv6 should use the FIB lookup result in the tracepoint. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/trace/events/fib6.h | 14 +++--- net/ipv6/route.c| 14 ++ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/i

[RFC bpf-next 9/9] samples/bpf: Add examples of ipv4 and ipv6 forwarding in XDP

2018-04-25 Thread David Ahern
Signed-off-by: David Ahern <dsah...@gmail.com> --- samples/bpf/Makefile | 4 + samples/bpf/xdp_fwd_kern.c| 110 samples/bpf/xdp_fwd_user.c| 136 ++ tools/testing/selftests/bpf/bpf_hel

[RFC bpf-next 7/9] net/ipv6: Add fib lookup stubs for use in bpf helper

2018-04-25 Thread David Ahern
Add stubs to retrieve a handle to an IPv6 FIB table, fib6_get_table, a stub to do a lookup in a specific table, fib6_table_lookup, and a stub for a full route lookup. The stubs are needed for core bpf code to handle the case when the IPv6 module is not builtin. Signed-off-by: David Ahern <d

[RFC bpf-next 8/9] bpf: Provide helper to do lookups in kernel FIB table

2018-04-25 Thread David Ahern
. Default is an ingress lookup. Initial performance numbers collected by Jesper, forwarded packets/sec: Full stackXDP FIB lookupXDP Direct lookup IPv4 1,947,969 7,074,156 7,415,333 IPv6 1,728,000 6,165,504 7,262,720 Signed-off-by: David Ahern <d

[RFC bpf-next 3/9] net/ipv6: Extract table lookup from ip6_pol_route

2018-04-25 Thread David Ahern
-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 4 net/ipv6/route.c | 39 +-- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 80d76d8dc683..4f7b8f59ea6d

[RFC bpf-next 5/9] net/ipv6: Add fib6_lookup

2018-04-25 Thread David Ahern
. Caller must hold rcu lock as no reference is taken on the returned fib entry. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 6 net/ipv6/fib6_rules.c | 83 +-- net/ipv6/ip6_fib.c| 7 + 3 files chang

[RFC bpf-next 1/9] net/ipv6: Rename fib6_lookup to fib6_node_lookup

2018-04-25 Thread David Ahern
Rename fib6_lookup to fib6_node_lookup to better reflect what it returns. The fib6_lookup name will be used in a later patch for an IPv6 equivalent to IPv4's fib_lookup. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 6 +++--- net/ipv6/ip6_fib.c| 5 +++-- ne

[RFC bpf-next 4/9] net/ipv6: Refactor fib6_rule_action

2018-04-25 Thread David Ahern
Move source address lookup from fib6_rule_action to a helper. It will be used in a later patch by a second variant for fib6_rule_action. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/fib6_rules.c | 52 ++- 1 file chang

[RFC bpf-next 0/9] bpf: Add helper to do FIB lookups

2018-04-25 Thread David Ahern
into the kernel and ipv6 may not be built or loaded. Patch 8 adds the bpf helper and 9 is a sample program. David Ahern (9): net/ipv6: Rename fib6_lookup to fib6_node_lookup net/ipv6: Rename rt6_multipath_select net/ipv6: Extract table lookup from ip6_pol_route net/ipv6: Refactor

[PATCH net-next] net: rules: Move l3mdev attribute validation to a helper

2018-04-24 Thread David Ahern
Move the check on FRA_L3MDEV attribute to helper to improve the readability of fib_nl2rule. Update the extack messages to be clear when the configuration option is disabled versus an invalid value has been passed. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/core/fib_rules.

Re: [PATCH net-next] ipv6: addrconf: don't evaluate keep_addr_on_down twice

2018-04-24 Thread David Ahern
On 4/24/18 1:31 AM, Ivan Vecera wrote: > The addrconf_ifdown() evaluates keep_addr_on_down state twice. There > is no need to do it. > > Cc: David Ahern <dsah...@gmail.com> > Signed-off-by: Ivan Vecera <c...@cera.cz> > --- > net/ipv6/addrconf.c | 23 ++--

Re: VRF: Ingress IPv6 Linklocal/Multicast destined pkt from slave VRF device does not map to Master device socket

2018-04-24 Thread David Ahern
On 4/23/18 11:57 PM, Sukumar Gopalakrishnan wrote: > Get master device address from (skb->dev) and pass master to socket > lookup up function for Ipv6 Linklocal/Multicast address. > > ipv6_raw_deliver() > { > int mdif; > .. > .. > mdif = (((nexthdr == IPPROTO_PIM || nexthdr == 89 /*

Re: [PATCH net-next] net/ipv6: fix LOCKDEP issue in rt6_remove_exception_rt()

2018-04-24 Thread David Ahern
quot;) > Signed-off-by: Eric Dumazet <eduma...@google.com> > Reported-by: syzbot <syzkal...@googlegroups.com> > Cc: David Ahern <dsah...@gmail.com> > --- > net/ipv6/route.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > Acked-by: David Ahern <dsah...@gmail.com> Thanks, Eric.

Re: [PATCH net-next] net: fib_rules: fix l3mdev netlink attr processing

2018-04-23 Thread David Ahern
On 4/23/18 9:21 PM, David Miller wrote: > From: Roopa Prabhu > Date: Mon, 23 Apr 2018 20:08:41 -0700 > >> From: Roopa Prabhu >> >> Fixes: b16fb418b1bf ("net: fib_rules: add extack support") >> Signed-off-by: Roopa Prabhu

Re: [PATCH iproute2-next v2 2/2] gre/gre6: allow clearing {,i,o}{key,seq,csum} flags

2018-04-23 Thread David Ahern
On 4/20/18 2:32 AM, Sabrina Dubroca wrote: > Currently, iproute allows setting those flags, but it's impossible to > clear them, since their current value is fetched from the kernel and > then we OR in the additional flags passed on the command line. > > Add no* variants to allow clearing them. >

Re: [PATCH iproute2 net-next] vxlan: add ttl auto in help message

2018-04-23 Thread David Ahern
On 4/23/18 8:40 PM, Hangbin Liu wrote: > Signed-off-by: Hangbin Liu > --- > ip/iplink_vxlan.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > applied to iproute2-next. Thanks,

[PATCH net-next 2/2] net/ipv6: Fix missing rcu dereferences on from

2018-04-23 Thread David Ahern
ime so it can be used the sceond time outside of the lock Fixes: a68886a69180 ("net/ipv6: Make from in rt6_info rcu protected") Reported-by: kbuild test robot <l...@intel.com> Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/route.c | 15 ++- 1 file cha

[PATCH net-next 1/2] net/ipv6: add rcu locking to ip6_negative_advice

2018-04-23 Thread David Ahern
to rt6_check_expired in ip6_negative_advice. Fixes: a68886a69180 ("net/ipv6: Make from in rt6_info rcu protected") Reported-by: syzbot+2422c9e35796659d2...@syzkaller.appspotmail.com Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/route.c | 2 ++ 1 file changed, 2 insertion

[PATCH net-next 0/2] net/ipv6: couple of fixes for rcu change to from

2018-04-23 Thread David Ahern
So many details... I am thankful for all the robots running the permutations and tools. Two bug fixes from the rcu change to rt->from: 1. missing rcu lock in ip6_negative_advice 2. rcu dereferences in 2 sites David Ahern (2): net/ipv6: add rcu locking to ip6_negative_advice net/ipv6:

Re: [PATCH net] ipv6: add RTA_TABLE and RTA_PREFSRC to rtm_ipv6_policy

2018-04-23 Thread David Ahern
g struct > fib6_config") > Fixes: c3968a857a6b ("ipv6: RTA_PREFSRC support for ipv6 route source address > selection") > Signed-off-by: Eric Dumazet <eduma...@google.com> > Reported-by: syzbot <syzkal...@googlegroups.com> > --- > net/ipv6/route.c |

Re: WARNING: suspicious RCU usage in rt6_check_expired

2018-04-23 Thread David Ahern
On 4/23/18 7:31 AM, Eric Dumazet wrote: >> stack backtrace: >> CPU: 1 PID: 25958 Comm: syz-executor7 Not tainted 4.16.0+ #11 >> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS >> Google 01/01/2011 >> Call Trace: >>  __dump_stack lib/dump_stack.c:77 [inline] >>  

XDP breakage with virtio due to 6870de435b90c083ae0f3f7f341287976ef56f03

2018-04-22 Thread David Ahern
This commit breaks my FIB forwarding program: commit 6870de435b90c083ae0f3f7f341287976ef56f03 Author: Nikita V. Shirokov Date: Tue Apr 17 21:42:20 2018 -0700 bpf: make virtio compatible w/ bpf_xdp_adjust_tail w/ bpf_xdp_adjust_tail helper xdp's data_end pointer

[PATCH net-next 2/7] net/ipv6: Rename rt6_get_cookie_safe

2018-04-20 Thread David Ahern
rt6_get_cookie_safe takes a fib6_info and checks the sernum of the node. Update the name to reflect its purpose. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 6 +++--- net/ipv6/route.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff

[PATCH net-next 4/7] net/ipv6: Move rcu locking to callers of fib6_get_cookie_safe

2018-04-20 Thread David Ahern
A later patch protects 'from' in rt6_info and this simplifies the locking needed by it. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 6 -- net/ipv6/route.c | 13 ++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/inclu

[PATCH net-next 6/7] net/ipv6: Make from in rt6_info rcu protected

2018-04-20 Thread David Ahern
this race using rcu on from. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 10 +++--- net/ipv6/ip6_fib.c| 8 +++-- net/ipv6/ip6_output.c | 9 +++-- net/ipv6/route.c | 96 --- 4 files changed, 88 insertions(

[PATCH net-next 5/7] net/ipv6: Move release of fib6_info from pcpu routes to helper

2018-04-20 Thread David Ahern
Code move only; no functional change intended. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/ip6_fib.c | 41 +++-- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index f936e9

[PATCH net-next 7/7] net/ipv6: Remove unncessary check on f6i in fib6_check

2018-04-20 Thread David Ahern
Dan reported an imbalance in fib6_check on use of f6i and checking whether it is null. Since fib6_check is only called if f6i is non-null, remove the unnecessary check. Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6

[PATCH net-next 1/7] net/ipv6: Clean up rt expires helpers

2018-04-20 Thread David Ahern
rt6_clean_expires and rt6_set_expires are no longer used. Removed them. rt6_update_expires has 1 caller in route.c, so move it from the header. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 21 - net/ipv6/route.c | 9 + 2

[PATCH net-next 0/7] net/ipv6: Another followup to the fib6_info change

2018-04-20 Thread David Ahern
a panic once, so I can not definitively confirm it addresses the problem but it seems pretty clear that it is a race on removing a 'from' reference on an rt6_info and another path using that 'from' value to do cookie checking. David Ahern (7): net/ipv6: Clean up rt expires helpers net/ipv6: Rename

[PATCH net-next 3/7] net/ipv6: Move rcu_read_lock to callers of ip6_rt_cache_alloc

2018-04-20 Thread David Ahern
A later patch protects 'from' in rt6_info and this simplifies the locking needed by it. With the move, the fib6_info_hold for the uncached_rt is no longer needed since the rcu_lock is still held. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/route.c | 13 ++---

Re: [PATCH iproute2 net-next] vxlan: fix ttl inherit behavior

2018-04-19 Thread David Ahern
On 4/17/18 11:05 PM, Hangbin Liu wrote: > Like kernel net-next commit 72f6d71e491e6 ("vxlan: add ttl inherit support"), > vxlan ttl inherit should means inherit the inner protocol's ttl value. > > But currently when we add vxlan with "ttl inherit", we only set ttl 0, > which is actually use

Re: [PATCH net-next] net/ipv6: Fix ip6_convert_metrics() bug

2018-04-19 Thread David Ahern
ned-off-by: Eric Dumazet <eduma...@google.com> > Cc: David Ahern <d...@cumulusnetworks.com> > Reported-by: syzbot <syzkal...@googlegroups.com> > --- > net/ipv6/route.c | 20 +--- > 1 file changed, 9 insertions(+), 11 deletions(-) Acked-by: David Ahern <d...@cumulusnetworks.com> Thanks for fixing.

[PATCH net-next 5/8] net/ipv6: Change ip6_route_get_saddr to get dev from route

2018-04-18 Thread David Ahern
Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_route.h | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 31e24f821ef6..c0620330035c 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_ro

[PATCH net-next 1/8] net/ipv6: Rename fib6_info struct elements

2018-04-18 Thread David Ahern
Change the prefix for fib6_info struct elements from rt6i_ to fib6_. rt6i_pcpu and rt6i_exception_bucket are left as is given that they point to rt6_info entries. Rename only; not functional change intended. Signed-off-by: David Ahern <dsah...@gmail.com> --- .../net/ethernet/mellanox

[PATCH net-next 6/8] net/ipv6: Remove compare of fib6_idev from rt6_duplicate_nexthop

2018-04-18 Thread David Ahern
After 4832c30d5458 ("net: ipv6: put host and anycast routes on device with address") the comparison of idev does not add value since it correlates to the nexthop device which is already compared. Remove the idev comparison. Signed-off-by: David Ahern <dsah...@gmail.com>

[PATCH net-next 7/8] net/ipv6: Remove fib6_idev

2018-04-18 Thread David Ahern
fib6_idev can be obtained from __in6_dev_get on the nexthop device rather than caching it in the fib6_info. Remove it. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 1 - net/ipv6/ip6_fib.c| 2 -- net/ipv6/route.c

[PATCH net-next 4/8] net/ipv6: Remove unnecessary checks on fib6_idev

2018-04-18 Thread David Ahern
Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/route.c | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e44f82848143..8cf4f0623229 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c

[PATCH net-next 3/8] net/ipv6: Remove aca_idev

2018-04-18 Thread David Ahern
aca_idev has only 1 user - inet6_fill_ifacaddr - and it only wants the device index which can be extracted from the fib6_info nexthop. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/if_inet6.h | 1 - include/net/ip6_fib.h | 5 + net/ipv6/addrconf.c| 3 ++- ne

[PATCH net-next 8/8] net/ipv6: Fix gfp_flags arg to addrconf_prefix_route

2018-04-18 Thread David Ahern
flags to route add functions") Reported-by: syzbot+2add39b05179b31f9...@syzkaller.appspotmail.com Reported-by: Eric Dumazet <eric.duma...@gmail.com> Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/addrconf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH net-next 0/8] net/ipv6: followup to fib6_info change

2018-04-18 Thread David Ahern
flags argument to addrconf_prefix_route in a couple of places. David Ahern (8): net/ipv6: Rename fib6_info struct elements net/ipv6: Rename addrconf_dst_alloc net/ipv6: Remove aca_idev net/ipv6: Remove unnecessary checks on fib6_idev net/ipv6: Change ip6_route_get_saddr to get dev from

[PATCH net-next 2/8] net/ipv6: Rename addrconf_dst_alloc

2018-04-18 Thread David Ahern
addrconf_dst_alloc now returns a fib6_info. Update the name and its users to reflect the change. Rename only; no functional change intended. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_route.h | 2 +- net/ipv6/addrconf.c | 28 ++-- ne

Re: WARNING: suspicious RCU usage in fib6_info_alloc

2018-04-18 Thread David Ahern
On 4/18/18 3:02 PM, syzbot wrote: > stack backtrace: > CPU: 1 PID: 25 Comm: kworker/1:1 Not tainted 4.16.0+ #5 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS > Google 01/01/2011 > Workqueue: ipv6_addrconf addrconf_dad_work > Call Trace: >  __dump_stack

Re: [PATCH net-next v2 16/21] net/ipv6: Add gfp_flags to route add functions

2018-04-18 Thread David Ahern
On 4/18/18 11:06 AM, Eric Dumazet wrote: > > > On 04/17/2018 05:33 PM, David Ahern wrote: >> Most FIB entries can be added using memory allocated with GFP_KERNEL. >> Add gfp_flags to ip6_route_add and addrconf_dst_alloc. Code paths that >> can be reached from t

Re: Repeatable inet6_dump_fib crash in stock 4.12.0-rc4+

2018-04-17 Thread David Ahern
On 4/17/18 5:29 PM, Ben Greear wrote: > > FYI, problem still happens in 4.16.  I'm going to re-enable my hack below > for this kernel as well...I had hopes it might be fixed... Interesting. I was hoping the same. > > BUG: unable to handle kernel NULL pointer dereference at 8 > IP:

[PATCH net-next v2 04/21] net/ipv6: Pass net to fib6_update_sernum

2018-04-17 Thread David Ahern
Pass net namespace to fib6_update_sernum. It can not be marked const as fib6_new_sernum will change ipv6.fib6_sernum. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 2 +- net/ipv6/ip6_fib.c| 3 +-- net/ipv6/route.c | 10 +- 3 files chan

[PATCH net-next v2 09/21] net/ipv6: Defer initialization of dst to data path

2018-04-17 Thread David Ahern
at rt6i_flags. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/route.c | 115 +++ 1 file changed, 74 insertions(+), 41 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 222af19d3403..3b301aafd2ed 100644 ---

[PATCH net-next v2 03/21] vrf: Move fib6_table into net_vrf

2018-04-17 Thread David Ahern
A later patch removes rt6i_table from rt6_info. Save the ipv6 table for a VRF in net_vrf. fib tables can not be deleted so no reference counting or locking is required. Signed-off-by: David Ahern <dsah...@gmail.com> --- drivers/net/vrf.c | 25 ++--- 1 file chan

[PATCH net-next v2 06/21] net/ipv6: Move support functions up in route.c

2018-04-17 Thread David Ahern
Code move only. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/route.c | 119 +++ 1 file changed, 59 insertions(+), 60 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 045811a3da76..0daf4c9c9f2b 100644 ---

[PATCH net-next v2 12/21] net/ipv6: Add fib6_null_entry

2018-04-17 Thread David Ahern
ip6_null_entry will stay a dst based return for lookups that fail to match an entry. Add a new fib6_null_entry which constitutes the root node and leafs for fibs. Replace existing references to ip6_null_entry with the new fib6_null_entry when dealing with FIBs. Signed-off-by: David Ahern <d

[PATCH net-next v2 02/21] net: Handle null dst in rtnl_put_cacheinfo

2018-04-17 Thread David Ahern
Need to keep expires time for IPv6 routes in a dump of FIB entries. Update rtnl_put_cacheinfo to allow dst to be NULL in which case rta_cacheinfo will only contain non-dst data. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/core/rtnetlink.c | 8 +--- 1 file changed, 5 inse

[PATCH net-next v2 18/21] net/ipv6: introduce fib6_info struct and helpers

2018-04-17 Thread David Ahern
Add fib6_info struct and alloc, destroy, hold and release helpers. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 55 ++ net/ipv6/ip6_fib.c| 60 +++ 2 files change

[PATCH net-next v2 21/21] net/ipv6: Remove unused code and variables for rt6_info

2018-04-17 Thread David Ahern
Drop unneeded elements from rt6_info struct and rearrange layout to something more relevant for the data path. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 60 +++-- net/ipv6/ip6_fib.c | 22 -

[PATCH net-next v2 13/21] net/ipv6: Add rt6_info create function for ip6_pol_route_lookup

2018-04-17 Thread David Ahern
to the caller. Signed-off-by: David Ahern <dsah...@gmail.com> --- net/ipv6/route.c | 29 + 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 7c141394d4f1..e293692174ba 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/r

[PATCH net-next v2 08/21] net/ipv6: Move nexthop data to fib6_nh

2018-04-17 Thread David Ahern
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 are left as is. Signed-off-by: David Ahern <dsah...@gmail.

[PATCH net-next v2 19/21] net/ipv6: separate handling of FIB entries from dst based routes

2018-04-17 Thread David Ahern
off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 4 +- include/net/ip6_route.h | 3 +- net/ipv6/addrconf.c | 18 +++-- net/ipv6/anycast.c | 7 +- net/ipv6/ip6_fib.c | 55 ++-- net/ipv6/ip6_output.c | 3 +- net/ipv6/ndisc.c|

[PATCH net-next v2 20/21] net/ipv6: Flip FIB entries to fib6_info

2018-04-17 Thread David Ahern
Convert all code paths referencing a FIB entry from rt6_info to fib6_info. Signed-off-by: David Ahern <dsah...@gmail.com> --- .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 64 ++--- include/net/if_inet6.h | 4 +- include/net/ip6

[PATCH net-next v2 16/21] net/ipv6: Add gfp_flags to route add functions

2018-04-17 Thread David Ahern
) use GFP_KERNEL. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_route.h | 6 -- net/ipv6/addrconf.c | 39 +++ net/ipv6/anycast.c | 2 +- net/ipv6/route.c| 18 ++ 4 files changed, 38 insertions(

[PATCH net-next v2 17/21] net/ipv6: Cleanup exception and cache route handling

2018-04-17 Thread David Ahern
. In addition, remove RTF_CACHE and dst checks from fib6 add and delete since they can not happen now and will never happen after the data type flip. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_route.h | 1 - net/ipv6/ip6_fib.c | 16 +- net/ipv6/route.c

[PATCH net-next v2 14/21] net/ipv6: Move dst flags to booleans in fib entries

2018-04-17 Thread David Ahern
Continuing to wean FIB paths off of dst_entry, use a bool to hold requests for certain dst settings. Add a helper to convert the flags to DST flags when a FIB entry is converted to a dst_entry. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 5 - ne

[PATCH net-next v2 15/21] net/ipv6: Create a neigh_lookup for FIB entries

2018-04-17 Thread David Ahern
the gateway. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_route.h | 3 +++ net/ipv6/ndisc.c| 8 ++-- net/ipv6/route.c| 33 - 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/include/net/ip6_route.h b/i

[PATCH net-next v2 10/21] net/ipv6: move metrics from dst to rt6_info

2018-04-17 Thread David Ahern
functions similar to fib_dump_info and rt_fill_info) - rt6_fill_node no longer needs the temporary metrics variable Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 17 ++-- net/core/dst.c| 1 + net/ipv6/ip6_fib.c| 66 + net/ipv6/ndisc.c

[PATCH net-next v2 07/21] net/ipv6: Save route type in rt6_info

2018-04-17 Thread David Ahern
RTF_LOCAL: fc_type = RTN_LOCAL - rt6i_flags contains RTF_ANYCAST: fc_type = RTN_ANYCAST - else fc_type = RTN_UNICAST Similarly, fib6_type is set in the rt6_info templates based on the RTF_REJECT section of rt6_fill_node converting dst.error to RTN type. Signed-off-by: David Ahern <d

[PATCH net-next v2 00/21] net/ipv6: Separate data structures for FIB and data path

2018-04-17 Thread David Ahern
with an intermediate patch; added dst_hold_safe on rt->from. Code is removed 3 patches later - allow cacheinfo to handle NULL dst; means only expires is pushed to userspace David Ahern (21): net: Move fib_convert_metrics to metrics file net: Handle null dst in rtnl_put_cacheinfo vrf: M

[PATCH net-next v2 01/21] net: Move fib_convert_metrics to metrics file

2018-04-17 Thread David Ahern
len are passed as inputs pulled from fib_config - metrics array is passed as an input from fi->fib_metrics->metrics Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip.h | 3 +++ net/ipv4/Makefile| 3 ++- net/ipv4/fib_s

[PATCH net-next v2 05/21] net/ipv6: Pass net namespace to route functions

2018-04-17 Thread David Ahern
Pass network namespace reference into route add, delete and get functions. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_route.h | 12 ++- net/ipv6/addrconf.c | 33 -- net/ipv6/anycast.c | 10 + net/ipv6/n

[PATCH net-next v2 11/21] net/ipv6: move expires into rt6_info

2018-04-17 Thread David Ahern
xpires becomes fib6_set_expires, and rt6_check_expired becomes fib6_check_expired, where the fib6 versions are added by this patch. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ip6_fib.h | 27 +++ net/ipv6/addrconf.c | 6 +++--- net/ipv6/ip6_f

[PATCH net-next] net/ipv6: Make __inet6_bind static

2018-04-17 Thread David Ahern
BPF core gets access to __inet6_bind via ipv6_bpf_stub_impl, so it is not invoked directly outside of af_inet6.c. Make it static and move inet6_bind after to avoid forward declaration. Signed-off-by: David Ahern <dsah...@gmail.com> --- include/net/ipv6.h | 2 -- net/ipv6/af_inet6.

<    3   4   5   6   7   8   9   10   11   12   >