[PATCH net v2] ipv4: Avoid caching l3mdev dst on mismatched local route

2017-04-21 Thread Robert Shearman
pback") Reported-by: David Ahern <d...@cumulusnetworks.com> Suggested-by: David Ahern <d...@cumulusnetworks.com> Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/ipv4/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/rout

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

2017-04-21 Thread Robert Shearman
On 20/04/17 23:36, David Ahern wrote: 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

Re: [PATCH net] ipv4: Avoid caching dsts when lookup skipped nh oif check

2017-04-21 Thread Robert Shearman
On 20/04/17 23:18, David Ahern wrote: On 4/20/17 6:58 AM, Robert Shearman wrote: diff --git a/net/ipv4/route.c b/net/ipv4/route.c index acd69cfe2951..f667783ffd19 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2125,6 +2125,14 @@ static struct rtable *__mkroute_output(const struct

Re: [PATCH net] ipv4: Avoid caching dsts when lookup skipped nh oif check

2017-04-20 Thread Robert Shearman
On 20/04/17 16:16, David Ahern wrote: On 4/20/17 9:05 AM, Robert Shearman wrote: The key thing I think is the ip rules: $ ip rule 0:from all lookup local 1000:from all lookup [l3mdev-table] 32766:from all lookup main 32767:from all lookup default Maybe you have the local rule

Re: [PATCH net] ipv4: Avoid caching dsts when lookup skipped nh oif check

2017-04-20 Thread Robert Shearman
On 20/04/17 15:59, David Ahern wrote: On 4/20/17 8:39 AM, Robert Shearman wrote: On 20/04/17 15:21, David Ahern wrote: On 4/20/17 6:58 AM, Robert Shearman wrote: David reported that doing the following: ip li add red type vrf table 10 ip link set dev eth1 vrf red ip addr add

Re: [PATCH net] ipv4: Avoid caching dsts when lookup skipped nh oif check

2017-04-20 Thread Robert Shearman
On 20/04/17 15:21, David Ahern wrote: On 4/20/17 6:58 AM, Robert Shearman wrote: David reported that doing the following: ip li add red type vrf table 10 ip link set dev eth1 vrf red ip addr add 127.0.0.1/8 dev red ip link set dev eth1 up ip li set red up ping -c1 -w1

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

2017-04-20 Thread Robert Shearman
On 13/04/17 15:36, David Ahern wrote: On 4/13/17 6:48 AM, Robert Shearman wrote: the patches look ok to me, but in testing them I see I refcnt problem. simple reproducer: ip li add red type vrf table 254 ip link set dev eth1 vrf red ip addr add 127.0.0.1/8 dev red ip link set dev eth1 up ip li

[PATCH net] ipv4: Avoid caching dsts when lookup skipped nh oif check

2017-04-20 Thread Robert Shearman
("net: vrf: Flip IPv4 output path from FIB lookup hook to out hook") Reported-by: David Ahern <d...@cumulusnetworks.com> Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/ipv4/route.c | 8 1 file changed, 8 insertions(+) diff --git a/net/ipv4/route.c b/

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

2017-04-13 Thread Robert Shearman
On 12/04/17 17:51, David Ahern wrote: 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

[PATCH v2 iproute2 net-next 0/2] ip: Allow TTL propagation to/from IP packets to be configured

2017-04-11 Thread Robert Shearman
This patch series adds support for per-MPLS-lightweight-tunnel ttl values and per route ttl-propagation for the purposes of MPLS to be specified. Changes in v2: - use matches instead of strcmp for enabled/disabled keywords to avoid excessive typing Robert Shearman (2): iproute: Add support

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

2017-04-11 Thread Robert Shearman
Add support for setting and displaying the ttl-propagation attribute initially used by MPLS to control propagation of MPLS TTL to IPv4/IPv6 TTL/hop-limit on popping final label on a per-route basis. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- ip/iproute.c

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

2017-04-11 Thread Robert Shearman
Add support for setting and displaying the ttl attribute for MPLS IP lighweight tunnels. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- ip/iproute_lwtunnel.c | 31 +-- man/man8/ip-route.8.in | 9 - 2 files changed, 37 insertions(+), 3 del

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

2017-04-11 Thread Robert Shearman
On 11/04/17 04:43, David Ahern wrote: On 4/10/17 8:36 AM, Robert Shearman wrote: @@ -1184,6 +1192,20 @@ static int iproute_modify(int cmd, unsigned int flags, int argc, char **argv) if (rta->rta_len > RTA_LENGTH(0)) addraw_l(

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

2017-04-10 Thread Robert Shearman
Add support for setting and displaying the ttl-propagation attribute initially used by MPLS to control propagation of MPLS TTL to IPv4/IPv6 TTL/hop-limit on popping final label on a per-route basis. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- ip/iproute.c

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

2017-04-10 Thread Robert Shearman
Add support for setting and displaying the ttl attribute for MPLS IP lighweight tunnels. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- ip/iproute_lwtunnel.c | 31 +-- man/man8/ip-route.8.in | 9 - 2 files changed, 37 insertions(+), 3 del

[PATCH iproute2 net-next 0/2] ip: Allow TTL propagation to/from IP packets to be configured

2017-04-10 Thread Robert Shearman
This patch series adds support for per-MPLS-lightweight-tunnel ttl values and per route ttl-propagation for the purposes of MPLS to be specified. Robert Shearman (2): iproute: Add support for ttl-propagation attribute iproute: Add support for MPLS LWT ttl attribute ip/iproute.c

[PATCH net-next 3/3] l3mdev: Fix lookup in local table when using main table

2017-04-10 Thread Robert Shearman
of the rule for looking up in the main table isn't respected. Fix these two aspects by not returning a match if the l3mdev's table id is the main table. Processing will then proceed normally to the default rules and do the appropriate lookups. Signed-off-by: Robert Shearman <rshea...@brocade.com> --

[PATCH net-next 1/3] ipv6: Fix route handling when using l3mdev set to main table

2017-04-10 Thread Robert Shearman
. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/ipv6/addrconf.c | 12 +--- net/ipv6/route.c| 23 ++- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 67ec87ea5fb6..937c35581a28

[PATCH net-next 2/3] ipv4: Fix route handling when using l3mdev set to main table

2017-04-10 Thread Robert Shearman
then defaulting to RT_TABLE_MAIN and then subsequently doing a translation from RT_TABLE_MAIN to RT_TABLE_LOCAL. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/ipv4/af_inet.c | 4 +++- net/ipv4/fib_frontend.c | 14 +- net/ipv4/raw.c | 5 - 3 files c

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

2017-04-10 Thread Robert Shearman
the l3mdev be aware of the special semantics of the main table and fixing issues arising from the split local/main tables. A VRF master device created linking to the main table and used for these programs in the same way as those created for VRF tables can. Robert Shearman (3): ipv6: Fix route

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

2017-04-03 Thread Robert Shearman
| 61 + net/mpls/mpls_iptunnel.c| 13 ++- 4 files changed, 196 insertions(+), 93 deletions(-) Acked-by: Robert Shearman <rshea...@brocade.com>

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

2017-03-29 Thread Robert Shearman
On 28/03/17 23:19, David Ahern wrote: 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> Acked-by: Robert She

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

2017-03-28 Thread Robert Shearman
(-) Acked-by: Robert Shearman <rshea...@brocade.com>

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

2017-03-28 Thread Robert Shearman
On 28/03/17 04:08, Eric W. Biederman wrote: David Ahern <d...@cumulusnetworks.com> writes: 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

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

2017-03-27 Thread Robert Shearman
On 25/03/17 19:15, Eric W. Biederman wrote: David Ahern writes: Bump the maximum number of labels for MPLS routes from 2 to 12. To keep memory consumption in check the labels array is moved to the end of mpls_nh and mpls_iptunnel_encap structs as a 0-sized array.

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

2017-03-27 Thread Robert Shearman
: Don't show nexthop if device has been deleted mpls: Delete route when all nexthops have been deleted net/mpls/af_mpls.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) Acked-by: Robert Shearman <rshea...@brocade.com>

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

2017-03-24 Thread Robert Shearman
On 24/03/17 01:02, David Ahern wrote: 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> Good catch. Acked-by: Robert Shearman <rshea...@brocade.com>

Re: [PATCH] net: mpls: Fix nexthop alive tracking on down events

2017-03-14 Thread Robert Shearman
a comment from checkpatch: WARNING: Prefer WRITE_ONCE(, ) over ACCESS_ONCE() = Fixes: c89359a42e2a4 ("mpls: support for dead routes") Signed-off-by: David Ahern <d...@cumulusnetworks.com> Acked-by: Robert Shearman <rshea...@brocade.com>

Re: [PATCH] mpls: Do not decrement alive counter for unregister events

2017-03-13 Thread Robert Shearman
On 10/03/17 22:11, David Ahern wrote: Multipath routes can be rendered usesless when a device in one of the paths is deleted. For example: $ ip -f mpls ro ls 100 nexthop as to 200 via inet 172.16.2.2 dev virt12 nexthop as to 300 via inet 172.16.3.2 dev br0 101 nexthop

[PATCH net-next v3 2/2] mpls: allow TTL propagation from IP packets to be configured

2017-03-10 Thread Robert Shearman
L that can be propagated). Signed-off-by: Robert Shearman <rshea...@brocade.com> --- Documentation/networking/mpls-sysctl.txt | 8 include/net/mpls_iptunnel.h | 2 + include/net/netns/mpls.h | 1 + include/uapi/linux/mpls_iptunnel.h | 2 + ne

[PATCH net-next v3 1/2] mpls: allow TTL propagation to IP packets to be configured

2017-03-10 Thread Robert Shearman
. This is done through the addition of a new per-namespace sysctl, "net.mpls.ip_ttl_propagate", which defaults to enabled. If the per-route attribute is set (either enabled or disabled) then it overrides the global configuration. Signed-off-by: Robert Shearman <rshea...@brocade.com> --

[PATCH net-next v3 0/2] mpls: allow TTL propagation to/from IP packets to be configured

2017-03-10 Thread Robert Shearman
ute/per-LWT configurability as suggested by Eric Biederman - split into two patches for ease of review Robert Shearman (2): mpls: allow TTL propagation to IP packets to be configured mpls: allow TTL propagation from IP packets to be configured Documentation/networking/mpls-sysctl.txt |

Re: [PATCH net-next v2 2/2] mpls: allow TTL propagation from IP packets to be configured

2017-03-10 Thread Robert Shearman
On 10/03/17 02:54, David Ahern wrote: On 3/7/17 5:46 PM, Robert Shearman wrote: @@ -78,6 +70,29 @@ static int mpls_xmit(struct sk_buff *skb) tun_encap_info = mpls_lwtunnel_encap(dst->lwtstate); + /* Obtain the ttl */ + if (dst->ops->family =

Re: [PATCH net-next v2 1/2] mpls: allow TTL propagation to IP packets to be configured

2017-03-10 Thread Robert Shearman
On 10/03/17 02:00, David Ahern wrote: On 3/7/17 5:46 PM, Robert Shearman wrote: @@ -244,24 +245,33 @@ static bool mpls_egress(struct mpls_route *rt, struct sk_buff *skb, payload_type = ip_hdr(skb)->version; switch (payload_type) { - case MPT_I

Re: [PATCH net-next v2 1/2] mpls: allow TTL propagation to IP packets to be configured

2017-03-10 Thread Robert Shearman
On 10/03/17 02:40, David Ahern wrote: On 3/7/17 5:46 PM, Robert Shearman wrote: diff --git a/include/net/netns/mpls.h b/include/net/netns/mpls.h index d29203651c01..58e0e46c4a5c 100644 --- a/include/net/netns/mpls.h +++ b/include/net/netns/mpls.h @@ -10,7 +10,9 @@ struct ctl_table_header

[PATCH iproute2] man: Fix formatting of vrf parameter of ip-link show command

2017-03-09 Thread Robert Shearman
Add missing opening " [" for the vrf parameter. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- man/man8/ip-link.8.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 83ffb6357f7d..3f5d57c28885 10064

[PATCH iproute2] iplink: add support for afstats subcommand

2017-03-09 Thread Robert Shearman
TX: bytes packets errors dropped 7232 113 0 0 Signed-off-by: Robert Shearman <rshea...@brocade.com> --- ip/ip_common.h| 2 + ip/ipaddress.c| 2 +- ip/iplink.c | 151 ++ man/m

[PATCH net-next v2 2/2] mpls: allow TTL propagation from IP packets to be configured

2017-03-07 Thread Robert Shearman
L that can be propagated). Signed-off-by: Robert Shearman <rshea...@brocade.com> --- Documentation/networking/mpls-sysctl.txt | 8 include/net/mpls_iptunnel.h | 2 + include/net/netns/mpls.h | 1 + include/uapi/linux/mpls_iptunnel.h | 2 + ne

[PATCH net-next v2 1/2] mpls: allow TTL propagation to IP packets to be configured

2017-03-07 Thread Robert Shearman
. This is done through the addition of a new per-namespace sysctl, "net.mpls.ip_ttl_propagate", which defaults to enabled. If the per-route attribute is set (either enabled or disabled) then it overrides the global configuration. Signed-off-by: Robert Shearman <rshea...@brocade.com> --

[PATCH net-next v2 0/2] mpls: allow TTL propagation to/from IP packets to be configured

2017-03-07 Thread Robert Shearman
lit into two patches for ease of review Robert Shearman (2): mpls: allow TTL propagation to IP packets to be configured mpls: allow TTL propagation from IP packets to be configured Documentation/networking/mpls-sysctl.txt | 19 ++ include/net/mpls_iptunnel.h | 2 + include/

Re: [PATCH net-next v2] net: mpls: Add support for netconf

2017-02-20 Thread Robert Shearman
On 20/02/17 16:03, David Ahern wrote: Add netconf support to MPLS. Allows userpsace to learn and be notified of changes to 'input' enable setting per interface. Acked-by: Robert Shearman <rshea...@brocade.com> Acked-by: Nicolas Dichtel <nicolas.dich...@6wind.com> Signed-off-by:

Re: [PATCH net-next] net: mpls: Add support for netconf

2017-02-20 Thread Robert Shearman
On 20/02/17 14:53, David Ahern wrote: On 2/20/17 3:01 AM, Robert Shearman wrote: On 18/02/17 01:36, David Ahern wrote: Add netconf support to MPLS. Allows userpsace to learn and be notified of changes to 'input' enable setting per interface. Signed-off-by: David Ahern &l

Re: [PATCH net-next] net: mpls: Add support for netconf

2017-02-20 Thread Robert Shearman
On 18/02/17 01:36, David Ahern wrote: Add netconf support to MPLS. Allows userpsace to learn and be notified of changes to 'input' enable setting per interface. Signed-off-by: David Ahern --- include/uapi/linux/netconf.h | 1 + include/uapi/linux/rtnetlink.h |

Re: [PATCH net-next] mpls: allow TTL propagation to/from IP packets to be configured

2017-01-31 Thread Robert Shearman
On 31/01/17 01:09, David Ahern wrote: On 1/30/17 1:36 PM, Robert Shearman wrote: @@ -243,24 +245,29 @@ static bool mpls_egress(struct mpls_route *rt, struct sk_buff *skb, payload_type = ip_hdr(skb)->version; switch (payload_type) { - case MPT_I

Re: [PATCH net-next] mpls: allow TTL propagation to/from IP packets to be configured

2017-01-31 Thread Robert Shearman
On 31/01/17 00:41, David Ahern wrote: On 1/30/17 1:36 PM, Robert Shearman wrote: It is sometimes desirable to present an MPLS transport network as a single hop to traffic transiting it because it prevents confusion when diagnosing failures. An example of where confusion can be generated is when

Re: [PATCH net-next] mpls: allow TTL propagation to/from IP packets to be configured

2017-01-31 Thread Robert Shearman
On 31/01/17 00:17, Eric W. Biederman wrote: Robert Shearman <rshea...@brocade.com> writes: It is sometimes desirable to present an MPLS transport network as a single hop to traffic transiting it because it prevents confusion when diagnosing failures. An example of where confusi

[PATCH net-next] mpls: allow TTL propagation to/from IP packets to be configured

2017-01-30 Thread Robert Shearman
l". Signed-off-by: Robert Shearman <rshea...@brocade.com> --- Documentation/networking/mpls-sysctl.txt | 19 + include/net/netns/mpls.h | 3 ++ net/mpls/af_mpls.c | 70 net/mpls/mpls_iptunnel.c

Re: [PATCH net] net: Avoid receiving packets with an l3mdev on unbound UDP sockets

2017-01-30 Thread Robert Shearman
On 30/01/17 20:01, David Miller wrote: From: David Ahern <d...@cumulusnetworks.com> Date: Mon, 30 Jan 2017 11:52:01 -0700 On 1/26/17 11:02 AM, Robert Shearman wrote: Packets arriving in a VRF currently are delivered to UDP sockets that aren't bound to any interface. TCP de

[PATCH net] net: Avoid receiving packets with an l3mdev on unbound UDP sockets

2017-01-26 Thread Robert Shearman
to the existing tcp_l3mdev_accept, namely to allow a process to have a VRF-global listen socket. Have this default to off as this is the behaviour that users will expect, given that there is no explicit mechanism to set unmodified VRF-unaware application into a default VRF. Signed-off-by: Robert

[PATCH net v3 1/2] net: Specify the owning module for lwtunnel ops

2017-01-24 Thread Robert Shearman
Modules implementing lwtunnel ops should not be allowed to unload while there is state alive using those ops, so specify the owning module for all lwtunnel ops. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- include/net/lwtunnel.h| 2 ++ net/core/lwt_bpf.c| 1 + ne

[PATCH net v3 0/2] net: Fix oops on state free after lwt module unload

2017-01-24 Thread Robert Shearman
lwt state, not just those ops implementing destroy_state, as also suggested by DaveM. - rebased on top of David Ahern's lwtunnel changes Robert Shearman (2): net: Specify the owning module for lwtunnel ops lwtunnel: Fix oops on state free after encap module unload include/net/lwtunnel.h

[PATCH net v3 2/2] lwtunnel: Fix oops on state free after encap module unload

2017-01-24 Thread Robert Shearman
elease the reference when freeing the state. Fixes: 1104d9ba443a ("lwtunnel: Add destroy state operation") Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/core/lwtunnel.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/core/lwtunnel.c

Re: [PATCH net v2 2/2] lwtunnel: Fix oops on state free after encap module unload

2017-01-24 Thread Robert Shearman
On 23/01/17 20:42, David Miller wrote: From: Robert Shearman <rshea...@brocade.com> Date: Sat, 21 Jan 2017 00:21:26 + @@ -115,8 +115,12 @@ int lwtunnel_build_state(struct net_device *dev, u16 encap_type, ret = -EOPNOTSUPP; rcu_read_lock(); Here 'ret' equals -EOPN

[PATCH net v2 1/2] net: Specify the owning module for lwtunnel ops

2017-01-20 Thread Robert Shearman
Modules implementing lwtunnel ops should not be allowed to unload while there is state alive using those ops, so specify the owning module for all lwtunnel ops. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- include/net/lwtunnel.h| 2 ++ net/core/lwt_bpf.c| 1 + ne

[PATCH net v2 0/2] net: Fix oops on state free after lwt module unload

2017-01-20 Thread Robert Shearman
. - rebased on top of David Ahern's lwtunnel changes Robert Shearman (2): net: Specify the owning module for lwtunnel ops lwtunnel: Fix oops on state free after encap module unload include/net/lwtunnel.h| 2 ++ net/core/lwt_bpf.c| 1 + net/core/lwtunnel.c | 9 +++-- net

[PATCH net v2 2/2] lwtunnel: Fix oops on state free after encap module unload

2017-01-20 Thread Robert Shearman
elease the reference when freeing the state. Fixes: 1104d9ba443a ("lwtunnel: Add destroy state operation") Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/core/lwtunnel.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/core/lwtunnel.c

Re: [PATCH net 0/2] net: Fix oops on state free after lwt module unload

2017-01-20 Thread Robert Shearman
On 20/01/17 17:03, David Miller wrote: From: Robert Shearman <rshea...@brocade.com> Date: Wed, 18 Jan 2017 15:32:01 + This patchset fixes an oops in lwtstate_free and a memory leak that would otherwise be exposed by ensuring that references are taken on modules that need to stay

Re: [PATCH net] net: mpls: Fix multipath selection for LSR use case

2017-01-20 Thread Robert Shearman
and IPv6 addresses in the network header and icmp/tcp/udp traffic for ipv4 and ipv6 are distributed across the nexthops. Fixes: 1c78efa8319ca ("mpls: flow-based multipath selection") Signed-off-by: David Ahern <d...@cumulusnetworks.com> Acked-by: Robert Shearman <rshea...@broca

[PATCH net 0/2] net: Fix oops on state free after lwt module unload

2017-01-18 Thread Robert Shearman
are changed specify the owner module in the ops. The intersection of those two sets is just ila at the moment. Robert Shearman (2): lwtunnel: Fix oops on state free after encap module unload ila: Fix memory leak of lwt dst cache on module unload include/net/lwtunnel.h | 2 ++ net/core

[PATCH net 1/2] lwtunnel: Fix oops on state free after encap module unload

2017-01-18 Thread Robert Shearman
refcount the module when the ops implements ->destroy_state so it can't be unloaded while there is still state around. Fixes: 1104d9ba443a ("lwtunnel: Add destroy state operation") Signed-off-by: Robert Shearman <rshea...@brocade.com> --- include/net/lwtunnel.h | 2 ++

[PATCH net 2/2] ila: Fix memory leak of lwt dst cache on module unload

2017-01-18 Thread Robert Shearman
ila route is deleted. Fixes: 79ff2fc31e0f ("ila: Cache a route to translated address") Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/ipv6/ila/ila_lwt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ila/ila_lwt.c b/net/ipv6/ila/ila_lwt.c in

Re: [PATCH net] lwtunnel: fix autoload of lwt modules

2017-01-17 Thread Robert Shearman
On 17/01/17 17:07, David Ahern wrote: On 1/17/17 3:04 AM, Robert Shearman wrote: Is it safe to release the rtnl lock here? E.g. neither fib_get_nhs nor fib_create_info take a reference on the device and further up inet_rtm_newroute has a pointer to the struct fib_table without taking

Re: [PATCH net] lwtunnel: fix autoload of lwt modules

2017-01-17 Thread Robert Shearman
On 17/01/17 05:33, David Ahern wrote: Trying to add an mpls encap route when the MPLS modules are not loaded hangs. For example: CONFIG_MPLS=y CONFIG_NET_MPLS_GSO=m CONFIG_MPLS_ROUTING=m CONFIG_MPLS_IPTUNNEL=m $ ip route add 10.10.10.10/32 encap mpls 100 via inet 10.100.1.2

[PATCH net-next v2 1/2] net: AF-specific RTM_GETSTATS attributes

2017-01-16 Thread Robert Shearman
multiple requests/dumps to retrieve them all. Signed-off-by: Robert Shearman <rshea...@brocade.com> Acked-by: Roopa Prabhu <ro...@cumulusnetworks.com> --- include/net/rtnetlink.h | 4 include/uapi/linux/if_link.h | 1 + net/core/rtnetlink.c

[PATCH net-next v2 0/2] mpls: Packet stats

2017-01-16 Thread Robert Shearman
Changes in v2: - make incrementing IPv6 stats in mpls_stats_inc_outucastpkts conditional on CONFIG_IPV6 to fix build with CONFIG_IPV6=n Robert Shearman (2): net: AF-specific RTM_GETSTATS attributes mpls: Packet stats include/net/rtnetlink.h | 4 + include/uapi/linux/if_lin

[PATCH net-next v2 2/2] mpls: Packet stats

2017-01-16 Thread Robert Shearman
nested attribute. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- include/uapi/linux/mpls.h | 30 net/mpls/af_mpls.c| 181 -- net/mpls/internal.h | 58 ++- net/mpls/mpls_iptunnel.c | 11 ++- 4

Re: [PATCH net-next 2/2] mpls: Packet stats

2017-01-16 Thread Robert Shearman
On 14/01/17 06:41, kbuild test robot wrote: Hi Robert, [auto build test ERROR on net-next/master] url:

[PATCH net-next 2/2] mpls: Packet stats

2017-01-13 Thread Robert Shearman
nested attribute. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- include/uapi/linux/mpls.h | 30 net/mpls/af_mpls.c| 179 -- net/mpls/internal.h | 58 ++- net/mpls/mpls_iptunnel.c | 11 ++- 4

[PATCH net-next 1/2] net: AF-specific RTM_GETSTATS attributes

2017-01-13 Thread Robert Shearman
multiple requests/dumps to retrieve them all. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- include/net/rtnetlink.h | 4 include/uapi/linux/if_link.h | 1 + net/core/rtnetlink.c | 50 3 files changed, 55 inse

[PATCH net-next 0/2] mpls: Packet stats

2017-01-13 Thread Robert Shearman
The first patch adds the rtnl infrastructure for this, including a new callbacks to per-AF ops of fill_stats_af and get_stats_af_size. The second patch records MPLS stats and makes use of the infrastructure to export them. The rtnl infrastructure could also be used to export IPv6 stats in the future

Re: [net PATCH 2/2] ipv4: Drop suffix update from resize code

2016-12-05 Thread Robert Shearman
On 05/12/16 17:28, David Miller wrote: From: Robert Shearman <rshea...@brocade.com> Date: Mon, 5 Dec 2016 15:05:18 + On 01/12/16 12:27, Alexander Duyck wrote: It has been reported that update_suffix can be expensive when it is called on a large node in which most of the suffix l

Re: [net PATCH 2/2] ipv4: Drop suffix update from resize code

2016-12-05 Thread Robert Shearman
) Reported-by: Robert Shearman <rshea...@brocade.com> Signed-off-by: Alexander Duyck <alexander.h.du...@intel.com> $ time sudo ip route restore < ~/allroutes RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exis

Re: [net PATCH 1/2] ipv4: Drop leaf from suffix pull/push functions

2016-12-05 Thread Robert Shearman
: 5405afd1a306 ("fib_trie: Add tracking value for suffix length") Suggested-by: Robert Shearman <rshea...@brocade.com> Signed-off-by: Alexander Duyck <alexander.h.du...@intel.com> This addresses an issue in the current code whereby when a fib alias is removed from a leaf when t

Re: [PATCH net] fib_trie: Avoid expensive update of suffix length when not required

2016-12-02 Thread Robert Shearman
On 01/12/16 18:29, Alexander Duyck wrote: On Wed, Nov 30, 2016 at 4:27 PM, Robert Shearman <rshea...@brocade.com> wrote: On 29/11/16 23:14, Alexander Duyck wrote: On Tue, Nov 29, 2016 at 9:46 AM, Robert Shearman <rshea...@brocade.com> Fixes: 5405afd1a306 ("fib_trie: A

Re: [PATCH net] fib_trie: Avoid expensive update of suffix length when not required

2016-11-30 Thread Robert Shearman
On 29/11/16 23:14, Alexander Duyck wrote: On Tue, Nov 29, 2016 at 9:46 AM, Robert Shearman <rshea...@brocade.com> wrote: With certain distributions of routes it can take a long time to add and delete further routes at scale. For example, with a route for 10.37.96.0/20 present it tak

[PATCH net] fib_trie: Avoid expensive update of suffix length when not required

2016-11-29 Thread Robert Shearman
leafs and because it is close to the status quo. Fixes: 5405afd1a306 ("fib_trie: Add tracking value for suffix length") Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/ipv4/fib_trie.c | 86 ++--- 1 file changed, 62 i

Re: [PATCH] mpls: Add missing RCU-bh read side critical section locking in output path

2016-06-21 Thread Robert Shearman
_read_{,un}lock_bh() around the code that expects to be treated as an RCU-bh read side critical section. Signed-off-by: David Barroso <dbarr...@fastly.com> Signed-off-by: Lennert Buytenhek <lbuyten...@fastly.com> LGTM too. Acked-by: Robert Shearman <rshea...@brocade.com>

Re: [PATCH net-next] mpls: allow routes on ipgre devices

2016-06-16 Thread Robert Shearman
for testing this and making the necessary change. Acked-by: Robert Shearman <rshea...@brocade.com> Signed-off-by: Simon Horman <simon.hor...@netronome.com>

Re: [PATCH net-next 1/2] mpls: packet stats

2016-02-19 Thread Robert Shearman
On 16/02/16 20:26, roopa wrote: On 2/16/16, 7:41 AM, David Miller wrote: Statistics not provided via netlink are useless in real installations. In fact I would say to forego the proc interface entirely, it's a second class citizen for statistics gathering and has a non-triviel per-device cost

[PATCH net-next v2 1/3] lwtunnel: autoload of lwt modules

2016-02-19 Thread Robert Shearman
in response to RTM_GETxxx messages. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- include/net/lwtunnel.h | 4 +++- net/core/lwtunnel.c| 37 + 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/include/net/lwtunnel.h b/include/net/lwtu

[PATCH net-next v2 3/3] ila: autoload module

2016-02-19 Thread Robert Shearman
Avoid users having to manually load the module by adding a module alias allowing it to be autoloaded by the lwt infra. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/ipv6/ila/ila_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ila/ila_common.c b/net/ip

[PATCH net-next v2 2/3] mpls: autoload lwt module

2016-02-19 Thread Robert Shearman
Avoid users having to manually load the module by adding a module alias allowing it to be autoloaded by the lwt infra. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/mpls/mpls_iptunnel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/mpls/mpls_iptunnel.c b/ne

[PATCH net-next v2 0/3] lwtunnel: autoload of lwt modules

2016-02-19 Thread Robert Shearman
o autoload modules registering lwt operations for lwt implementations not using a net device so that users don't have to manually load the modules. Robert Shearman (3): lwtunnel: autoload of lwt modules mpls: autoload lwt module ila: autoload module include/net/lwtunnel.h| 4 +++- net/core/

Re: [PATCH net-next 1/3] lwtunnel: autoload of lwt modules

2016-02-16 Thread Robert Shearman
On 15/02/16 21:33, Eric W. Biederman wrote: Robert Shearman <rshea...@brocade.com> writes: @@ -85,6 +109,14 @@ int lwtunnel_build_state(struct net_device *dev, u16 encap_type, ret = -EOPNOTSUPP; rcu_read_lock(); ops = rcu_dereference(lwtun_encaps[encap_type]); +

Re: [PATCH net-next 1/3] lwtunnel: autoload of lwt modules

2016-02-15 Thread Robert Shearman
On 15/02/16 16:32, Jiri Benc wrote: On Mon, 15 Feb 2016 16:22:08 +, Robert Shearman wrote: Yeah, it's the C preprocessor. MODULE_ALIAS_RTNL_LWT includes the string for the encap type in the module alias, and since the LWT encap types are defined as enums this is symbolic name. I can't see

Re: [PATCH net-next 1/3] lwtunnel: autoload of lwt modules

2016-02-15 Thread Robert Shearman
On 15/02/16 16:02, Jiri Benc wrote: On Mon, 15 Feb 2016 15:42:01 +, Robert Shearman wrote: +static const char *lwtunnel_encap_str(enum lwtunnel_encap_types encap_type) +{ + switch (encap_type) { + case LWTUNNEL_ENCAP_MPLS: + return "LWTUNNEL_ENCAP

[PATCH net-next 2/3] mpls: autoload lwt module

2016-02-15 Thread Robert Shearman
Avoid users having to manually load the module by adding a module alias allowing it to be autoloaded by the lwt infra. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/mpls/mpls_iptunnel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/mpls/mpls_iptunnel.c b/ne

[PATCH net-next 1/3] lwtunnel: autoload of lwt modules

2016-02-15 Thread Robert Shearman
device so that users don't have to manually load the modules. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- include/net/lwtunnel.h | 4 +++- net/core/lwtunnel.c| 32 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/inclu

[PATCH net-next 3/3] ila: autoload module

2016-02-15 Thread Robert Shearman
Avoid users having to manually load the module by adding a module alias allowing it to be autoloaded by the lwt infra. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/ipv6/ila/ila_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ila/ila_common.c b/net/ip

[PATCH net-next 0/3] lwtunnel: autoload of lwt modules

2016-02-15 Thread Robert Shearman
device so that users don't have to manually load the modules. Robert Shearman (3): lwtunnel: autoload of lwt modules mpls: autoload lwt module ila: autoload module include/net/lwtunnel.h| 4 +++- net/core/lwtunnel.c | 32 net/ipv6/ila

Re: [PATCH net-next 1/2] nsh: encapsulation module

2016-02-11 Thread Robert Shearman
On 11/02/16 11:35, Brian Russell wrote: ... diff --git a/include/net/nsh.h b/include/net/nsh.h new file mode 100644 index 000..7a5fb95 --- /dev/null +++ b/include/net/nsh.h @@ -0,0 +1,158 @@ +/* + * Network Service Header (NSH) inserted onto encapsulated packets + * or frames to realize

Re: [PATCH net-next 2/2] mpls: allow TTL propagation to/from IP packets to be configured

2016-02-09 Thread Robert Shearman
On 06/02/16 18:36, Eric W. Biederman wrote: Robert Shearman <rshea...@brocade.com> writes: It is sometimes desirable to present an MPLS transport network as a single hop to traffic transiting it because it prevents confusion when diagnosing failures. An example of where confusi

Re: [PATCH net-next 1/2] mpls: packet stats

2016-02-08 Thread Robert Shearman
On 06/02/16 10:58, Francois Romieu wrote: Robert Shearman <rshea...@brocade.com> : [...] diff --git a/net/mpls/Makefile b/net/mpls/Makefile index 9ca923625016..6fdd61b9eae3 100644 --- a/net/mpls/Makefile +++ b/net/mpls/Makefile [...] @@ -98,6 +94,29 @@ bool mpls_pkt_too_big(const

[PATCH net-next 1/2] mpls: packet stats

2016-02-05 Thread Robert Shearman
not use per-CPU counters for these fields. The IPv6 proc code was used as an inspiration for the proc code here, both in terms of the implementation as well as the location of the per-device stats proc files: /proc/net/dev_snmp_mpls/. Signed-off-by: Robert Shearman <rshea...@brocade.

[PATCH net-next 2/2] mpls: allow TTL propagation to/from IP packets to be configured

2016-02-05 Thread Robert Shearman
l". Signed-off-by: Robert Shearman <rshea...@brocade.com> --- Documentation/networking/mpls-sysctl.txt | 19 + include/net/netns/mpls.h | 3 ++ net/mpls/af_mpls.c | 70 net/mpls/mpls_iptunnel.c

[PATCH net-next 0/2] mpls: packet stats and ttl propagation config

2016-02-05 Thread Robert Shearman
This patch series implements new bits of mpls functionality: keeping statistics on packets as they pass through the box and allowing ttl propagation to be configured. Robert Shearman (2): mpls: packet stats mpls: allow TTL propagation to/from IP packets to be configured Documentation

[PATCH net 1/4] mpls: validate L2 via address length

2015-12-10 Thread Robert Shearman
route support"), but got lost in the refactoring, so add it back, applying it to all nexthops in multipath routes. Fixes: f8efb73c97e2 ("mpls: multipath route support") Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/mpls/af_mpls.c | 4 1 file changed, 4 inser

[PATCH net 0/4] mpls: fixes for nexthops without via addresses

2015-12-10 Thread Robert Shearman
These four fixes all apply to the case of having an mpls route with an output device, but without a nexthop. Patches 2 and 3 could really have been combined in one patch, but I wanted to separate the fix for some recent breakage from the fix for a day-1 issue. Robert Shearman (4): mpls

[PATCH net 2/4] mpls: don't dump RTA_VIA attribute if not specified

2015-12-10 Thread Robert Shearman
ted before was invalid and as such userspace wouldn't be expecting it. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/mpls/af_mpls.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 3be29cb1f658..ac1c116aba

[PATCH net 4/4] mpls: make via address optional for multipath routes

2015-12-10 Thread Robert Shearman
the RTA_MULTIPATH attribute is being parsed so that both forms of specifying the route work. Signed-off-by: Robert Shearman <rshea...@brocade.com> --- net/mpls/af_mpls.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c

  1   2   >