[PATCH net] vrf: check the original netdevice for generating redirect

2018-06-01 Thread Stephen Suryaputra
Use the right device to determine if redirect should be sent especially when using vrf. Same as well as when sending the redirect. Signed-off-by: Stephen Suryaputra --- net/ipv6/ip6_output.c | 3 ++- net/ipv6/ndisc.c | 6 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git

VRF destination unreachable

2018-02-23 Thread Stephen Suryaputra
Greetings, We found that ICMP destination unreachable isn't sent if VRF forwarding isn't configured, i.e. /proc/sys/net/ipv4/conf//forwarding isn't set. The relevant code is: static int ip_error(struct sk_buff *skb) { ... // in_dev is the vrf net_device if

Re: VRF destination unreachable

2018-02-27 Thread Stephen Suryaputra
Feb 23, 2018 at 3:58 PM, David Ahern <dsah...@gmail.com> wrote: > On 2/23/18 10:49 AM, Stephen Suryaputra wrote: >> Greetings, >> >> We found that ICMP destination unreachable isn't sent if VRF >> forwarding isn't configured, i.e. >> /proc/sys/net/ip

[PATCH net] vrf: check forwarding on the original netdevice when generating ICMP dest unreachable

2018-02-27 Thread Stephen Suryaputra
When ip_error() is called the device is the l3mdev master instead of the original device. So the forwarding check should be on the original one. Signed-off-by: Stephen Suryaputra <ssuryae...@gmail.com> --- net/ipv4/route.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff

[PATCH net-next] Per interface IPv4 stats (CONFIG_IP_IFSTATS_TABLE)

2018-04-11 Thread Stephen Suryaputra
This is enhanced from the proposed patch by Igor Maravic in 2011 to support per interface IPv4 stats. The enhancement is mainly adding a kernel configuration option CONFIG_IP_IFSTATS_TABLE. Signed-off-by: Stephen Suryaputra <ssuryae...@gmail.com> --- drivers/net/vrf.c

Re: [PATCH net-next] Per interface IPv4 stats (CONFIG_IP_IFSTATS_TABLE)

2018-04-11 Thread Stephen Suryaputra
, Stephen Hemminger <step...@networkplumber.org> wrote: > On Tue, 10 Apr 2018 22:55:35 -0400 > Stephen Suryaputra <ssuryae...@gmail.com> wrote: > >> This is enhanced from the proposed patch by Igor Maravic in 2011 to >> support per interface IPv4 stats. The enhance

Re: [PATCH net-next] Per interface IPv4 stats (CONFIG_IP_IFSTATS_TABLE)

2018-04-12 Thread Stephen Suryaputra
Thanks for the feedbacks. Please see the detail below: On Wed, Apr 11, 2018 at 3:37 PM, Julian Anastasov wrote: [snip] >> - __IP_INC_STATS(net, IPSTATS_MIB_INHDRERRORS); >> + __IP_INC_STATS(net, skb_dst(skb)->dev, IPSTATS_MIB_INHDRERRORS); > > May be skb->dev if we

[PATCH net-next, v2] Per interface IPv4 stats (CONFIG_IP_IFSTATS_TABLE)

2018-04-20 Thread Stephen Suryaputra
that the existing per interface IPv6 stats aren't affected when the option isn't enabled. - Restore the order of calling ipv4_proc_init(). Signed-off-by: Stephen Suryaputra <ssuryae...@gmail.com> --- drivers/net/vrf.c | 2 +- include/linux/inetdevice.h | 22 ++ inclu

[PATCH net] Count IPv6 interface receive statistics on the ingress netdev

2018-04-16 Thread Stephen Suryaputra
The statistics such as InHdrErrors should be counted on the ingress netdev rather than on the dev from the dst, which is the egress. Signed-off-by: Stephen Suryaputra <ssuryae...@gmail.com> --- include/net/addrconf.h | 14 +++ net/ipv6/exthdrs.c

[PATCH net,v2] vrf: check forwarding on the original netdevice when generating ICMP dest unreachable

2018-02-28 Thread Stephen Suryaputra
When ip_error() is called the device is the l3mdev master instead of the original device. So the forwarding check should be on the original one. Changes from v1: - Only need to reset the device on which __in_dev_get_rcu() is done (per David Ahern). Signed-off-by: Stephen Suryaputra <ssur

Re: [PATCH net,v2] vrf: check forwarding on the original netdevice when generating ICMP dest unreachable

2018-02-28 Thread Stephen Suryaputra
/ if (!in_dev) goto out; On Wed, Feb 28, 2018 at 10:49 AM, David Ahern <dsah...@gmail.com> wrote: > On 2/28/18 7:46 AM, Stephen Suryaputra wrote: >> When ip_error() is called the device is the l3mdev master instead of the >> original device. So the forwarding check should

[PATCH net,v3] vrf: check forwarding on the original netdevice when generating ICMP dest unreachable

2018-02-28 Thread Stephen Suryaputra
the device on which __in_dev_get_rcu() is done (per David Ahern). Signed-off-by: Stephen Suryaputra <ssuryae...@gmail.com> --- net/ipv4/route.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a4f44d8..9a29225

[PATCH net-next] IPv6 ifstats separation

2018-10-04 Thread Stephen Suryaputra
Separate IPv6 ifstats into the ones that are hit on fast path and the ones that aren't. The ones that are not can be removed as needed using sysctls. Signed-off-by: Stephen Suryaputra --- include/linux/ipv6.h | 3 + include/net/if_inet6.h| 3 +- include/net/ipv6.h| 28

[PATCH net-next,v2] IPv6 ifstats separation

2018-10-04 Thread Stephen Suryaputra
that but it enables all but 6 counters be optional. Those optional counters however are still enabled by default to preserve the current behavior. Changes from v1: - More elaborate changelog (per Eric Dumazet) Signed-off-by: Stephen Suryaputra --- include/linux/ipv6.h | 3 + include/net/if_inet6

Re: [PATCH net-next,v2] IPv6 ifstats separation

2018-10-05 Thread Stephen Suryaputra
On Thu, Oct 4, 2018 at 4:42 PM Eric Dumazet wrote: > > How have you decided some counters can be 'slow' and other 'fast' ? > > I can tell you I see many ultra-fast candidates in your 'slow' list :/ Based on what others have categorized based on what's in the code and IMHO they make sense: enum

ICMP redirects behavior

2016-10-27 Thread Stephen Suryaputra Lin
Hi, All, I noticed through code inspection that ICMP redirects behavior is different after commit 5943634fc5592037db0693b261f7f4bea6bb9457. In v2.6 kernel, it used to be that ip_rt_redirect() calls arp_bind_neighbour() which returns 0 and then the state of the neigh for the new_gw is checked. If

[PATCH net,v2] Fixes: 5943634fc559 ("ipv4: Maintain redirect and PMTU info in struct rtable again.")

2016-11-07 Thread Stephen Suryaputra Lin
old_gw is the one that sends the ICMP redirect message. Then the new_gw is assigned to fib_nh_exception. The problem is: the new_gw ARP may never gets resolved and the traffic is blackholed. Changes from v1: - use __ipv4_neigh_lookup instead (per Eric Dumazet). Signed-off-by: Stephen Suryaputra Li

Re: [PATCH net] Fixes: 5943634fc559 ("ipv4: Maintain redirect and PMTU info in struct rtable again.")

2016-11-07 Thread Stephen Suryaputra Lin
I did the temporary clearing/restoring rt_gateway following the deleted function check_peer_redir(). But, looking again at the function the assigning of peer->redirect_learned.a4 to rt_gateway can be permanent because restoring to the old_gw only happens on errors. I have updated the patch to use

[PATCH net] Fixes: 5943634fc559 ("ipv4: Maintain redirect and PMTU info in struct rtable again.")

2016-11-07 Thread Stephen Suryaputra Lin
old_gw is the one that sends the ICMP redirect message. Then the new_gw is assigned to fib_nh_exception. The problem is: the new_gw ARP may never gets resolved and the traffic is blackholed. Signed-off-by: Stephen Suryaputra Lin <ssu...@ieee.org> --- net/ipv4/route.c | 2 ++ 1 file changed,

[PATCH net,v2] ipv4: use new_gw for redirect neigh lookup

2016-11-10 Thread Stephen Suryaputra Lin
p. Changes from v1: - use __ipv4_neigh_lookup instead (per Eric Dumazet). Fixes: 5943634fc559 ("ipv4: Maintain redirect and PMTU info in struct rtable again.") Signed-off-by: Stephen Suryaputra Lin <ssu...@ieee.org> --- net/ipv4/route.c | 4 +++- 1 file changed, 3 insertions(+),

Faster TCP keepalive

2017-06-23 Thread Stephen Suryaputra Lin
Greetings, I'm writing this to probe if there has been thoughts or efforts in allowing sub-second TCP keep alive interval? One application is for TCP connections between IP hosts connected by an internal backplane where a faster detection is a necessity and the increased traffic can be