[PATCH net-next v3 3/3] bpf: add a test case to test single tp multiple bpf attachment

2017-10-23 Thread Yonghong Song
The bpf sample program syscall_tp is modified to show attachment of more than bpf programs for a particular kernel tracepoint. Signed-off-by: Yonghong Song Acked-by: Alexei Starovoitov Acked-by: Martin KaFai Lau --- samples/bpf/syscall_tp_user.c | 66 ++-

[PATCH net-next v3 1/3] bpf: use the same condition in perf event set/free bpf handler

2017-10-23 Thread Yonghong Song
This is a cleanup such that doing the same check in perf_event_free_bpf_prog as we already do in perf_event_set_bpf_prog step. Signed-off-by: Yonghong Song Acked-by: Alexei Starovoitov Acked-by: Martin KaFai Lau --- kernel/events/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(

[PATCH net-next v3 2/3] bpf: permit multiple bpf attachments for a single perf event

2017-10-23 Thread Yonghong Song
This patch enables multiple bpf attachments for a kprobe/uprobe/tracepoint single trace event. Each trace_event keeps a list of attached perf events. When an event happens, all attached bpf programs will be executed based on the order of attachment. A global bpf_event_mutex lock is introduced to p

[PATCH net-next v3 0/3] bpf: permit multiple bpf attachments for a single perf tracepoint event

2017-10-23 Thread Yonghong Song
This patch set adds support to permit multiple bpf prog attachments for a single perf tracepoint event. Patch 1 does some cleanup such that perf_event_{set|free}_bpf_handler is called under the same condition. Patch 2 has the core implementation, and Patch 3 adds a test case. Changelogs: v2 -> v3:

Re: [for-next 08/12] net/mlx5e: IPoIB, Use hash-table to map between QPN to child netdev

2017-10-23 Thread Alex Vesker
On 10/23/2017 6:47 PM, Jason Gunthorpe wrote: On Sat, Oct 14, 2017 at 11:48:23AM -0700, Saeed Mahameed wrote: From: Alex Vesker This change is needed for PKEY support, since the RQs are shared between the child interface and the parent. The parent is responsible for NAPI and the precessing o

Re: [PATCH v2] sctp: full support for ipv6 ip_nonlocal_bind & IP_FREEBIND

2017-10-23 Thread Xin Long
On Tue, Oct 24, 2017 at 1:19 AM, Laszlo Toth wrote: > Commit 9b9742022888 ("sctp: support ipv6 nonlocal bind") > introduced support for the above options as v4 sctp did, > so patched sctp_v6_available(). > > In the v4 implementation it's enough, because > sctp_inet_bind_verify() just returns with

RE: [patch net v2 1/4] net/sched: Change tc_action refcnt and bindcnt to atomic

2017-10-23 Thread Chris Mi
> -Original Message- > From: Cong Wang [mailto:xiyou.wangc...@gmail.com] > Sent: Monday, October 23, 2017 11:40 PM > To: Chris Mi > Cc: Jamal Hadi Salim ; Linux Kernel Network Developers > ; Lucas Bates ; Jiri Pirko > ; David Miller > Subject: Re: [patch net v2 1/4] net/sched: Change tc_a

[PATCH net-next] net/sched: Fix actions list corruption when adding offloaded tc flows

2017-10-23 Thread Or Gerlitz
Prior to commit b3f55bdda8df, the networking core doesn't wire an in-place actions list the when the low level driver is called to offload the flow, but all low level drivers do that (call tcf_exts_to_list()) in their offloading "add" logic. Now, the in-place list is set in the core which goes ove

[PATCHv3 net-next 3/4] rtnetlink: bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event

2017-10-23 Thread Xin Long
This patch is to bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event so that bonding could use it instead of calling rtmsg_ifinfo to send a notification to userspace after netdev lower state is changed in the later patch. Signed-off-by: Xin Long --- net/core/rtnetlink.c | 1 + 1

[PATCHv3 net-next 4/4] bonding: remove rtmsg_ifinfo called after bond_lower_state_changed

2017-10-23 Thread Xin Long
After the patch 'rtnetlink: bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event', bond_lower_state_changed would generate NETDEV_CHANGEUPPER event which would send a notification to userspace in rtnetlink_event. There's no need to call rtmsg_ifinfo to send the notification any more

[PATCHv3 net-next 2/4] bonding: remove rtmsg_ifinfo called in bond_master_upper_dev_link

2017-10-23 Thread Xin Long
Since commit 42e52bf9e3ae ("net: add netnotifier event for upper device change"), netdev_master_upper_dev_link has generated NETDEV_CHANGEUPPER event which would send a notification to userspace in rtnetlink_event. There's no need to call rtmsg_ifinfo to send the notification any more. So this pat

[PATCHv3 net-next 0/4] net: remove rtmsg_ifinfo used in bridge and bonding

2017-10-23 Thread Xin Long
It's better to send notifications to userspace by the events in rtnetlink_event, instead of calling rtmsg_ifinfo directly. This patcheset is to remove rtmsg_ifinfo called in bonding and bridge, the notifications can be handled by NETDEV_CHANGEUPPER and NETDEV_CHANGELOWERSTATE events in rtnetlink_e

[PATCHv3 net-next 1/4] bridge: remove rtmsg_ifinfo called in add_del_if

2017-10-23 Thread Xin Long
Since commit dc709f375743 ("rtnetlink: bring NETDEV_CHANGEUPPER event process back in rtnetlink_event"), rtnetlink_event would process the NETDEV_CHANGEUPPER event and send a notification to userspace. In add_del_if, it would generate NETDEV_CHANGEUPPER event by whether netdev_master_upper_dev_lin

RE: [Patch net 14/15] selftests: Introduce a new script to generate tc batch file

2017-10-23 Thread Chris Mi
> -Original Message- > From: Cong Wang [mailto:xiyou.wangc...@gmail.com] > Sent: Tuesday, October 24, 2017 6:03 AM > To: netdev@vger.kernel.org > Cc: paul...@linux.vnet.ibm.com; j...@mojatatu.com; > john.fastab...@gmail.com; Chris Mi ; Cong Wang > > Subject: [Patch net 14/15] selftests: In

Re: [net-next PATCH] bpf: cpumap fix potential lost wake-up problem

2017-10-23 Thread Jesper Dangaard Brouer
On Mon, 23 Oct 2017 22:34:37 +0200 Daniel Borkmann wrote: > On 10/23/2017 07:39 PM, Jesper Dangaard Brouer wrote: > > As pointed out by Michael, commit 1c601d829ab0 ("bpf: cpumap xdp_buff > > to skb conversion and allocation") contains a classical example of the > > potential lost wake-up problem

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Herbert Xu
On Mon, Oct 23, 2017 at 09:01:46PM -0700, Alexei Starovoitov wrote: > > fwiw I had the same argument earlier: > https://lkml.org/lkml/2017/10/9/1139 Fair point on eliminating a branch. But I'd prefer something like bool cond; cond = code_that_does_something(); BUG_ON(con

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Quoting Herbert Xu : On Mon, Oct 23, 2017 at 10:50:43PM -0500, Gustavo A. R. Silva wrote: Quoting Herbert Xu : >On Mon, Oct 23, 2017 at 01:18:57PM -0500, Gustavo A. R. Silva wrote: >>Use BUG_ON instead of if condition followed by BUG. >> >>This issue was detected with the help of Coccinelle.

Re: [PATCH net-next 2/3] bpf: permit multiple bpf attachments for a single perf event

2017-10-23 Thread kbuild test robot
Hi Yonghong, [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Yonghong-Song/bpf-permit-multiple-bpf-attachments-for-a-single-perf-tracepoint-event/20171024-080608 config: arm-omap2plus_defconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (Deb

Re: [PATCH net-next 2/3] bpf: permit multiple bpf attachments for a single perf event

2017-10-23 Thread kbuild test robot
Hi Yonghong, [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Yonghong-Song/bpf-permit-multiple-bpf-attachments-for-a-single-perf-tracepoint-event/20171024-080608 config: i386-randconfig-h1-10241031 (attached as .config) compiler: gcc-5 (Debian 5.4.1-2)

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Alexei Starovoitov
On Tue, Oct 24, 2017 at 11:53:20AM +0800, Herbert Xu wrote: > On Mon, Oct 23, 2017 at 10:50:43PM -0500, Gustavo A. R. Silva wrote: > > > > Quoting Herbert Xu : > > > > >On Mon, Oct 23, 2017 at 01:18:57PM -0500, Gustavo A. R. Silva wrote: > > >>Use BUG_ON instead of if condition followed by BUG. >

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Herbert Xu
On Mon, Oct 23, 2017 at 10:50:43PM -0500, Gustavo A. R. Silva wrote: > > Quoting Herbert Xu : > > >On Mon, Oct 23, 2017 at 01:18:57PM -0500, Gustavo A. R. Silva wrote: > >>Use BUG_ON instead of if condition followed by BUG. > >> > >>This issue was detected with the help of Coccinelle. > >> > >>Si

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Quoting Herbert Xu : On Mon, Oct 23, 2017 at 01:18:57PM -0500, Gustavo A. R. Silva wrote: Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva I think this patch is terrible. Why on earth is Coccinelle

[PATCH V3 net-next] liquidio: pass date and time info to NIC firmware

2017-10-23 Thread Felix Manlunas
From: Veerasenareddy Burru Pass date and time information to NIC at the time of loading firmware and periodically update the host time to NIC firmware. This is to make NIC firmware use the same time reference as Host, so that it is easy to correlate logs from firmware and host for debugging. Sig

Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Herbert Xu
On Mon, Oct 23, 2017 at 01:18:57PM -0500, Gustavo A. R. Silva wrote: > Use BUG_ON instead of if condition followed by BUG. > > This issue was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva I think this patch is terrible. Why on earth is Coccinelle even warning abo

Re: [PATCH 0/2] 9p: Fixes for hard-to-hit bugs

2017-10-23 Thread Al Viro
On Tue, Oct 24, 2017 at 04:41:08AM +0300, Tuomas Tynkkynen wrote: > > I can pick those, or, if you (or somebody else) are willing to > > actively > > maintain a 9p tree, you could start sending straight to Linus - up to > > you. > > You can pick these up, I don't have plans for more patches right

[PATCH] rtlwifi: Remove seq_number from rtl_tid_data

2017-10-23 Thread pkshih
From: Ping-Ke Shih Since mac80211 maintains the sequence number for each STA/TID, driver doesn't need to maintain a copy. Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtlwifi/base.c | 6 ++ drivers/net/wireless/realtek/rtlwifi/pci.c | 17 - drivers/net/wir

[PATCH] rtlwifi: rtl8821ae: Fix typo in variable name

2017-10-23 Thread Nik Nyby
In _rtl8821ae_dbi_write(), wrtie_addr should be write_addr. Signed-off-by: Nik Nyby --- drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/r

Re: [PATCH 0/2] 9p: Fixes for hard-to-hit bugs

2017-10-23 Thread Tuomas Tynkkynen
Hi Al, On Fri, 2017-10-20 at 21:11 +0100, Al Viro wrote: > On Tue, Sep 26, 2017 at 04:10:14PM +0300, Tuomas Tynkkynen wrote: > > Hi Al, > > > > On Wed, 2017-09-06 at 17:59 +0300, Tuomas Tynkkynen wrote: > > > These two patches fix two hard-to-hit (but really annoying) bugs > > > in > > > 9p. > >

Re: [PATCH net] xfrm: Clear sk_dst_cache when applying per-socket policy.

2017-10-23 Thread Jonathan Basseri 😶
On Mon, Oct 23, 2017 at 6:18 PM, Jonathan Basseri wrote: > If a socket has a valid dst cache, then xfrm_lookup_route will get > skipped. However, the cache is not invalidated when applying policy to a > socket (i.e. IPV6_XFRM_POLICY). The result is that new policies are > sometimes ignored on thos

[PATCH net] xfrm: Clear sk_dst_cache when applying per-socket policy.

2017-10-23 Thread Jonathan Basseri
If a socket has a valid dst cache, then xfrm_lookup_route will get skipped. However, the cache is not invalidated when applying policy to a socket (i.e. IPV6_XFRM_POLICY). The result is that new policies are sometimes ignored on those sockets. (Note: This was broken for IPv4 and IPv6 at different t

Re: Linux ECN Handling

2017-10-23 Thread Neal Cardwell
On Mon, Oct 23, 2017 at 6:15 PM, Steve Ibanez wrote: > Hi All, > > I upgraded the kernel on all of our machines to Linux > 4.13.8-041308-lowlatency. However, I'm still observing the same > behavior where the source enters a timeout when the CWND=1MSS and it > receives ECN marks. > > Here are the m

RE: [PATCH] drivers/net/usb: add device id for TP-LINK UE300 USB 3.0 Ethernet

2017-10-23 Thread Ran Wang
Hi Oliver > -Original Message- > From: Oliver Neukum [mailto:oneu...@suse.com] > Sent: Monday, October 23, 2017 6:56 PM > To: Ran Wang > Cc: David S . Miller ; hayeswang > ; linux-ker...@vger.kernel.org; linux- > u...@vger.kernel.org; netdev@vger.kernel.org > Subject: Re: [PATCH] drivers/n

Re: [PATCH net-next 0/2] net: dsa: don't unmask port bitmaps

2017-10-23 Thread Florian Fainelli
On 10/23/2017 02:26 PM, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn writes: > >> On Mon, Oct 23, 2017 at 02:17:29PM -0400, Vivien Didelot wrote: >>> DSA has several bitmaps to store the type of ports: cpu_port_mask, >>> dsa_port_mask and enabled_port_mask. But the code is inconsistently >

Re: [PATCH v2 net-next 0/6] add a set of tracepoints to tcp stack

2017-10-23 Thread David Miller
From: Song Liu Date: Mon, 23 Oct 2017 09:20:21 -0700 > Changes from v1: > > Fix build error (with ipv6 as ko) by adding EXPORT_TRACEPOINT_SYMBOL_GPL > for trace_tcp_send_reset. Series applied.

Re: [PATCH net-next 00/12] tools: bpftool: Add JSON output to bpftool

2017-10-23 Thread David Miller
From: Jakub Kicinski Date: Mon, 23 Oct 2017 09:24:04 -0700 > Quentin says: > > This series introduces support for JSON output to all bpftool commands. It > adds option parsing, and several options are created: > > * -j, --json Switch to JSON output. > * -p, --pretty Switch to JSON and

Re: [PATCH net-next 0/7] net: hns3: bug fixes & code improvements

2017-10-23 Thread David Miller
From: Lipeng Date: Mon, 23 Oct 2017 19:51:00 +0800 > This patchset introduces various HNS3 bug fixes, optimizations and code > improvements. Series applied.

Re: [PATCH 0/3] pull request for net-next: batman-adv 2017-10-23

2017-10-23 Thread David Miller
From: Simon Wunderlich Date: Mon, 23 Oct 2017 17:37:01 +0200 > here is another small documentation/cleanup pull request of batman-adv to go > into net-next. > > Please pull or let me know of any problem! Pulled, thanks Simon.

Hello

2017-10-23 Thread Mrs. Liz
Dear Sir/Madam Greetings to you My name is Mrs. Liz Clayton I am 73 years old, I am a dying woman who has decided to donate what I have to you/churches/ motherless babies/less privileged/widows.I was diagnosed with cancer for about 2 years ago. I have been touched by God to donate from what I h

Re: [Patch net 00/15] net_sched: remove RCU callbacks from TC

2017-10-23 Thread Eric Dumazet
On Mon, 2017-10-23 at 16:23 -0700, Cong Wang wrote: > On Mon, Oct 23, 2017 at 4:16 PM, Eric Dumazet wrote: > > On Mon, 2017-10-23 at 15:02 -0700, Cong Wang wrote: > > > >> b) As suggested by Paul, we could defer the work to a workqueue and > >> gain the permission of holding RTNL again without any

Re: [PATCH net-next v7 5/5] selinux: bpf: Add addtional check for bpf object file receive

2017-10-23 Thread Paul Moore
On Wed, Oct 18, 2017 at 4:00 PM, Chenbo Feng wrote: > From: Chenbo Feng > > Introduce a bpf object related check when sending and receiving files > through unix domain socket as well as binder. It checks if the receiving > process have privilege to read/write the bpf map or use the bpf program. >

Re: [PATCH net-next v7 4/5] selinux: bpf: Add selinux check for eBPF syscall operations

2017-10-23 Thread Paul Moore
On Wed, Oct 18, 2017 at 4:00 PM, Chenbo Feng wrote: > From: Chenbo Feng > > Implement the actual checks introduced to eBPF related syscalls. This > implementation use the security field inside bpf object to store a sid that > identify the bpf object. And when processes try to access the object, >

Re: [Patch net 00/15] net_sched: remove RCU callbacks from TC

2017-10-23 Thread Cong Wang
On Mon, Oct 23, 2017 at 4:16 PM, Eric Dumazet wrote: > On Mon, 2017-10-23 at 15:02 -0700, Cong Wang wrote: > >> b) As suggested by Paul, we could defer the work to a workqueue and >> gain the permission of holding RTNL again without any performance >> impact, however, this seems impossible too, be

[PATCH net-next 5/7] ipv6: addrconf: do not block BH in ipv6_get_ifaddr()

2017-10-23 Thread Eric Dumazet
rcu_read_lock() is enough here, no need to block BH. Signed-off-by: Eric Dumazet --- net/ipv6/addrconf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index a6cf37b7e34c461e204153078be92c3e297b3ec2..6c1e7ffb62ff2333d63b3c7639

[PATCH net-next 1/7] ipv6: addrconf: move ipv6_chk_same_addr() to avoid forward declaration

2017-10-23 Thread Eric Dumazet
ipv6_chk_same_addr() is only used by ipv6_add_addr_hash(), so moving it avoids a forward declaration. Signed-off-by: Eric Dumazet --- net/ipv6/addrconf.c | 35 +-- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrc

[PATCH net-next 2/7] ipv6: addrconf: factorize inet6_addr_hash() call

2017-10-23 Thread Eric Dumazet
ipv6_add_addr_hash() can compute the hash value outside of locked section and pass it to ipv6_chk_same_addr(). Signed-off-by: Eric Dumazet --- net/ipv6/addrconf.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index

[PATCH net-next 4/7] ipv6: addrconf: do not block BH in ipv6_chk_addr_and_flags()

2017-10-23 Thread Eric Dumazet
rcu_read_lock() is enough here, as inet6_ifa_finish_destroy() uses kfree_rcu() Signed-off-by: Eric Dumazet --- net/ipv6/addrconf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index d70d98122053652b4f4420786de8788c6c9385ff..

[PATCH net-next 3/7] ipv6: addrconf: add per netns perturbation in inet6_addr_hash()

2017-10-23 Thread Eric Dumazet
Bring IPv6 in par with IPv4 : - Use net_hash_mix() to spread addresses a bit more. - Use 256 slots hash table instead of 16 Signed-off-by: Eric Dumazet --- include/net/addrconf.h | 2 +- net/ipv6/addrconf.c| 16 +--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git

[PATCH net-next 6/7] ipv6: addrconf: do not block BH in /proc/net/if_inet6 handling

2017-10-23 Thread Eric Dumazet
Table is really RCU protected, no need to block BH Signed-off-by: Eric Dumazet --- net/ipv6/addrconf.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 6c1e7ffb62ff2333d63b3c7639d99649d43b32fc..9232e9537082ea44f

[PATCH net-next 7/7] ipv6: addrconf: do not block BH in ipv6_chk_home_addr()

2017-10-23 Thread Eric Dumazet
rcu_read_lock() is enough here, no need to block BH. Signed-off-by: Eric Dumazet --- net/ipv6/addrconf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 9232e9537082ea44f5e0af4e4b0d052d780395fd..5a8a10229a07fe3d3f96b237e7

[PATCH net-next 0/7] ipv6: addrconf: hash improvements and cleanups

2017-10-23 Thread Eric Dumazet
Remove unecessary BH blocking, and bring IPv6 addrconf to modern world, with per netns hash perturbation and decent hash size. Eric Dumazet (7): ipv6: addrconf: move ipv6_chk_same_addr() to avoid forward declaration ipv6: addrconf: factorize inet6_addr_hash() call ipv6: addrconf: add per net

Re: [Patch net 00/15] net_sched: remove RCU callbacks from TC

2017-10-23 Thread Eric Dumazet
On Mon, 2017-10-23 at 15:02 -0700, Cong Wang wrote: > b) As suggested by Paul, we could defer the work to a workqueue and > gain the permission of holding RTNL again without any performance > impact, however, this seems impossible too, because as lockdep > complains we have a deadlock when flushin

Re: Linux ECN Handling

2017-10-23 Thread Steve Ibanez
Hi All, I upgraded the kernel on all of our machines to Linux 4.13.8-041308-lowlatency. However, I'm still observing the same behavior where the source enters a timeout when the CWND=1MSS and it receives ECN marks. Here are the measured flow rates:

[PATCH v2 net] tcp/dccp: fix other lockdep splats accessing ireq_opt

2017-10-23 Thread Eric Dumazet
From: Eric Dumazet In my first attempt to fix the lockdep splat, I forgot we could enter inet_csk_route_req() with a freshly allocated request socket, for which refcount has not yet been elevated, due to complex SLAB_TYPESAFE_BY_RCU rules. We either are in rcu_read_lock() section _or_ we own a r

Re: [PATCH v2 net-next 2/2] ibmvnic: Fix failover error path for non-fatal resets

2017-10-23 Thread kbuild test robot
Hi John, [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/John-Allen/ibmvnic-Update-reset-infrastructure-to-support-tunable-parameters/20171024-062007 config: powerpc-allmodconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9

Re: [PATCH net] tcp/dccp: fix again lockdep splat in inet_csk_route_req()

2017-10-23 Thread Eric Dumazet
On Mon, 2017-10-23 at 08:02 -0700, Eric Dumazet wrote: > From: Eric Dumazet > > In my first attempt to fix the lockdep splat, I forgot we could > enter inet_csk_route_req() with a freshly allocated request socket, > for which refcount has not yet been elevated, due to complex > SLAB_TYPESAFE_BY_R

Re: [PATCH net-next] ipv6: add ip6_null_entry check in rt6_select()

2017-10-23 Thread Martin KaFai Lau
On Mon, Oct 23, 2017 at 09:59:35PM +, Wei Wang wrote: > From: Wei Wang > > In rt6_select(), fn->leaf could be pointing to net->ipv6.ip6_null_entry. > In this case, we should directly return instead of trying to carry on > with the rest of the process. > If not, we could crash at: > spin_loc

Re: [PATCH v3 net-next] tcp: Configure TFO without cookie per socket and/or per route

2017-10-23 Thread Yuchung Cheng
On Mon, Oct 23, 2017 at 1:22 PM, Christoph Paasch wrote: > > We already allow to enable TFO without a cookie by using the > fastopen-sysctl and setting it to TFO_SERVER_COOKIE_NOT_REQD (or > TFO_CLIENT_NO_COOKIE). > This is safe to do in certain environments where we know that there > isn't a mali

[PATCH net-next v2 1/3] bpf: use the same condition in perf event set/free bpf handler

2017-10-23 Thread Yonghong Song
This is a cleanup such that doing the same check in perf_event_free_bpf_prog as we already do in perf_event_set_bpf_prog step. Signed-off-by: Yonghong Song Acked-by: Alexei Starovoitov Acked-by: Martin KaFai Lau --- kernel/events/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(

[PATCH net-next v2 3/3] bpf: add a test case to test single tp multiple bpf attachment

2017-10-23 Thread Yonghong Song
The bpf sample program syscall_tp is modified to show attachment of more than bpf programs for a particular kernel tracepoint. Signed-off-by: Yonghong Song Acked-by: Alexei Starovoitov Acked-by: Martin KaFai Lau --- samples/bpf/syscall_tp_user.c | 66 ++-

[PATCH net-next v2 0/3] bpf: permit multiple bpf attachments for a single perf tracepoint event

2017-10-23 Thread Yonghong Song
This patch set adds support to permit multiple bpf prog attachments for a single perf tracepoint event. Patch 1 does some cleanup such that perf_event_{set|free}_bpf_handler is called under the same condition. Patch 2 has the core implementation, and Patch 3 adds a test case. Changelogs: v1 -> v2:

[PATCH net-next v2 2/3] bpf: permit multiple bpf attachments for a single perf event

2017-10-23 Thread Yonghong Song
This patch enables multiple bpf attachments for a kprobe/uprobe/tracepoint single trace event. Each trace_event keeps a list of attached perf events. When an event happens, all attached bpf programs will be executed based on the order of attachment. A global bpf_event_mutex lock is introduced to p

Re: [PATCH v8 02/10] dt-bindings: net: dwmac-sun8i: update documentation about integrated PHY

2017-10-23 Thread Rob Herring
On Mon, Oct 23, 2017 at 08:56:18PM +0200, Corentin Labbe wrote: > This patch add documentation about the MDIO switch used on sun8i-h3-emac > for integrated PHY. > > Signed-off-by: Corentin Labbe > --- > .../devicetree/bindings/net/dwmac-sun8i.txt| 139 > +++-- > 1 file c

[Patch net 03/15] net_sched: remove RCU callbacks in flower filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(), except in fl_destroy() we have to use list_splice_init_rcu(). As a bonus, this also drops the ugly code in commit d936377414fa ("net, sched: respect rcu grace period on cls destruction"). Reported-by: Chris Mi Cc: Daniel Borkmann Cc: Jiri Pirko Cc: Jo

[Patch net 11/15] net_sched: remove RCU callbacks in route filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(). Similarly, route4_destroy() is special here, because it deletes all elements from a hashtable, we definitely don't want to wait for each element, however we can unpublish the whole hashtable from upper layer first, so that after one grace period, the whol

[Patch net 05/15] net_sched: remove RCU callbacks in cgroup filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(). Reported-by: Chris Mi Cc: Daniel Borkmann Cc: Jiri Pirko Cc: John Fastabend Cc: Jamal Hadi Salim Cc: "Paul E. McKenney" Signed-off-by: Cong Wang --- net/sched/cls_cgroup.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) d

[Patch net 08/15] net_sched: remove RCU callbacks in tcindex filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(). Reported-by: Chris Mi Cc: Daniel Borkmann Cc: John Fastabend Cc: Jamal Hadi Salim Cc: "Paul E. McKenney" Signed-off-by: Cong Wang --- net/sched/cls_tcindex.c | 35 +-- 1 file changed, 13 insertions(+), 22 deletions(-

[Patch net 06/15] net_sched: remove RCU callbacks in rsvp filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(). I don't touch the rest kfree_rcu() because they are not relevant here and they are more complicated. Reported-by: Chris Mi Cc: Daniel Borkmann Cc: Jiri Pirko Cc: John Fastabend Cc: Jamal Hadi Salim Cc: "Paul E. McKenney" Signed-off-by: Cong Wang --

[Patch net 07/15] net_sched: remove RCU callbacks in flow filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(), except in flow_destroy() we have to use list_splice_init_rcu(). Reported-by: Chris Mi Cc: Daniel Borkmann Cc: John Fastabend Cc: Jamal Hadi Salim Cc: "Paul E. McKenney" Signed-off-by: Cong Wang --- net/sched/cls_flow.c | 24 +---

[Patch net 13/15] net_sched: add rtnl assertion to tcf_exts_destroy()

2017-10-23 Thread Cong Wang
After previous patches, it is now safe to claim that tcf_exts_destroy() is always called with RTNL lock. Cc: Jiri Pirko Cc: John Fastabend Cc: Jamal Hadi Salim Cc: "Paul E. McKenney" Signed-off-by: Cong Wang --- net/sched/cls_api.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sche

[Patch net 04/15] net_sched: remove RCU callbacks in matchall filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(). Reported-by: Chris Mi Cc: Daniel Borkmann Cc: Jiri Pirko Cc: John Fastabend Cc: Jamal Hadi Salim Cc: "Paul E. McKenney" Signed-off-by: Cong Wang --- net/sched/cls_matchall.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --gi

[Patch net 10/15] net_sched: remove RCU callbacks in fw filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(). Similarly, fw_destroy() is special here, because it deletes all elements from a hashtable, we definitely don't want to wait for each element, however we can unpublish the whole hashtable from upper layer first, so that after one grace period, the whole ha

[Patch net 09/15] net_sched: remove RCU callbacks in u32 filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(). Note, u32_clear_hnode() is very special here, because it deletes all elements from a hashtable, we definitely don't want to wait for each element, however we can unpublish the whole hashtable from upper layer first, so that after one grace period, the who

[Patch net 15/15] selftests: Introduce a new test case to tc testsuite

2017-10-23 Thread Cong Wang
From: Chris Mi From: Chris Mi In this patchset, we fixed a tc bug. This patch adds the test case that reproduces the bug. To run this test case, user should specify an existing NIC device: # sudo ./tdc.py -d enp4s0f0 This test case belongs to category "flower". If user doesn't specify a NIC

[Patch net 14/15] selftests: Introduce a new script to generate tc batch file

2017-10-23 Thread Cong Wang
From: Chris Mi From: Chris Mi # ./tdc_batch.py -h usage: tdc_batch.py [-h] [-n NUMBER] [-o] [-s] [-p] device file TC batch file generator positional arguments: devicedevice name file batch file name optional arguments: -h, --help

[Patch net 12/15] net_sched: remove RCU callbacks in sample action

2017-10-23 Thread Cong Wang
The ->cleanup() now can block, it is okay to change it to synchronize_rcu(). This could also fix a use-after-free in module unloading. Cc: Yotam Gigi Cc: Jiri Pirko Cc: Jamal Hadi Salim Cc: "Paul E. McKenney" Signed-off-by: Cong Wang --- include/net/tc_act/tc_sample.h | 1 - net/sched/act_s

[Patch net 02/15] net_sched: remove RCU callbacks in bpf filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(), except in cls_bpf_destroy() we have to use list_splice_init_rcu(). Reported-by: Chris Mi Cc: Daniel Borkmann Cc: John Fastabend Cc: Jamal Hadi Salim Cc: "Paul E. McKenney" Signed-off-by: Cong Wang --- net/sched/cls_bpf.c | 22 +++---

[Patch net 01/15] net_sched: remove RCU callbacks in basic filter

2017-10-23 Thread Cong Wang
Replace call_rcu() with synchronize_rcu(), except in basic_destroy() we have to use list_splice_init_rcu(). Reported-by: Chris Mi Cc: Daniel Borkmann Cc: John Fastabend Cc: Jamal Hadi Salim Cc: "Paul E. McKenney" Signed-off-by: Cong Wang --- net/sched/cls_basic.c | 23 --

[Patch net 00/15] net_sched: remove RCU callbacks from TC

2017-10-23 Thread Cong Wang
Recently, the RCU callbacks used in TC filters and TC actions keep drawing my attention, they introduce at least 4 race condition bugs: 1. A simple one fixed by Daniel: commit c78e1746d3ad7d548bdf3fe491898cc453911a49 Author: Daniel Borkmann Date: Wed May 20 17:13:33 2015 +0200 net: sched:

[PATCH net-next] ipv6: add ip6_null_entry check in rt6_select()

2017-10-23 Thread Wei Wang
From: Wei Wang In rt6_select(), fn->leaf could be pointing to net->ipv6.ip6_null_entry. In this case, we should directly return instead of trying to carry on with the rest of the process. If not, we could crash at: spin_lock_bh(&leaf->rt6i_table->rt6_lock); because net->ipv6.ip6_null_entry does

Re: [PATCH v8 01/10] dt-bindings: net: Restore sun8i dwmac binding

2017-10-23 Thread Rob Herring
On Mon, Oct 23, 2017 at 08:56:17PM +0200, Corentin Labbe wrote: > The original dwmac-sun8i DT bindings have some issue on how to handle > integrated PHY and was reverted in last RC of 4.13. > But now we have a solution so we need to get back that was reverted. > > This patch restore dt-bindings do

[patch net-next] net: core: introduce mini_Qdisc and eliminate usage of tp->q for clsact fastpath

2017-10-23 Thread Jiri Pirko
From: Jiri Pirko In sch_handle_egress and sch_handle_ingress tp->q is used only in order to update stats. So stats and filter list are the only things that are needed in clsact qdisc fastpath processing. Introduce new mini_Qdisc struct to hold those items. This removes need for tp->q usage withou

Re: [PATCH net-next 0/2] net: dsa: don't unmask port bitmaps

2017-10-23 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Mon, Oct 23, 2017 at 02:17:29PM -0400, Vivien Didelot wrote: >> DSA has several bitmaps to store the type of ports: cpu_port_mask, >> dsa_port_mask and enabled_port_mask. But the code is inconsistently >> unmasking them. >> >> The legacy code tries to unmask

Re: [PATCH net-next 0/2] net: dsa: don't unmask port bitmaps

2017-10-23 Thread Andrew Lunn
On Mon, Oct 23, 2017 at 02:17:29PM -0400, Vivien Didelot wrote: > DSA has several bitmaps to store the type of ports: cpu_port_mask, > dsa_port_mask and enabled_port_mask. But the code is inconsistently > unmasking them. > > The legacy code tries to unmask cpu_port_mask and dsa_port_mask but > ski

Re: [PATCH net-next 2/3] bpf: permit multiple bpf attachments for a single perf event

2017-10-23 Thread Yonghong Song
On 10/23/17 1:52 PM, Daniel Borkmann wrote: On 10/23/2017 07:58 PM, Yonghong Song wrote: [...]   __this_cpu_dec(bpf_prog_active); @@ -741,3 +754,63 @@ const struct bpf_verifier_ops perf_event_verifier_ops = {   const struct bpf_prog_ops perf_event_prog_ops = {   }; + +static DEFINE_MUTE

Re: [PATCH net-next 2/3] bpf: permit multiple bpf attachments for a single perf event

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 07:58 PM, Yonghong Song wrote: [...] __this_cpu_dec(bpf_prog_active); @@ -741,3 +754,63 @@ const struct bpf_verifier_ops perf_event_verifier_ops = { const struct bpf_prog_ops perf_event_prog_ops = { }; + +static DEFINE_MUTEX(bpf_event_mutex); + +int perf_event_attach_bp

Re: [net-next PATCH] bpf: cpumap fix potential lost wake-up problem

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 07:39 PM, Jesper Dangaard Brouer wrote: As pointed out by Michael, commit 1c601d829ab0 ("bpf: cpumap xdp_buff to skb conversion and allocation") contains a classical example of the potential lost wake-up problem. We need to recheck the condition __ptr_ring_empty() after changing cu

Re: [PATCH net-next 12/12] tools: bpftool: update documentation for --json and --pretty usage

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet Update the documentation to provide help about JSON output generation, and add an example in bpftool-prog manual page. Also reintroduce an example that was left aside when the tool was moved from GitHub to the kernel sources, i

Re: [PATCH net-next 10/12] tools: bpftool: provide JSON output for all possible commands

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet As all commands can now return JSON output (possibly just a "null" value), output of `bpftool --json batch file FILE` should also be fully JSON compliant. Signed-off-by: Quentin Monnet Acked-by: Daniel Borkmann

Re: [PATCH net-next 11/12] tools: bpftool: add cosmetic changes for the manual pages

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet Make the look-and-feel of the manual pages somewhat closer to other manual pages, such as the ones from the utilities from iproute2, by highlighting more keywords. Signed-off-by: Quentin Monnet Acked-by: Jakub Kicinski Acke

Re: [PATCH net-next 09/12] tools: bpftool: turn err() and info() macros into functions

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet Turn err() and info() macros into functions. In order to avoid naming conflicts with variables in the code, rename them as p_err() and p_info() respectively. The behavior of these functions is similar to the one of the macros

Re: [PATCH net-next 08/12] tools: bpftool: add JSON output for `bpftool batch file FILE` command

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet `bpftool batch file FILE` takes FILE as an argument and executes all the bpftool commands it finds inside (or stops if an error occurs). To obtain a consistent JSON output, create a root JSON array, then for each command create

Re: [PATCH net-next 07/12] tools: bpftool: add JSON output for `bpftool map *` commands

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet Reuse the json_writer API introduced in an earlier commit to make bpftool able to generate JSON output on `bpftool map { show | dump | lookup | getnext }` commands. Remaining commands produce no output. Some functions have been

Re: [PATCH net-next 06/12] tools: bpftool: add JSON output for `bpftool prog dump xlated *` command

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet Add a new printing function to dump translated eBPF instructions as JSON. As for plain output, opcodes are printed only on request (when `opcodes` is provided on the command line). The disassembled output is generated by the sa

Re: [PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread J. Bruce Fields
In the past we've avoided BUG_ON(X) where X might have side effects, on the theory that it should actually be OK just to compile out BUG_ON()s. Has that changed? In any case, I don't find that this improves readability; dropping. --b. On Mon, Oct 23, 2017 at 01:16:35PM -0500, Gustavo A. R. Silva

Re: [PATCH net-next 04/12] tools: bpftool: add JSON output for `bpftool prog show *` command

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet Reuse the json_writer API introduced in an earlier commit to make bpftool able to generate JSON output on `bpftool prog show *` commands. For readability, the code from show_prog() has been split into two functions, one for pla

Re: [PATCH net-next 05/12] tools: bpftool: add JSON output for `bpftool prog dump jited *` command

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet Reuse the json_writer API introduced in an earlier commit to make bpftool able to generate JSON output on `bpftool prog show *` commands. A new printing function is created to be passed as an argument to the disassembler. Simil

Re: [PATCH net-next 03/12] tools: bpftool: introduce --json and --pretty options

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet These two options can be used to ask for a JSON output (--j or -json), and to make this JSON human-readable (-p or --pretty). A json_writer object is created when JSON is required, and will be used in follow-up commits to produ

Re: [PATCH net-next 02/12] tools: bpftool: add option parsing to bpftool, --help and --version

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet Add an option parsing facility to bpftool, in prevision of future options for demanding JSON output. Currently, two options are added: --help and --version, that act the same as the respective commands `help` and `version`. Sig

Re: [PATCH net-next 01/12] tools: bpftool: copy JSON writer from iproute2 repository

2017-10-23 Thread Daniel Borkmann
On 10/23/2017 06:24 PM, Jakub Kicinski wrote: From: Quentin Monnet In prevision of following commits, supposed to add JSON output to the tool, two files are copied from the iproute2 repository (taken at commit 268a9eee985f): lib/json_writer.c and include/json_writer.h. Signed-off-by: Quentin M

[PATCH v3 net-next] tcp: Configure TFO without cookie per socket and/or per route

2017-10-23 Thread Christoph Paasch
We already allow to enable TFO without a cookie by using the fastopen-sysctl and setting it to TFO_SERVER_COOKIE_NOT_REQD (or TFO_CLIENT_NO_COOKIE). This is safe to do in certain environments where we know that there isn't a malicous host (aka., data-centers) or when the application-protocol alread

  1   2   3   >