Re: [PATCH 2/2] drivers core: multi-threading device shutdown

2018-05-02 Thread Tobin C. Harding
This code was a pleasure to read, super clean. On Wed, May 02, 2018 at 11:59:31PM -0400, Pavel Tatashin wrote: > When system is rebooted, halted or kexeced device_shutdown() is > called. > > This function shuts down every single device by calling either: > dev->bus->shutdown(dev) >

Re: INFO: rcu detected stall in __schedule

2018-05-02 Thread Tetsuo Handa
I'm not sure whether this is a PPP bug. As of uptime = 484, RCU says that it stalled for 125 seconds. -- [ 484.407032] INFO: rcu_sched self-detected stall on CPU [ 484.412488] 0-...!: (125000 ticks this GP) idle=f3e/1/4611686018427387906 softirq=112858/112858 fqs=0 [ 484.422300]

Re: [lkp-robot] 486ad79630 [ 15.532543] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004

2018-05-02 Thread Andrew Morton
On Wed, 2 May 2018 21:58:25 -0700 Cong Wang wrote: > On Wed, May 2, 2018 at 9:27 PM, Andrew Morton > wrote: > > > > So it's saying that something which got committed into Linus's tree > > after 4.17-rc3 has caused a NULL deref in > >

Re: [PATCH] net/xfrm: Fix lookups for states with spi == 0

2018-05-02 Thread Herbert Xu
On Wed, May 02, 2018 at 01:41:36PM +0100, Dmitry Safonov wrote: > > But still it's possible to create ipsec with zero SPI. > And it seems not making sense to search for a state with SPI hash if > request has zero SPI. Fair enough. In fact a zero SPI is legal and defined for IPcomp. The bug

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

2018-05-02 Thread Julian Anastasov
Hello, On Wed, 2 May 2018, David Ahern wrote: > On 5/2/18 12:41 AM, Julian Anastasov wrote: > > Allow some non-cached routes to use non-expired fnhe: > > > > 1. ip_del_fnhe: moved above and now called by find_exception. > > The 4.5+ commit deed49df7390 expires fnhe only when caching >

[PATCH] sched: fix semicolon.cocci warnings

2018-05-02 Thread kbuild test robot
From: Fengguang Wu net/sched/sch_cake.c:580:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: 907a16741a03 ("sched: Add Common Applications Kept Enhanced (cake) qdisc") CC: Toke Høiland-Jørgensen

Re: [PATCH net-next v7 1/7] sched: Add Common Applications Kept Enhanced (cake) qdisc

2018-05-02 Thread kbuild test robot
Hi Toke, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Toke-H-iland-J-rgensen/sched-Add-Common-Applications-Kept-Enhanced-cake-qdisc/20180503-073002 coccinelle warnings: (new ones prefixed

Re: [v2 PATCH 1/1] tg3: fix meaningless hw_stats reading after tg3_halt memset 0 hw_stats

2018-05-02 Thread Michael Chan
On Wed, May 2, 2018 at 5:30 PM, Zumeng Chen wrote: > On 2018年05月03日 01:32, Michael Chan wrote: >> >> On Wed, May 2, 2018 at 3:27 AM, Zumeng Chen wrote: >>> >>> On 2018年05月02日 13:12, Michael Chan wrote: On Tue, May 1, 2018 at 5:42 PM, Zumeng

Re: Silently dropped UDP packets on kernel 4.14

2018-05-02 Thread Florian Westphal
Kristian Evensen wrote: > I went for the early-insert approached and have patched I'm sorry for suggesting that. It doesn't work, because of NAT. NAT rewrites packet content and changes the reply tuple, but the tuples determine the hash insertion location. I don't

Re: [lkp-robot] 486ad79630 [ 15.532543] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004

2018-05-02 Thread Cong Wang
On Wed, May 2, 2018 at 9:27 PM, Andrew Morton wrote: > > So it's saying that something which got committed into Linus's tree > after 4.17-rc3 has caused a NULL deref in > sock_release->llc_ui_release+0x3a/0xd0 Do you mean it contains commit 3a04ce7130a7 ("llc: fix NULL

[PATCH RFC v2 net-next 4/4] bpfilter: rough bpfilter codegen example hack

2018-05-02 Thread Alexei Starovoitov
From: Daniel Borkmann Signed-off-by: Daniel Borkmann --- net/bpfilter/Makefile | 2 +- net/bpfilter/bpfilter_mod.h | 285 ++- net/bpfilter/ctor.c | 57 + net/bpfilter/gen.c |

[PATCH v2 net-next 0/4] bpfilter

2018-05-02 Thread Alexei Starovoitov
Hi All, v1->v2: this patch set is almost a full rewrite of the earlier umh modules approach The v1 of patches and follow up discussion was covered by LWN: https://lwn.net/Articles/749108/ I believe the v2 addresses all issues brought up by Andy and others. Mainly there are zero changes to

[PATCH RFC v2 net-next 3/4] bpfilter: add iptable get/set parsing

2018-05-02 Thread Alexei Starovoitov
From: "David S. Miller" parse iptable binary blobs into bpfilter internal data structures bpfilter.ko only passing the [gs]etsockopt commands from kernel to umh All parsing is done inside umh Signed-off-by: David S. Miller Signed-off-by: Alexei

[PATCH v2 net-next 1/4] umh: introduce fork_usermode_blob() helper

2018-05-02 Thread Alexei Starovoitov
Introduce helper: int fork_usermode_blob(void *data, size_t len, struct umh_info *info); struct umh_info { struct file *pipe_to_umh; struct file *pipe_from_umh; pid_t pid; }; that GPLed kernel modules (signed or unsigned) can use it to execute part of its own data as

[PATCH v2 net-next 2/4] net: add skeleton of bpfilter kernel module

2018-05-02 Thread Alexei Starovoitov
bpfilter.ko consists of bpfilter_kern.c (normal kernel module code) and user mode helper code that is embedded into bpfilter.ko The steps to build bpfilter.ko are the following: - main.c is compiled by HOSTCC into the bpfilter_umh elf executable file - with quite a bit of objcopy and Makefile

Re: [lkp-robot] 486ad79630 [ 15.532543] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004

2018-05-02 Thread Andrew Morton
(networking cc's added) On Thu, 3 May 2018 12:14:50 +0800 kernel test robot wrote: > Greetings, > > 0day kernel testing robot got the below dmesg and the first bad commit is > > git://git.cmpxchg.org/linux-mmotm.git master > > commit

[PATCH net] macsonic: Set platform device coherent_dma_mask

2018-05-02 Thread Finn Thain
Set the device's coherent_dma_mask to avoid a WARNING splat. Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is no coherent_dma_mask"). Cc: linux-m...@lists.linux-m68k.org Signed-off-by: Finn Thain --- drivers/net/ethernet/natsemi/macsonic.c | 4 1

[PATCH net] macmace: Set platform device coherent_dma_mask

2018-05-02 Thread Finn Thain
Set the device's coherent_dma_mask to avoid a WARNING splat. Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is no coherent_dma_mask"). Cc: linux-m...@lists.linux-m68k.org Tested-by: Stan Johnson Signed-off-by: Finn Thain ---

[PATCH 1/2] ixgbe: release lock for the duration of ixgbe_suspend_close()

2018-05-02 Thread Pavel Tatashin
Currently, during device_shutdown() ixgbe holds rtnl_lock for the duration of lengthy ixgbe_close_suspend(). On machines with multiple ixgbe cards this lock prevents scaling if device_shutdown() function is multi-threaded. It is not necessary to hold this lock during ixgbe_close_suspend() as it

[PATCH 2/2] drivers core: multi-threading device shutdown

2018-05-02 Thread Pavel Tatashin
When system is rebooted, halted or kexeced device_shutdown() is called. This function shuts down every single device by calling either: dev->bus->shutdown(dev) dev->driver->shutdown(dev) Even on a machine just with a moderate amount of devices, device_shutdown() may take multiple

[PATCH 0/2] multi-threading device shutdown

2018-05-02 Thread Pavel Tatashin
Do a faster shutdown by calling dev->*->shutdown(dev) in parallel. device_shutdown() calls these functions for every single device but only using one thread. Since, nothing else is running on the machine by the device_shutdown() s called, there is no reason not to utilize all the available CPU

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

2018-05-02 Thread David Ahern
Add IPv6 equivalent to fib_lookup. Does a fib lookup, including rules, but returns a FIB entry, fib6_info, rather than a dst based rt6_info. fib6_lookup is any where from 140% (MULTIPLE_TABLES config disabled) to 60% faster than any of the dst based lookup methods (without custom rules) and 25%

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

2018-05-02 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

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

2018-05-02 Thread David Ahern
Simple example of fast-path forwarding. It has a serious flaw in not verifying the egress device index supports XDP forwarding. If the egress device does not packets are dropped. Take this only as a simple example of fast-path forwarding. Signed-off-by: David Ahern ---

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

2018-05-02 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 --- include/net/ip6_fib.h | 5 + net/ipv6/route.c | 17 + 2 files changed, 14

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

2018-05-02 Thread David Ahern
Provide a helper for doing a FIB and neighbor lookup in the kernel tables from an XDP program. The helper provides a fastpath for forwarding packets. If the packet is a local delivery or for any reason is not a simple lookup and forward, the packet is expected to continue up the stack for full

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

2018-05-02 Thread David Ahern
ip6_pol_route is used for ingress and egress FIB lookups. Refactor it moving the table lookup into a separate fib6_table_lookup that can be invoked separately and export the new function. ip6_pol_route now calls fib6_table_lookup and uses the result to generate a dst based rt6_info.

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

2018-05-02 Thread David Ahern
Provide a helper for doing a FIB and neighbor lookup in the kernel tables from an XDP program. The helper provides a fastpath for forwarding packets. If the packet is a local delivery or for any reason is not a simple lookup and forward, the packet continues up the stack. If it is to be

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

2018-05-02 Thread David Ahern
Similar to IPv4, IPv6 should use the FIB lookup result in the tracepoint. Signed-off-by: David Ahern --- include/trace/events/fib6.h | 14 +++--- net/ipv6/route.c| 14 ++ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git

[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 --- net/ipv6/fib6_rules.c | 52 ++- 1 file changed, 31

[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 --- include/net/ip6_fib.h | 6 +++--- net/ipv6/ip6_fib.c| 14

[PATCH net] tcp: restore autocorking

2018-05-02 Thread Eric Dumazet
When adding rb-tree for TCP retransmit queue, we inadvertently broke TCP autocorking. tcp_should_autocork() should really check if the rtx queue is not empty. Tested: Before the fix : $ nstat -n;./netperf -H 10.246.7.152 -Cc -- -m 500;nstat | grep AutoCork MIGRATED TCP STREAM TEST from 0.0.0.0

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

2018-05-02 Thread David Miller
From: Julian Anastasov Date: Wed, 2 May 2018 09:41:19 +0300 > Allow some non-cached routes to use non-expired fnhe: > > 1. ip_del_fnhe: moved above and now called by find_exception. > The 4.5+ commit deed49df7390 expires fnhe only when caching > routes. Change that to: > > 1.1.

Re: pull-request: bpf 2018-05-03

2018-05-02 Thread David Miller
From: Daniel Borkmann Date: Thu, 3 May 2018 02:37:12 +0200 > The following pull-request contains BPF updates for your *net* tree. > > The main changes are: ... > Please consider pulling these changes from: > > git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
On Thu, May 03, 2018 at 04:44:39AM +0300, Michael S. Tsirkin wrote: > On Thu, May 03, 2018 at 09:11:16AM +0800, Tiwei Bie wrote: > > On Wed, May 02, 2018 at 06:42:57PM +0300, Michael S. Tsirkin wrote: > > > On Wed, May 02, 2018 at 11:12:55PM +0800, Tiwei Bie wrote: > > > > On Wed, May 02, 2018 at

Re: [PATCH] sctp: fix a potential missing-check bug

2018-05-02 Thread Marcelo Ricardo Leitner
On Wed, May 02, 2018 at 08:27:05PM -0500, Wenwen Wang wrote: > On Wed, May 2, 2018 at 8:24 PM, Marcelo Ricardo Leitner > wrote: > > On Wed, May 02, 2018 at 08:15:45PM -0500, Wenwen Wang wrote: > >> In sctp_setsockopt_maxseg(), the integer 'val' is compared against

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
On Thu, May 03, 2018 at 09:11:16AM +0800, Tiwei Bie wrote: > On Wed, May 02, 2018 at 06:42:57PM +0300, Michael S. Tsirkin wrote: > > On Wed, May 02, 2018 at 11:12:55PM +0800, Tiwei Bie wrote: > > > On Wed, May 02, 2018 at 04:51:01PM +0300, Michael S. Tsirkin wrote: > > > > On Wed, May 02, 2018 at

Re: [PATCH bpf-next 07/12] bpf, sparc64: remove ld_abs/ld_ind

2018-05-02 Thread David Miller
From: Daniel Borkmann Date: Thu, 3 May 2018 03:05:31 +0200 > Since LD_ABS/LD_IND instructions are now removed from the core and > reimplemented through a combination of inlined BPF instructions and > a slow-path helper, we can get rid of the complexity from sparc64 JIT. >

[PATCH net-next] ip6_gre: correct the function name in ip6gre_tnl_addr_conflict() comment

2018-05-02 Thread Sun Lianwen
The function name is wrong in ip6gre_tnl_addr_conflict() comment, which use ip6_tnl_addr_conflict instead of ip6gre_tnl_addr_conflict. Signed-off-by: Sun Lianwen --- net/ipv6/ip6_gre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH] sctp: fix a potential missing-check bug

2018-05-02 Thread Wenwen Wang
On Wed, May 2, 2018 at 8:24 PM, Marcelo Ricardo Leitner wrote: > On Wed, May 02, 2018 at 08:15:45PM -0500, Wenwen Wang wrote: >> In sctp_setsockopt_maxseg(), the integer 'val' is compared against min_len >> and max_len to check whether it is in the appropriate range. If

Re: [PATCH] sctp: fix a potential missing-check bug

2018-05-02 Thread Marcelo Ricardo Leitner
On Wed, May 02, 2018 at 08:15:45PM -0500, Wenwen Wang wrote: > In sctp_setsockopt_maxseg(), the integer 'val' is compared against min_len > and max_len to check whether it is in the appropriate range. If it is not, > an error code -EINVAL will be returned. This is enforced by a security > check.

Re: [PATCH] NET/netlink: optimize output of seq_puts in af_netlink.c

2018-05-02 Thread YU Bo
Hi, On Wed, May 02, 2018 at 10:19:43AM -0400, David Miller wrote: From: Bo YU Date: Wed, 2 May 2018 05:54:24 -0400 Optimization of command output: `cat /proc/net/netlink` After the patch, we will get: https://clbin.com/lnu4L Signed-off-by: Bo YU ---

[PATCH] sctp: fix a potential missing-check bug

2018-05-02 Thread Wenwen Wang
In sctp_setsockopt_maxseg(), the integer 'val' is compared against min_len and max_len to check whether it is in the appropriate range. If it is not, an error code -EINVAL will be returned. This is enforced by a security check. But, this check is only executed when 'val' is not 0. In fact, if

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
On Wed, May 02, 2018 at 06:42:57PM +0300, Michael S. Tsirkin wrote: > On Wed, May 02, 2018 at 11:12:55PM +0800, Tiwei Bie wrote: > > On Wed, May 02, 2018 at 04:51:01PM +0300, Michael S. Tsirkin wrote: > > > On Wed, May 02, 2018 at 03:28:19PM +0800, Tiwei Bie wrote: > > > > On Wed, May 02, 2018 at

Re: [PATCH] sctp: fix a potential missing-check bug

2018-05-02 Thread Wenwen Wang
Hi Marcelo, I guess I worked on an old version of the kernel. I will re-submit the patch. Sorry :( Wenwen On Wed, May 2, 2018 at 6:23 PM, Marcelo Ricardo Leitner wrote: > Hi Wenwen, > > On Wed, May 02, 2018 at 05:12:45PM -0500, Wenwen Wang wrote: >> In

[PATCH bpf-next 05/12] bpf, x64: remove ld_abs/ld_ind

2018-05-02 Thread Daniel Borkmann
Since LD_ABS/LD_IND instructions are now removed from the core and reimplemented through a combination of inlined BPF instructions and a slow-path helper, we can get rid of the complexity from x64 JIT. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov

[PATCH bpf-next 00/12] Move ld_abs/ld_ind to native BPF

2018-05-02 Thread Daniel Borkmann
This set simplifies BPF JITs significantly by moving ld_abs/ld_ind to native BPF, for details see individual patches. Main rationale is in patch 'implement ld_abs/ld_ind in native bpf'. Thanks! Daniel Borkmann (12): bpf: prefix cbpf internal helpers with bpf_ bpf: migrate ebpf ld_abs/ld_ind

[PATCH bpf-next 06/12] bpf, arm64: remove ld_abs/ld_ind

2018-05-02 Thread Daniel Borkmann
Since LD_ABS/LD_IND instructions are now removed from the core and reimplemented through a combination of inlined BPF instructions and a slow-path helper, we can get rid of the complexity from arm64 JIT. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov

[PATCH bpf-next 03/12] bpf: implement ld_abs/ld_ind in native bpf

2018-05-02 Thread Daniel Borkmann
The main part of this work is to finally allow removal of LD_ABS and LD_IND from the BPF core by reimplementing them through native eBPF instead. Both LD_ABS/LD_IND were carried over from cBPF and keeping them around in native eBPF caused way more trouble than actually worth it. To just list some

[PATCH bpf-next 11/12] bpf, s390x: remove ld_abs/ld_ind

2018-05-02 Thread Daniel Borkmann
Since LD_ABS/LD_IND instructions are now removed from the core and reimplemented through a combination of inlined BPF instructions and a slow-path helper, we can get rid of the complexity from s390x JIT. Tested on s390x instance on LinuxONE. Signed-off-by: Daniel Borkmann

[PATCH bpf-next 08/12] bpf, arm32: remove ld_abs/ld_ind

2018-05-02 Thread Daniel Borkmann
Since LD_ABS/LD_IND instructions are now removed from the core and reimplemented through a combination of inlined BPF instructions and a slow-path helper, we can get rid of the complexity from arm32 JIT. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov

[PATCH bpf-next 07/12] bpf, sparc64: remove ld_abs/ld_ind

2018-05-02 Thread Daniel Borkmann
Since LD_ABS/LD_IND instructions are now removed from the core and reimplemented through a combination of inlined BPF instructions and a slow-path helper, we can get rid of the complexity from sparc64 JIT. Signed-off-by: Daniel Borkmann Cc: David S. Miller

[PATCH bpf-next 09/12] bpf, mips64: remove ld_abs/ld_ind

2018-05-02 Thread Daniel Borkmann
Since LD_ABS/LD_IND instructions are now removed from the core and reimplemented through a combination of inlined BPF instructions and a slow-path helper, we can get rid of the complexity from mips64 JIT. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov

[PATCH bpf-next 12/12] bpf: sync tools bpf.h uapi header

2018-05-02 Thread Daniel Borkmann
Only sync the header from include/uapi/linux/bpf.h. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov --- tools/include/uapi/linux/bpf.h | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff --git

[PATCH bpf-next 10/12] bpf, ppc64: remove ld_abs/ld_ind

2018-05-02 Thread Daniel Borkmann
Since LD_ABS/LD_IND instructions are now removed from the core and reimplemented through a combination of inlined BPF instructions and a slow-path helper, we can get rid of the complexity from ppc64 JIT. Signed-off-by: Daniel Borkmann Acked-by: Naveen N. Rao

[PATCH bpf-next 02/12] bpf: migrate ebpf ld_abs/ld_ind tests to test_verifier

2018-05-02 Thread Daniel Borkmann
Remove all eBPF tests involving LD_ABS/LD_IND from test_bpf.ko. Reason is that the eBPF tests from test_bpf module do not go via BPF verifier and therefore any instruction rewrites from verifier cannot take place. Therefore, move them into test_verifier which runs out of user space, so that

[PATCH bpf-next 04/12] bpf: add skb_load_bytes_relative helper

2018-05-02 Thread Daniel Borkmann
This adds a small BPF helper similar to bpf_skb_load_bytes() that is able to load relative to mac/net header offset from the skb's linear data. Compared to bpf_skb_load_bytes(), it takes a fith argument namely start_header, which is either BPF_HDR_START_MAC or BPF_HDR_START_NET. This allows for a

[PATCH bpf-next 01/12] bpf: prefix cbpf internal helpers with bpf_

2018-05-02 Thread Daniel Borkmann
No change in functionality, just remove the '__' prefix and replace it with a 'bpf_' prefix instead. We later on add a couple of more helpers for cBPF and keeping the scheme with '__' is suboptimal there. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov

pull-request: bpf 2018-05-03

2018-05-02 Thread Daniel Borkmann
Hi David, The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Several BPF sockmap fixes mostly related to bugs in error path handling, that is, a bug in updating the scatterlist length / offset accounting, a missing sk_mem_uncharge() in redirect

Re: [v2 PATCH 1/1] tg3: fix meaningless hw_stats reading after tg3_halt memset 0 hw_stats

2018-05-02 Thread Zumeng Chen
On 2018年05月03日 01:32, Michael Chan wrote: On Wed, May 2, 2018 at 3:27 AM, Zumeng Chen wrote: On 2018年05月02日 13:12, Michael Chan wrote: On Tue, May 1, 2018 at 5:42 PM, Zumeng Chen wrote: diff --git a/drivers/net/ethernet/broadcom/tg3.h

Re: Silently dropped UDP packets on kernel 4.14

2018-05-02 Thread Kristian Evensen
Hello, On Wed, May 2, 2018 at 12:42 AM, Kristian Evensen wrote: > My knowledge of the conntrack/nat subsystem is not that great, and I > don't know the implications of what I am about to suggest. However, > considering that the two packets represent the same flow,

Re: [PATCH] sctp: fix a potential missing-check bug

2018-05-02 Thread Marcelo Ricardo Leitner
Hi Wenwen, On Wed, May 02, 2018 at 05:12:45PM -0500, Wenwen Wang wrote: > In sctp_setsockopt_maxseg(), the integer 'val' is compared against min_len > and max_len to check whether it is in the appropriate range. If it is not, > an error code -EINVAL will be returned. This is enforced by a

[PATCH v2 bpf-next 2/2] bpf: add selftest for stackmap with build_id in NMI context

2018-05-02 Thread Song Liu
This new test captures stackmap with build_id with hardware event PERF_COUNT_HW_CPU_CYCLES. Because we only support one ips-to-build_id lookup per cpu in NMI context, stack_amap will not be able to do the lookup in this test. Therefore, we didn't do compare_stack_ips(), as it will alwasy fail.

[PATCH v2 bpf-next 1/2] bpf: enable stackmap with build_id in nmi context

2018-05-02 Thread Song Liu
Currently, we cannot parse build_id in nmi context because of up_read(>mm->mmap_sem), this makes stackmap with build_id less useful. This patch enables parsing build_id in nmi by putting the up_read() call in irq_work. To avoid memory allocation in nmi context, we use per cpu variable for the

[PATCH v2 bpf-next 0/2] bpf: enable stackmap with build_id in nmi

2018-05-02 Thread Song Liu
Changes v1 -> v2: 1. Rename some variables to (hopefully) reduce confusion; 2. Check irq_work status with IRQ_WORK_BUSY (instead of work->sem); 3. In Kconfig, let BPF_SYSCALL select IRQ_WORK; 4. Add static to DEFINE_PER_CPU(); 5. Remove pr_info() in stack_map_init(). Song Liu (2):

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

2018-05-02 Thread David Ahern
On 5/2/18 12:41 AM, Julian Anastasov wrote: > Allow some non-cached routes to use non-expired fnhe: > > 1. ip_del_fnhe: moved above and now called by find_exception. > The 4.5+ commit deed49df7390 expires fnhe only when caching > routes. Change that to: > > 1.1. use fnhe for non-cached local

Re: Performance regressions in TCP_STREAM tests in Linux 4.15 (and later)

2018-05-02 Thread Eric Dumazet
On 05/02/2018 02:47 PM, Michael Wenig wrote: > After applying Eric's proposed change (see below) to a 4.17 RC3 kernel, the > regressions that we had observed in our TCP_STREAM small message tests with > TCP_NODELAY enabled are now drastically reduced. Instead of the original 3x > thruput and

Re: [bpf PATCH v2 0/3] sockmap error path fixes

2018-05-02 Thread Alexei Starovoitov
On Wed, May 02, 2018 at 01:50:14PM -0700, John Fastabend wrote: > When I added the test_sockmap to selftests I mistakenly changed the > test logic a bit. The result of this was on redirect cases we ended up > choosing the wrong sock from the BPF program and ended up sending to a > socket that had

Re: [PATCH v5] bpf, x86_32: add eBPF JIT compiler for ia32

2018-05-02 Thread Daniel Borkmann
Hi Wang, On 04/29/2018 02:37 PM, Wang YanQing wrote: > The JIT compiler emits ia32 bit instructions. Currently, It supports eBPF > only. Classic BPF is supported because of the conversion by BPF core. > > Almost all instructions from eBPF ISA supported except the following: > BPF_ALU64 | BPF_DIV

[PATCH] sctp: fix a potential missing-check bug

2018-05-02 Thread Wenwen Wang
In sctp_setsockopt_maxseg(), the integer 'val' is compared against min_len and max_len to check whether it is in the appropriate range. If it is not, an error code -EINVAL will be returned. This is enforced by a security check. But, this check is only executed when 'val' is not 0. In fact, if

[PATCH net-next] inet: add bound ports statistic

2018-05-02 Thread Stephen Hemminger
This adds a number of bound ports which fixes socket summary command. The ss -s has been broken since changes to slab info and this is one way to recover the missing value by adding a field onto /proc/net/sockstat. Since this is an informational value only, there is no need for locking.

Re: [PATCH V2 net-next 0/6] virtio-net: Add SCTP checksum offload support

2018-05-02 Thread Marcelo Ricardo Leitner
On Tue, May 01, 2018 at 10:07:33PM -0400, Vladislav Yasevich wrote: > Now that we have SCTP offload capabilities in the kernel, we can add > them to virtio as well. First step is SCTP checksum. SCTP-wise, LGTM: Acked-by: Marcelo Ricardo Leitner

[PATCH net] rds: do not leak kernel memory to user land

2018-05-02 Thread Eric Dumazet
syzbot/KMSAN reported an uninit-value in put_cmsg(), originating from rds_cmsg_recv(). Simply clear the structure, since we have holes there, or since rx_traces might be smaller than RDS_MSG_RX_DGRAM_TRACE_MAX. BUG: KMSAN: uninit-value in copy_to_user include/linux/uaccess.h:184 [inline] BUG:

RE: Performance regressions in TCP_STREAM tests in Linux 4.15 (and later)

2018-05-02 Thread Michael Wenig
After applying Eric's proposed change (see below) to a 4.17 RC3 kernel, the regressions that we had observed in our TCP_STREAM small message tests with TCP_NODELAY enabled are now drastically reduced. Instead of the original 3x thruput and cpu cost regressions, the regression depth is now < 10%

Re: [PATCH net-next v9 2/4] net: Introduce generic failover module

2018-05-02 Thread Jiri Pirko
Wed, May 02, 2018 at 07:51:12PM CEST, sridhar.samudr...@intel.com wrote: > > >On 5/2/2018 9:15 AM, Jiri Pirko wrote: >> Sat, Apr 28, 2018 at 11:06:01AM CEST, j...@resnulli.us wrote: >> > Fri, Apr 27, 2018 at 07:06:58PM CEST, sridhar.samudr...@intel.com wrote: >> [...] >> >> >> > > + >> > > +

Re: [PATCH net-next v9 2/4] net: Introduce generic failover module

2018-05-02 Thread Jiri Pirko
Wed, May 02, 2018 at 07:51:12PM CEST, sridhar.samudr...@intel.com wrote: > > >On 5/2/2018 9:15 AM, Jiri Pirko wrote: >> Sat, Apr 28, 2018 at 11:06:01AM CEST, j...@resnulli.us wrote: >> > Fri, Apr 27, 2018 at 07:06:58PM CEST, sridhar.samudr...@intel.com wrote: >> [...] >> >> >> > > + >> > > +

Re: [PATCH net-next v9 2/4] net: Introduce generic failover module

2018-05-02 Thread Samudrala, Sridhar
On 5/2/2018 1:30 PM, Michael S. Tsirkin wrote: On Wed, May 02, 2018 at 10:51:12AM -0700, Samudrala, Sridhar wrote: On 5/2/2018 9:15 AM, Jiri Pirko wrote: Sat, Apr 28, 2018 at 11:06:01AM CEST, j...@resnulli.us wrote: Fri, Apr 27, 2018 at 07:06:58PM CEST, sridhar.samudr...@intel.com wrote:

Re: [RFC iproute2-next 2/5] ss: make tcp_mem long

2018-05-02 Thread Stephen Hemminger
On Wed, 2 May 2018 14:08:53 -0700 Eric Dumazet wrote: > On 05/02/2018 01:27 PM, Stephen Hemminger wrote: > > The tcp_memory field in /proc/net/sockstat is formatted as > > a long value by kernel. Change ss to keep this as full value. > > > > Signed-off-by: Stephen

Re: [RFC iproute2-next 2/5] ss: make tcp_mem long

2018-05-02 Thread Eric Dumazet
On 05/02/2018 01:27 PM, Stephen Hemminger wrote: > The tcp_memory field in /proc/net/sockstat is formatted as > a long value by kernel. Change ss to keep this as full value. > > Signed-off-by: Stephen Hemminger > --- > misc/ss.c | 4 ++-- > 1 file changed, 2

Re: [PATCH bpf-next v3 15/15] samples/bpf: sample application and documentation for AF_XDP sockets

2018-05-02 Thread Jesper Dangaard Brouer
On Wed, 2 May 2018 13:01:36 +0200 Björn Töpel wrote: > +static void rx_drop(struct xdpsock *xsk) > +{ > + struct xdp_desc descs[BATCH_SIZE]; > + unsigned int rcvd, i; > + > + rcvd = xq_deq(>rx, descs, BATCH_SIZE); > + if (!rcvd) > + return; >

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: DSA switch

2018-05-02 Thread Andrew Lunn
On Wed, May 02, 2018 at 11:20:05PM +0300, Ran Shalit wrote: > Hello, > > Is it possible to use switch just like external real switch, > connecting all ports to the same subnet ? Yes. Just bridge all ports/interfaces together and put your host IP address on the bridge. Andrew

Re: [PATCH bpf-next] bpf/verifier: enable ctx + const + 0.

2018-05-02 Thread Jakub Kicinski
On Wed, 2 May 2018 10:54:56 -0700, William Tu wrote: > On Wed, May 2, 2018 at 1:29 AM, Daniel Borkmann wrote: > > On 05/02/2018 06:52 AM, Alexei Starovoitov wrote: > >> On Tue, May 01, 2018 at 09:35:29PM -0700, William Tu wrote: > >> Please test it with real program and

[bpf PATCH v2 3/3] bpf: sockmap, fix error handling in redirect failures

2018-05-02 Thread John Fastabend
When a redirect failure happens we release the buffers in-flight without calling a sk_mem_uncharge(), the uncharge is called before dropping the sock lock for the redirecte, however we missed updating the ring start index. When no apply actions are in progress this is OK because we uncharge the

[bpf PATCH v2 2/3] bpf: sockmap, zero sg_size on error when buffer is released

2018-05-02 Thread John Fastabend
When an error occurs during a redirect we have two cases that need to be handled (i) we have a cork'ed buffer (ii) we have a normal sendmsg buffer. In the cork'ed buffer case we don't currently support recovering from errors in a redirect action. So the buffer is released and the error should

[bpf PATCH v2 0/3] sockmap error path fixes

2018-05-02 Thread John Fastabend
When I added the test_sockmap to selftests I mistakenly changed the test logic a bit. The result of this was on redirect cases we ended up choosing the wrong sock from the BPF program and ended up sending to a socket that had no receive handler. The result was the actual receive handler, running

[bpf PATCH v2 1/3] bpf: sockmap, fix scatterlist update on error path in send with apply

2018-05-02 Thread John Fastabend
When the call to do_tcp_sendpage() fails to send the complete block requested we either retry if only a partial send was completed or abort if we receive a error less than or equal to zero. Before returning though we must update the scatterlist length/offset to account for any partial send

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

2018-05-02 Thread Thomas Winter
> On Wed, May 02, 2018 at 12:58:56PM -0600, David Ahern wrote: > > 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

Re: [PATCH 0/2] sh_eth: complain on access to unimplemented TSU registers

2018-05-02 Thread David Miller
From: Sergei Shtylyov Date: Wed, 2 May 2018 22:53:23 +0300 > Here's a set of 2 patches against DaveM's 'net-next.git' repo. The 1st patch > routes TSU_POST register accesses thru sh_eth_tsu_{read|write}() and the > 2nd > added WARN_ON() unimplemented register

Re: [PATCH net] net_sched: fq: take care of throttled flows before reuse

2018-05-02 Thread David Miller
From: Eric Dumazet Date: Wed, 2 May 2018 10:03:30 -0700 > Normally, a socket can not be freed/reused unless all its TX packets > left qdisc and were TX-completed. However connect(AF_UNSPEC) allows > this to happen. > > With commit fc59d5bdf1e3 ("pkt_sched: fq: clear

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

2018-05-02 Thread David Miller
From: Ido Schimmel Date: Wed, 2 May 2018 22:41:56 +0300 > This reverts commit edd7ceb78296 ("ipv6: Allow non-gateway ECMP for > IPv6"). > > Eric reported a division by zero in rt6_multipath_rebalance() which is > caused by above commit that considers identical local routes

Re: [PATCH net-next v9 2/4] net: Introduce generic failover module

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 10:51:12AM -0700, Samudrala, Sridhar wrote: > > > On 5/2/2018 9:15 AM, Jiri Pirko wrote: > > Sat, Apr 28, 2018 at 11:06:01AM CEST, j...@resnulli.us wrote: > > > Fri, Apr 27, 2018 at 07:06:58PM CEST, sridhar.samudr...@intel.com wrote: > > [...] > > > > > > > > + > > > >

[RFC iproute2-next 3/5] ss: use sockstat to get TCP bind ports

2018-05-02 Thread Stephen Hemminger
From: Stephen Hemminger Using slabinfo to try and get the number of bind_buckets no longer works because of slab cache merging. Instead use proposed enhancment of /proc/net/sockstat to get the same data. Signed-off-by: Stephen Hemminger ---

[RFC iproute2-next 1/5] ss: make args to get_snmp_int const

2018-05-02 Thread Stephen Hemminger
These are keys for lookup and should be const. Signed-off-by: Stephen Hemminger --- misc/ss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/ss.c b/misc/ss.c index 3ed7e66962f3..22c76e34f83b 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -4539,7

[RFC iproute2-next 5/5] ss: use correct slab statistics

2018-05-02 Thread Stephen Hemminger
From: Stephen Hemminger The slabinfo names changed years ago, and ss statistics were broken. This changes to use current slab names and handle TCP IPv6. Signed-off-by: Stephen Hemminger --- misc/ss.c | 23 +++ 1 file

[RFC iproute2-next 0/5] ss statistics fixes

2018-05-02 Thread Stephen Hemminger
From: Stephen Hemminger The output of the ss -s command has been broken for a long time because of kernel changes (ie since 2.6). This is an attempt to resolve most of the issues. Still don't like the way it is using slabinfo to get the data but some of this information

[RFC iproute2-next 2/5] ss: make tcp_mem long

2018-05-02 Thread Stephen Hemminger
The tcp_memory field in /proc/net/sockstat is formatted as a long value by kernel. Change ss to keep this as full value. Signed-off-by: Stephen Hemminger --- misc/ss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/ss.c b/misc/ss.c index

[RFC iproute2-next 4/5] ss: don't look for skbuff_head_cache

2018-05-02 Thread Stephen Hemminger
From: Stephen Hemminger Not used in current code. Signed-off-by: Stephen Hemminger --- misc/ss.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/misc/ss.c b/misc/ss.c index 4f76999c0fee..97304cd8abfc 100644 --- a/misc/ss.c +++

Re: [PATCH net-next 00/10] r8169: series with further improvements

2018-05-02 Thread David Miller
From: Heiner Kallweit Date: Wed, 2 May 2018 21:28:10 +0200 > I thought I'm more or less done with the basic refactoring. But again > I stumbled across things that can be improved / simplified. Looks good, series applied, thanks Heiner.

[PATCH net,stable] qmi_wwan: do not steal interfaces from class drivers

2018-05-02 Thread Bjørn Mork
The USB_DEVICE_INTERFACE_NUMBER matching macro assumes that the { vendorid, productid, interfacenumber } set uniquely identifies one specific function. This has proven to fail for some configurable devices. One example is the Quectel EM06/EP06 where the same interface number can be either QMI or

  1   2   3   4   >