[PATCH net] net: ipv4: dst for local input routes should use l3mdev if relevant

2016-12-29 Thread David Ahern
the loopback device. Moving from ingress device to loopback loses the L3 domain causing responses based on the dst to get to lost. Fixes: 9d1a6c4ea43e4 ("net: icmp_route_lookup should use rt dev to determine L3 domain") Signed-off-by: David Ahern <d...@cumulusnetworks.com&g

Re: Bug w/ (policy) routing

2017-01-02 Thread David Ahern
On 1/1/17 12:52 PM, Olivier Brunel wrote: > Indeed, if I first delete the rule for lookup local and recreate it > w/ higher prio than my "lookup 50", then no more issue. After the unshare or when creating a new network namespace, bringing the lo device up will create the local table and the rest

Re: [PATCH iproute2 2/3] ip vrf: Improve cgroup2 error messages

2017-01-06 Thread David Ahern
>> @@ -80,13 +80,21 @@ char *find_cgroup2_mount(void) >> >> if (mount("none", mnt, CGROUP2_FS_NAME, 0, NULL)) { >> /* EBUSY means already mounted */ >> -if (errno != EBUSY) { >> +if (errno == EBUSY) >> +goto out; >> + >> +if (errno == ENODEV) { >>

Re: Potential issues (security and otherwise) with the current cgroup-bpf API

2016-12-19 Thread David Ahern
On 12/19/16 5:25 PM, Andy Lutomirski wrote: > net.socket_create_filter = "none": no filter > net.socket_create_filter = "bpf:baadf00d": bpf filter > net.socket_create_filter = "disallow": no sockets created period > net.socket_create_filter = "iptables:foobar": some iptables thingy >

Re: Potential issues (security and otherwise) with the current cgroup-bpf API

2016-12-19 Thread David Ahern
On 12/19/16 6:56 PM, Andy Lutomirski wrote: > On Mon, Dec 19, 2016 at 5:44 PM, David Ahern <dsah...@gmail.com> wrote: >> On 12/19/16 5:25 PM, Andy Lutomirski wrote: >>> net.socket_create_filter = "none": no filter >>> net.socket

[PATCH net-next] rtnetlink: Add dump all for netconf

2017-03-21 Thread David Ahern
Use the rtnl_dump_all to dump all netconf handlers that have been registered. Allows userspace to send a dump request for PF_UNSPEC and get all families. Cc: Nicolas Dichtel <nicolas.dich...@6wind.com> Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/core/rtnetlink.c |

[PATCH net-next] net: mpls: Fix setting ttl_propagate for rt2

2017-03-23 Thread David Ahern
Fix copy and paste error setting rt_ttl_propagate. Fixes: 5b441ac8784c1 ("mpls: allow TTL propagation to IP packets to be configured") Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/mpls/af_mpls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[iproute2 net-next v2 3/3] ip netconf: show all families on dev request

2017-03-23 Thread David Ahern
Currently specifying a device to ip netconf and it dumps only values for IPv4. Change this to dump data for all families unless a specific family is given. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- ip/ipnetconf.c | 23 +-- 1 file changed, 13 insertions(

[iproute2 net-next v2 0/3] ip netconf improvements

2017-03-23 Thread David Ahern
with ipv4 and ipv6. If the new feature is not supported (new iproute2 on older kernel) the kernel returns the nlmsg error EOPNOTSUPP which can be trapped and fallback to existing behavior. v2 - fixed index conversion in patch 3 per nicholas' comment David Ahern (3): netlink: Add flag to suppress

[iproute2 net-next v2 1/3] netlink: Add flag to suppress print of nlmsg error

2017-03-23 Thread David Ahern
. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- include/libnetlink.h | 1 + lib/libnetlink.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/libnetlink.h b/include/libnetlink.h index bd0267dfcc02..c43ab0a2d9d9 100644 --- a/include/libnetlink.h

[iproute2 net-next v2 2/3] ip netconf: Show all address families by default in dumps

2017-03-23 Thread David Ahern
. To make this better going forward, use the new PF_UNSPEC dump all option if the kernel supports it. If the kernel does not, it sets NLMSG_ERROR and returns EOPNOTSUPP which is trapped and we fall back to the existing output to maintain compatibility with existing kernels. Signed-off-by: David Ahern &l

Re: [PATCH net-next 1/4] net: mpls: Convert number of nexthops to u8

2017-03-27 Thread David Ahern
On 3/26/17 9:11 PM, Eric W. Biederman wrote: > I don't like this. Byte writes don't exist on all architectures. > > So while I think always writing to rtn_nhn_alive under the > rtn_lock ensures that we don't have wrong values written > it is quite subtle. And I don't know how this will interact

Re: [PATCH net-next 0/4] net: mpls: Allow users to configure more labels per route

2017-03-28 Thread David Ahern
On 3/27/17 9:08 PM, Eric W. Biederman wrote: > > Overall I like what is being accomplished by this patchset. > I especially like the fact that the forwarding path is left > essentially unchanged, and that the struct mpls_route shirnks a little > for the common case. > > I believe we should just

Re: [PATCH net-next 1/4] net: mpls: Convert number of nexthops to u8

2017-03-28 Thread David Ahern
On 3/27/17 4:54 PM, Eric W. Biederman wrote: > It is absolutely a no-brainer to change rt_nhn to a u8. And I very much > appreciate all work to keep mpls_route into a single cache line. As in > practices that is one of the most important parts to performance. > > Which leads to the functions

Re: [PATCH net-next] net: mpls: Fix setting ttl_propagate for rt2

2017-03-24 Thread David Ahern
On 3/24/17 2:29 PM, David Miller wrote: > From: David Ahern <d...@cumulusnetworks.com> > Date: Thu, 23 Mar 2017 19:02:27 -0600 > >> Fix copy and paste error setting rt_ttl_propagate. >> >> Fixes: 5b441ac8784c1 ("mpls: allow TTL propagation to IP packet

Re: [PATCH net-next] net: mpls: Fix setting ttl_propagate for rt2

2017-03-24 Thread David Ahern
On 3/24/17 3:11 PM, David Miller wrote: > I did a merge yesterday, so I am not likely to do another for about a week. hmmm some how I missed it. That merge has what I need.

[PATCH net-next 2/2] net: mpls: Delete route when all nexthops have been deleted

2017-03-24 Thread David Ahern
When all devices for all nexthops in a route have been deleted, the route is effectively dead, so remove it. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/mpls/af_mpls.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/mpls/af_mpls.c b/ne

[PATCH net-next 0/2] net: mpls: multipath route cleanups

2017-03-24 Thread David Ahern
When a device associated with a nexthop is deleted, the nexthop in the route is effectively removed, so remove it from the route dump. Further, when all nexhops have been deleted the route is effectively done, so remove the route. David Ahern (2): mpls: Don't show nexthop if device has been

[PATCH net-next 1/2] net: mpls: Don't show nexthop if device has been deleted

2017-03-24 Thread David Ahern
eth3 $ ip li del br0 $ ip -f mpls ro ls 100 nexthopvia inet 10.11.1.2 dev * dead linkdown nexthopvia inet 10.100.3.1 dev eth3 Since the nexthop is effectively deleted, drop the hop from the route dump. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/mpls/af_

Re: [PATCH net-next 0/7] netconf: Add support for RTM_DELNETCONF

2017-03-29 Thread David Ahern
On 3/29/17 3:36 AM, Nicolas Dichtel wrote: > Le 29/03/2017 à 07:32, David Miller a écrit : >> From: David Ahern <d...@cumulusnetworks.com> >> Date: Tue, 28 Mar 2017 14:28:00 -0700 >> >>> netconf notifications are sent as devices register but not when they >

Re: [PATCH net-next] rtnl: Add support for netdev event to link messages

2017-03-30 Thread David Ahern
On 3/30/17 7:47 AM, Vlad Yasevich wrote: > But, NETDEV_PRECHANGEMTU will be a unnecessary notification to userspace > without > changes. There are already enough notifications generated for links (I > know you are not > suggesting adding it here) Actually, this one

[PATCH net-next v2 4/6] net: mpls: Limit memory allocation for mpls_route

2017-03-30 Thread David Ahern
Limit memory allocation size for mpls_route to 4096. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- v2 - new patch in v2 of set net/mpls/af_mpls.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/net/mpls/af_mpls.c b/ne

[PATCH net-next v2 1/6] net: mpls: rt_nhn_alive and nh_flags should be accessed using READ_ONCE

2017-03-30 Thread David Ahern
Since those fields can change at any moment in the packet path, both fields should be accessed using READ_ONCE. Updates to both fields should use WRITE_ONCE. Update mpls_select_multipath (packet path) and mpls_ifdown and mpls_ifup (event handlers) accordingly. Signed-off-by: David Ah

[PATCH net-next v2 6/6] net: mpls: Increase max number of labels for lwt encap

2017-03-30 Thread David Ahern
Alow users to push down more labels per MPLS encap. Similar to LSR case, move label array to the end of mpls_iptunnel_encap and allocate based on the number of labels for the route. For consistency with the LSR case, re-use the same maximum number of labels. Signed-off-by: David Ahern &l

[PATCH net-next v2 2/6] net: mpls: Convert number of nexthops to u8

2017-03-30 Thread David Ahern
with a 2-byte hole before the nexthops. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- v2 - label u16 hole in mpls_route as rt_reserved1 net/mpls/af_mpls.c | 28 +--- net/mpls/internal.h | 5 +++-- 2 files changed, 20 insertions(+), 13 deletions(-) diff

[PATCH net-next v2 3/6] net: mpls: change mpls_route layout

2017-03-30 Thread David Ahern
hange has no effect to a modest increase in performance. This is expected since this patch does not really have an impact on routes with 1 or 2 labels (the current limit) and 1 or 2 nexthops. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- v2 - and u8 and u16 reserved variables to explic

[PATCH net-next v2 5/6] net: mpls: bump maximum number of labels

2017-03-30 Thread David Ahern
nexthops looking for the max number of labels across the route spec. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- v2 - increased MAX_NEW_LABELS to 30 - allocate mpls_route_config dynamically to reduce stack usage with new label count net/mpls/af_mpls.c

[PATCH net-next v2 0/6] net: mpls: Allow users to configure more labels per route

2017-03-30 Thread David Ahern
) + mostly killed use of MAX_NEW_LABELS; it exists only for common limit between lwt and routing paths David Ahern (6): net: mpls: rt_nhn_alive and nh_flags should be accessed using READ_ONCE net: mpls: Convert number of nexthops to u8 net: mpls: change mpls_route layout net:mpls: Limit

Re: [PATCH net-next] rtnl: Add support for netdev event to link messages

2017-03-30 Thread David Ahern
On 3/30/17 9:21 AM, Vladislav Yasevich wrote: > > So, something like the patch below would be better in your opinion as a > starting point. It'll can at least get the discussion strarted on whether > an event would usefull to user space or not. IMO that is a more direct, explicit statement of

[iproute2 net-next 2/3] ip netconf: Show all address families by default in dumps

2017-03-22 Thread David Ahern
. To make this better going forward, use the new PF_UNSPEC dump all option if the kernel supports it. If the kernel does not, it sets NLMSG_ERROR and returns EOPNOTSUPP which is trapped and we fall back to the existing output to maintain compatibility with existing kernels. Signed-off-by: David Ahern &l

[iproute2 net-next 3/3] ip netconf: Show all families on dev request

2017-03-22 Thread David Ahern
Currently specifying a device to ip netconf and it dumps only values for IPv4. Change this to dump data for all families unless a specific family is given. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- ip/ipnetconf.c | 23 +-- 1 file changed, 13 insertions(

[iproute2 net-next 1/3] netlink: Add flag to suppress print of nlmsg error

2017-03-22 Thread David Ahern
. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- include/libnetlink.h | 1 + lib/libnetlink.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/libnetlink.h b/include/libnetlink.h index bd0267dfcc02..c43ab0a2d9d9 100644 --- a/include/libnetlink.h

[iproute2 net-next 0/3] ip netconf improvements

2017-03-22 Thread David Ahern
with ipv4 and ipv6. If the new feature is not supported (new iproute2 on older kernel) the kernel returns the nlmsg error EOPNOTSUPP which can be trapped and fallback to existing behavior. David Ahern (3): netlink: Add flag to suppress print of nlmsg error ip netconf: Show all address families

[PATCH net-next 4/7] net: ipv6: Refactor inet6_netconf_notify_devconf to take event

2017-03-28 Thread David Ahern
Refactor inet6_netconf_notify_devconf to take the event as an input arg. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- include/net/addrconf.h | 4 ++-- net/ipv6/addrconf.c| 33 ++--- net/ipv6/ip6mr.c | 9 + 3 files chang

[PATCH net-next 2/7] net: devinet: Refactor inet_netconf_notify_devconf to take event

2017-03-28 Thread David Ahern
Refactor inet_netconf_notify_devconf to take the event as an input arg. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- include/linux/inetdevice.h | 4 ++-- net/ipv4/devinet.c | 32 net/ipv4/ipmr.c| 12 +++- 3 files c

[PATCH net-next 7/7] net: mpls: Send netconf messages on device register and unregister

2017-03-28 Thread David Ahern
Send netconf notifications for MPLS when the device registers and unregisters. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/mpls/af_mpls.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c

[PATCH net-next 5/7] net: ipv6: Add support for RTM_DELNETCONF

2017-03-28 Thread David Ahern
Send RTM_DELNETCONF notifications when a device is deleted. The message only needs the device index, so modify inet6_netconf_fill_devconf to skip devconf references if it is NULL. Allows a userspace cache to remove entries as devices are deleted. Signed-off-by: David Ahern &l

[PATCH net-next 6/7] net:mpls: Refactor mpls_netconf_notify_devconf to take event

2017-03-28 Thread David Ahern
Refactor mpls_netconf_notify_devconf to take the event as an input arg. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/mpls/af_mpls.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 747559

[PATCH net-next 0/7] netconf: Add support for RTM_DELNETCONF

2017-03-28 Thread David Ahern
netconf notifications are sent as devices register but not when they are deleted leaving userspace caches out of sync. Add support for RTM_DELNETCONF to ipv4, ipv6 and mpls. MPLS is missing RTM_NEWNETCONF as devices are created, so add it as well. David Ahern (7): rtnetlink: Add RTM_DELNETCONF

Re: [PATCH net-next] rtnl: Add support for netdev event to link messages

2017-03-29 Thread David Ahern
On 3/29/17 11:05 AM, Vlad Yasevich wrote: > On 03/29/2017 12:37 PM, Roopa Prabhu wrote: >> On 3/29/17, 5:23 AM, Vlad Yasevich wrote: >>> [ resending to list. hit the wrong reply button last time ] >>> >>> On 03/27/2017 06:58 PM, David Miller wrote: From: Vladislav Yasevich

Re: [PATCH net-next 0/4] net: mpls: Allow users to configure more labels per route

2017-03-29 Thread David Ahern
On 3/27/17 9:08 PM, Eric W. Biederman wrote: > I believe we should just kill MAX_NEW_LABELS. > > I think the only significant change from your patch is the removal of an > array from mpls_route_config. > > With the removal of MAX_NEW_LABELS I would replace it by a sanity check > in mpls_rt_alloc

[PATCH net-next 3/7] net: devinet: Add support for RTM_DELNETCONF

2017-03-28 Thread David Ahern
Send RTM_DELNETCONF notifications when a device is deleted. The message only needs the device index, so modify inet_netconf_fill_devconf to skip devconf references if it is NULL. Allows a userspace cache to remove entries as devices are deleted. Signed-off-by: David Ahern &l

[PATCH net-next 1/7] rtnetlink: Add RTM_DELNETCONF

2017-03-28 Thread David Ahern
Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- include/uapi/linux/rtnetlink.h | 2 ++ security/selinux/nlmsgtab.c| 1 + 2 files changed, 3 insertions(+) diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index 3dd72aee4d32..cce061382e40

[PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops

2017-03-28 Thread David Ahern
A recent commit skips nexthops in a route if the device has been deleted. Update lfib_nlmsg_size accordingly. Reported-by: Roopa Prabhu <ro...@cumulusnetworks.com> Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/mpls/af_mpls.c | 2 ++ 1 file changed, 2 insertions(+)

[PATCH net-next 3/4] net: mpls: bump maximum number of labels

2017-03-25 Thread David Ahern
has expressed an interest in up to 12 labels. Since the limit is only used to cap what userspace can push down to the kernel, set the new limit to 12 which should accommodate all known segment routing use cases. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/mpls/af_mpls.

[PATCH net-next 2/4] net: mpls: change mpls_route layout

2017-03-25 Thread David Ahern
increase in performance. This is expected since this patch does not really have an impact on routes with 1 or 2 labels (the current limit) and 1 or 2 nexthops. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/mpls/af_mpls.c | 37 + net/mpls/

[PATCH net-next 4/4] net: mpls: Increase max number of labels for lwt encap

2017-03-25 Thread David Ahern
Alow users to push down more labels per MPLS encap. Same logic as LSR use case, so re-use the maximum number of labels. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- include/net/mpls_iptunnel.h | 4 +--- net/mpls/af_mpls.c | 5 - net/mpls/internal.h

[PATCH net-next 0/4] net: mpls: Allow users to configure more labels per route

2017-03-25 Thread David Ahern
tests with namespaces shows no impact to a modest performance increase with this layout for 1 or 2 labels and 1 or 2 nexthops. The new limit is set to 12 to cover all currently known segment routing use cases. David Ahern (4): mpls: Convert number of nexthops to u8 net: mpls: change mpls_route

[PATCH net-next 1/4] net: mpls: Convert number of nexthops to u8

2017-03-25 Thread David Ahern
with a 2-byte hole before the nexthops. Also, the ACCESS_ONCE is changed to READ_ONCE per checkpatch message. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/mpls/af_mpls.c | 29 ++--- net/mpls/internal.h | 4 ++-- 2 files changed, 20 insertions(

Re: [PATCH net-next 0/4] net: mpls: Allow users to configure more labels per route

2017-03-27 Thread David Ahern
On 3/27/17 4:39 AM, Robert Shearman wrote: > On 25/03/17 19:15, Eric W. Biederman wrote: >> David Ahern <d...@cumulusnetworks.com> writes: >> >>> Bump the maximum number of labels for MPLS routes from 2 to 12. To keep >>> memory consumption in che

Re: net: heap out-of-bounds in fib6_clean_node/rt6_fill_node/fib6_age/fib6_prune_clone

2017-03-27 Thread David Ahern
On 3/27/17 6:42 AM, Dmitry Vyukov wrote: > A friendly ping. This still happens all the time for us. Haven't looked at this in a couple of weeks. I have syzkaller installed on a machine locally and never was able to reproduce this ipv6 problem. I am using a jessie rootfs; from the syzkaller files

Re: [patch net-next v3 1/9] ipv4: fib_rules: Check if rule is a default rule

2017-03-16 Thread David Ahern
ht invoke offloading > drivers to unnecessarily flush their tables. > > Solve this by adding an helper to check if a FIB rule is a default rule. > Namely, its selector should match all packets and its action should > point to the local, main or default tables. > > As noted

Re: [patch net-next v3 3/9] ipv4: fib_rules: Dump FIB rules when registering FIB notifier

2017-03-16 Thread David Ahern
++-- > net/ipv4/fib_rules.c | 19 > --- > 3 files changed, 43 insertions(+), 6 deletions(-) Acked-by: David Ahern <d...@cumulusnetworks.com>

[PATCH] net: vrf: Reset rt6i_idev in local dst after put

2017-03-17 Thread David Ahern
t;) Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- drivers/net/vrf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 7f28021d9d93..761ea041b018 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -462,8 +462,1

[PATCH iproute2] ip route: Add missing space between nexthop and via for mpls multipath routes

2017-03-17 Thread David Ahern
MPLS multipath routes are missing a space between 'nexthop' and 'via': $ ip -net ns1 -f mpls ro ls 100 nexthopvia inet 172.16.2.2 dev virt12 nexthopvia inet 172.16.3.2 dev br0 Add it. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- ip/iproute.c | 2 +-

Re: SO_BINDTODEVICE in VRFs not working?

2017-03-18 Thread David Ahern
On 3/17/17 7:59 PM, Daniele Orlandi wrote: > > Hello, > > I'm writing an application that should listen on a TCP port bound to an > inteface in a VRF. > > The bind/listen sequence is the following: > > int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); > > char *ifname = "eth1"; Bind to

Re: SO_BINDTODEVICE in VRFs not working?

2017-03-19 Thread David Ahern
On 3/18/17 4:28 AM, Rami Rosen wrote: > Hi, > >> Bind to the VRF device not an interface enslaved to it. I want to add >> the option for enslaved interfaces but have not gotten around to it. > > Maybe this should be added as a note/TBD to the VRF documentation > (which does mention setsockopt

Re: [patch net-next v2 2/9] ipv4: fib_rules: Add notifier info to FIB rules notifications

2017-03-15 Thread David Ahern
gt; net/ipv4/fib_rules.c | 13 ++++----- > 2 files changed, 13 insertions(+), 5 deletions(-) Acked-by: David Ahern <d...@cumulusnetworks.com>

Re: [patch net-next v2 1/9] net: fib_rules: Check if selector matches all packets

2017-03-15 Thread David Ahern
On 3/15/17 5:05 AM, Jiri Pirko wrote: > diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c > index b6791d9..4ed475d 100644 > --- a/net/core/fib_rules.c > +++ b/net/core/fib_rules.c > @@ -23,6 +23,20 @@ static const struct fib_kuid_range fib_kuid_range_unset = { > KUIDT_INIT(~0), > };

Re: [patch net-next v2 3/9] ipv4: fib_rules: Dump FIB rules when registering FIB notifier

2017-03-15 Thread David Ahern
On 3/15/17 5:05 AM, Jiri Pirko wrote: > @@ -2510,10 +2511,20 @@ static void mlxsw_sp_router_fib4_abort(struct > mlxsw_sp *mlxsw_sp) > dev_warn(mlxsw_sp->bus_info->dev, "Failed to set abort > trap.\n"); > } > > +static bool mlxsw_sp_fib4_rule_default(const struct fib_rule *rule)

Re: [PATCH net-next v3] net: ipv4: add support for ECMP hash policy choice

2017-03-15 Thread David Ahern
On 3/15/17 3:17 AM, Nicolas Dichtel wrote: >>> Is there another patch to add the NETCONFA_ECMP support? >>> >> >> does userspace care? > Yes, I think it is needed so that userspace can correctly monitor this > behavior. > It also enables to check this parameter through netlink. > I don't

[PATCH] net: ipv6: set route type for anycast routes

2017-03-15 Thread David Ahern
Anycast routes have the RTF_ANYCAST flag set, but when dumping routes for userspace the route type is not set to RTN_ANYCAST. Make it so. Fixes: 58c4fb86eabcb ("[IPV6]: Flag RTF_ANYCAST for anycast routes") CC: Hideaki YOSHIFUJI <yoshf...@linux-ipv6.org> Signed-off-by

[PATCH net-next 1/2] net: vrf: performance improvements for IPv4

2017-03-20 Thread David Ahern
ed-off-by: David Ahern <d...@cumulusnetworks.com> --- drivers/net/vrf.c | 106 -- 1 file changed, 96 insertions(+), 10 deletions(-) diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 7f28021d9d93..cdf7253ae89e 100644 --- a/drivers/net/vrf.c +

[PATCH net-next 0/2] net: vrf: performance improvements

2017-03-20 Thread David Ahern
local table and 1 in the main table). [1] http://netdevconf.org/1.2/papers/ahern-what-is-l3mdev-paper.pdf David Ahern (2): net: vrf: performance improvements for IPv4 net: vrf: performance improvements for IPv6 drivers/net/vrf.c | 172 +++---

[PATCH net-next 2/2] net: vrf: performance improvements for IPv6

2017-03-20 Thread David Ahern
ach request-response. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- drivers/net/vrf.c | 66 ++- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index cdf7253ae89e..4140ff878d

Re: [patch net-next v2 1/9] net: fib_rules: Check if selector matches all packets

2017-03-15 Thread David Ahern
On 3/15/17 9:30 AM, Ido Schimmel wrote: >>> diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c >>> index 2892109..7a941a5 100644 >>> --- a/net/ipv4/fib_rules.c >>> +++ b/net/ipv4/fib_rules.c >>> @@ -47,6 +47,16 @@ struct fib4_rule { >>> #endif >>> }; >>> >>> +bool

Re: [PATCH net-next v3] net: ipv4: add support for ECMP hash policy choice

2017-03-14 Thread David Ahern
On 3/14/17 5:27 PM, Stephen Hemminger wrote: > On Tue, 14 Mar 2017 15:38:40 -0700 > Roopa Prabhu wrote: > >>> That's what my initial version did, but this was discussed during >>> NetConf in Seville >>> and it was decided that it's best to make a global

Re: [PATCH] net: ipv6: set route type for anycast routes

2017-03-16 Thread David Ahern
On 3/16/17 9:41 PM, David Miller wrote: > From: David Ahern <d...@cumulusnetworks.com> > Date: Wed, 15 Mar 2017 18:14:33 -0700 > >> Anycast routes have the RTF_ANYCAST flag set, but when dumping routes >> for userspace the route type is not set to RTN_ANYCA

Re: [iproute2 net-next v2 0/3] ip netconf improvements

2017-04-04 Thread David Ahern
On 3/23/17 10:51 PM, David Ahern wrote: > Currently, ip netconf only shows data for ipv4 and ipv6 for dumps > and just ipv4 for device requests. Improve the user experience by > using the new kernel patch to dump all address families that have > registered. For example, if mpls_r

Re: [PATCH v3 1/5] netlink: extended ACK reporting

2017-04-10 Thread David Ahern
On 4/10/17 9:30 AM, Johannes Berg wrote: > On Mon, 2017-04-10 at 09:26 -0600, David Ahern wrote: >> On 4/8/17 2:24 PM, Johannes Berg wrote: >>> @@ -2300,14 +2332,35 @@ void netlink_ack(struct sk_buff *in_skb, >>> struct nlmsghdr *nlh, int err) >>>

Re: [PATCH] ipv6: Fix idev->addr_list corruption

2017-04-10 Thread David Ahern
addrconf_del_dad_work(ifa); > > + keep = keep_addr && (ifa->flags & IFA_F_PERMANENT) && > + !addr_is_local(>addr); > + if (!keep) > + list_move(>if_list, _list); > + > write_unlock_bh(>lock); yes, the list manipulation should be done under the idev->lock. thanks for fixing. Acked-by: David Ahern <d...@cumulusnetworks.com>

Re: [PATCH net-next 1/8] rtnetlink: Do not generate notifications for MTU events

2017-04-10 Thread David Ahern
On 4/10/17 9:39 AM, Vlad Yasevich wrote: > OK, so this will work for the events that are generated as a result of device > state change > (like mtu, address, and others). > > However, the original event data may be needed for other events that may be > of use to userspace like

Re: [PATCH v3 1/5] netlink: extended ACK reporting

2017-04-10 Thread David Ahern
On 4/8/17 2:24 PM, Johannes Berg wrote: > @@ -2300,14 +2332,35 @@ void netlink_ack(struct sk_buff *in_skb, struct > nlmsghdr *nlh, int err) > NLMSG_ERROR, payload, 0); > errmsg = nlmsg_data(rep); > errmsg->error = err; > - memcpy(>msg, nlh, payload >

Re: [PATCH 1/5] netlink: extended ACK reporting

2017-04-09 Thread David Ahern
On 4/8/17 2:40 PM, Jiri Pirko wrote: > Sat, Apr 08, 2017 at 08:37:01PM CEST, johan...@sipsolutions.net wrote: >> On Sat, 2017-04-08 at 20:34 +0200, Jiri Pirko wrote: >>> nla_total_size(sizeof(u32)); + if (extack && + (extack->missing_attr || extack-

Re: [PATCH v3 1/5] netlink: extended ACK reporting

2017-04-11 Thread David Ahern
On 4/11/17 1:02 AM, Johannes Berg wrote: > On Tue, 2017-04-11 at 08:59 +0200, Pablo Neira Ayuso wrote: >> CAP_ACK means: trim off the payload that the netlink error message >> is embedding, just like ICMP error does. >> >> What is exactly your concern? If the user explicitly requests this >> via

Re: [PATCH net-next] bpf: add test_progs to .gitignore

2017-04-11 Thread David Ahern
On 4/11/17 6:14 AM, Alexander Alemayhu wrote: > On Tue, Apr 11, 2017 at 01:49:10PM +0200, Daniel Borkmann wrote: >> >> Good point, we should also add '*.o' in that case for the >> TEST_GEN_FILES specified objs that clang generates. > > Think that is covered by other files but added. Would it be >

Re: [PATCH net-next] bpf: add test_progs to .gitignore

2017-04-11 Thread David Ahern
On 4/11/17 8:43 AM, Alexander Alemayhu wrote: > On Tue, Apr 11, 2017 at 08:08:24AM -0600, David Ahern wrote: >> listing each program is not a sustainable way to do this. It would be >> simpler to put build targets into a build directory and then ignore the >> build direct

WARN_ON running XDP on virtio net device

2017-04-10 Thread David Ahern
I'm hitting a WARN_ON running XDP with virtio net: [ 177.185570] [ cut here ] [ 177.187250] WARNING: CPU: 0 PID: 880 at /home/dsa/kernel.git/drivers/pci/msi.c:1251 pci_irq_vector+0x92/0x123 [ 177.190932] Modules linked in: 8021q garp mrp stp llc vrf [ 177.193473] CPU:

Re: WARN_ON running XDP on virtio net device

2017-04-10 Thread David Ahern
On 4/10/17 3:37 PM, Michael S. Tsirkin wrote: > On Mon, Apr 10, 2017 at 03:21:53PM -0600, David Ahern wrote: >> I'm hitting a WARN_ON running XDP with virtio net: > I just sent a pull request. Would appreciate reports on whether > it helps. > it does.

Re: [PATCH v3 1/5] netlink: extended ACK reporting

2017-04-11 Thread David Ahern
On 4/11/17 11:42 AM, David Miller wrote: > David, if you have a specific case where it's absolutely impossible > to resolve this when the library is converted to support extended > ACKs, please mention it. I don't have a specific library in mind. It is more the disjoint nature of a socket option

Re: [PATCH v3 1/5] netlink: extended ACK reporting

2017-04-11 Thread David Ahern
On 4/11/17 1:05 PM, David Miller wrote: > From: David Ahern <d...@cumulusnetworks.com> > Date: Tue, 11 Apr 2017 12:57:59 -0600 > >> On 4/11/17 11:42 AM, David Miller wrote: >>> David, if you have a specific case where it's absolutely impossible >>> to res

Re: Adding support for VRF traffic passed by mangle table

2017-04-03 Thread David Ahern
On 4/2/17 10:57 PM, Jack Ma wrote: > diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c > index c0cc6aa..07168d4 100644 > --- a/net/ipv4/netfilter.c > +++ b/net/ipv4/netfilter.c > @@ -46,6 +46,14 @@ int ip_route_me_harder(struct net *net, struct sk_buff > *skb, unsigned int addr_t >

Re: [PATCH] net: ipv4: fix multipath RTM_GETROUTE behavior when iif is given

2017-04-03 Thread David Ahern
On 4/3/17 10:46 AM, Florian Larysch wrote: > inet_rtm_getroute synthesizes a skeletal ICMP skb, which is passed to > ip_route_input when iif is given. If a multipath route is present for > the designated destination, ip_multipath_icmp_hash ends up being called, that function no longer exists

[PATCH net-next v2 5/8] rtnetlink: Do not generate notifications for PRECHANGEUPPER event

2017-04-11 Thread David Ahern
PRECHANGEUPPER is an internal event; do not generate userspace notifications. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 8cfb9e3c1f6e..10df445bb818

[PATCH net-next v2 0/8] rtnetlink: Cleanup user notifications for netdev events

2017-04-11 Thread David Ahern
with IFLA_EVENT patch reverted - dropped removal NETDEV_CHANGEINFODATA since it is intentionally only to send a message to userspace - dropped NOTIFY_PEERS since Vlad's says it is needed for macvlans - add patches to remove NETDEV_CHANGEUPPER and NETDEV_CHANGE_TX_QUEUE_LEN from the event list David

[PATCH net-next v2 4/8] rtnetlink: Do not generate notifications for POST_TYPE_CHANGE event

2017-04-11 Thread David Ahern
INK]11: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master br1 state UNKNOWN group default link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff Remove POST_TYPE_CHANGE from the list of notifiers that generate notifications. Signed-off-by: David Ahern <d...@cumulusnetworks.com

[PATCH net-next v2 6/8] rtnetlink: Do not generate notifications for CHANGELOWERSTATE event

2017-04-11 Thread David Ahern
CHANGELOWERSTATE is an internal event; do not generate userspace notifications. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 10df445bb818..b70e915be66d

[PATCH net-next v2 3/8] rtnetlink: Do not generate notifications for CHANGEADDR event

2017-04-11 Thread David Ahern
ate UNKNOWN group default link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff Do not send a notification for the CHANGEADDR notifier. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/core/rtne

[PATCH net-next v2 1/8] rtnetlink: Do not generate notifications for MTU events

2017-04-11 Thread David Ahern
for PRE_CHANGE_MTU and CHANGE_MTU netdev events. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/core/rtnetlink.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 58419da7961b..79ab43796b08 100644 --- a/net/core/rtnetlink.c ++

[PATCH net-next v2 2/8] rtnetlink: Do not generate notification for UDP_TUNNEL_PUSH_INFO

2017-04-11 Thread David Ahern
NETDEV_UDP_TUNNEL_PUSH_INFO is an internal notifier; nothing userspace can do so don't generate a netlink notification. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnet

[PATCH net-next v2 8/8] rtnetlink: Do not generate notifications for NETDEV_CHANGE_TX_QUEUE_LEN event

2017-04-11 Thread David Ahern
rom the list of notifiers that generate notifications. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index ef93f6c983f3..c138b6b75e59 100644 --- a/net/core/rtnetlin

[PATCH net-next v2 7/8] rtnetlink: Do not generate notifications for NETDEV_CHANGEUPPER event

2017-04-11 Thread David Ahern
NETDEV_CHANGEUPPER is an internal event; do not generate userspace notifications. Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/core/rtnetlink.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index b70e915be66d..ef93f6c983f3

Re: [PATCH v2 iproute2 net-next 1/2] iproute: Add support for ttl-propagation attribute

2017-04-11 Thread David Ahern
Shearman <rshea...@brocade.com> > --- > ip/iproute.c | 22 ++ > man/man8/ip-route.8.in | 10 +- > 2 files changed, 31 insertions(+), 1 deletion(-) > Acked-by: David Ahern <d...@cumulusnetworks.com>

Re: [PATCH v2 iproute2 net-next 2/2] iproute: Add support for MPLS LWT ttl attribute

2017-04-11 Thread David Ahern
man/man8/ip-route.8.in | 9 - > 2 files changed, 37 insertions(+), 3 deletions(-) > Acked-by: David Ahern <d...@cumulusnetworks.com>

Re: [PATCH net-next v5 1/5] netlink: extended ACK reporting

2017-04-12 Thread David Ahern
On 4/12/17 6:34 AM, Johannes Berg wrote: > diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h > index b2c9c26ea30f..7df88770e029 100644 > --- a/include/uapi/linux/netlink.h > +++ b/include/uapi/linux/netlink.h > @@ -69,6 +69,10 @@ struct nlmsghdr { > #define NLM_F_CREATE

Re: [PATCH net-next v5 5/5] netlink: pass extended ACK struct where available

2017-04-12 Thread David Ahern
On 4/12/17 8:00 AM, Jiri Pirko wrote: > Aside from the tinyfication of desc lines channel your inner Elsa and just let it go

Re: [PATCH net-next v5 0/5] netlink extended ACK reporting

2017-04-12 Thread David Ahern
On 4/12/17 6:34 AM, Johannes Berg wrote: > Changes since v4: > * use __NLMSGERR_ATTR_MAX instead of NUM_NLMSGERR_ATTRS > Dave uses the cover letter with the change history in the merge commit logs. Would be good to keep the design intent and history.

Re: [PATCH net-next v5 1/5] netlink: extended ACK reporting

2017-04-12 Thread David Ahern
t; net/netfilter/nfnetlink.c | 22 ++-- > net/netlink/af_netlink.c | 71 > ++- > net/netlink/af_netlink.h | 1 + > net/netlink/genetlink.c | 3 +- > net/xfrm/xfrm_user.c | 3 +- > 17 files changed, 153 insertions(+), 34 deletions(-) Reviewed-by: David Ahern <d...@cumulusnetworks.com>

[PATCH net-next] net: ipv6: send unsolicited NA on admin up

2017-04-12 Thread David Ahern
; add it. Fixes: 5cb04436eef6 ("ipv6: add knob to send unsolicited ND on link-layer address change") Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- net/ipv6/ndisc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index b5812b3f75

Re: [PATCH net-next 0/3] l3mdev: Improve use with main table

2017-04-12 Thread David Ahern
On 4/10/17 8:21 AM, Robert Shearman wrote: > Attempting to create a TCP socket not bound to a VRF device when a TCP > socket bound to a VRF device with the same port exists (and vice > versa) fails with EADDRINUSE. This limits the ability to use programs > in selected mixed VRF/non-VRF contexts. >

<    8   9   10   11   12   13   14   15   16   17   >