[PATCH net-next 0/2] mlxsw: Add support for 400Gbps (50Gbps per lane) link modes

2019-10-09 Thread Ido Schimmel
From: Ido Schimmel Jiri says: Add 400Gbps bits to ethtool and introduce support in mlxsw. These modes are supported by the Spectrum-2 switch ASIC. Jiri Pirko (2): ethtool: Add support for 400Gbps (50Gbps per lane) link modes mlxsw: spectrum: Add support for 400Gbps (50Gbps per lane) link mo

[PATCH net-next 2/2] mlxsw: spectrum: Add support for 400Gbps (50Gbps per lane) link modes

2019-10-09 Thread Ido Schimmel
From: Jiri Pirko Extend speed support with 400Gbps Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/reg.h | 1 + .../net/ethernet/mellanox/mlxsw/spectrum.c| 52 +++ 2 files changed, 43 insertions(+), 10 deletions(-) diff -

[PATCH net-next 1/2] ethtool: Add support for 400Gbps (50Gbps per lane) link modes

2019-10-09 Thread Ido Schimmel
From: Jiri Pirko Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- drivers/net/phy/phy-core.c | 10 +- include/uapi/linux/ethtool.h | 6 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c index 941266

Re: [PATCH net] net: silence KCSAN warnings about sk->sk_backlog.len reads

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 15:41:03 -0700, Eric Dumazet wrote: > sk->sk_backlog.len can be written by BH handlers, and read > from process contexts in a lockless way. > > Note the write side should also use WRITE_ONCE() or a variant. > We need some agreement about the best way to do this. > > syzbot rep

Re: [PATCH net] net: annotate sk->sk_rcvlowat lockless reads

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 15:32:35 -0700, Eric Dumazet wrote: > sock_rcvlowat() or int_sk_rcvlowat() might be called without the socket > lock for example from tcp_poll(). > > Use READ_ONCE() to document the fact that other cpus might change > sk->sk_rcvlowat under us and avoid KCSAN splats. > > Use WR

Re: [PATCH net] net: silence KCSAN warnings around sk_add_backlog() calls

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 15:21:13 -0700, Eric Dumazet wrote: > sk_add_backlog() callers usually read sk->sk_rcvbuf without > owning the socket lock. This means sk_rcvbuf value can > be changed by other cpus, and KCSAN complains. > > Add READ_ONCE() annotations to document the lockless nature > of these

Re: [PATCH net] net: add {READ|WRITE}_ONCE() annotations on ->rskq_accept_head

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 14:51:20 -0700, Eric Dumazet wrote: > reqsk_queue_empty() is called from inet_csk_listen_poll() while > other cpus might write ->rskq_accept_head value. > > Use {READ|WRITE}_ONCE() to avoid compiler tricks > and potential KCSAN splats. > > Fixes: fff1f3001cc5 ("tcp: add a spin

Re: [PATCH net] tcp: annotate lockless access to tcp_memory_pressure

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 15:10:15 -0700, Eric Dumazet wrote: > tcp_memory_pressure is read without holding any lock, > and its value could be changed on other cpus. > > Use READ_ONCE() to annotate these lockless reads. > > The write side is already using atomic ops. > > Fixes: b8da51ebb1aa ("tcp: int

Re: [PATCH bpf-next] scripts/bpf: fix xdp_md forward declaration typo

2019-10-09 Thread Alexei Starovoitov
On Wed, Oct 9, 2019 at 9:25 PM Andrii Nakryiko wrote: > > Fix typo in struct xpd_md, generated from bpf_helpers_doc.py, which is > causing compilation warnings for programs using bpf_helpers.h > > Fixes: 7a387bed47f7 ("scripts/bpf: teach bpf_helpers_doc.py to dump BPF > helper definitions") > Sig

Re: [PATCH bpf-next v3 1/5] bpf: Support chain calling multiple BPF programs after each other

2019-10-09 Thread Alexei Starovoitov
On Wed, Oct 09, 2019 at 10:03:43AM +0200, Toke Høiland-Jørgensen wrote: > Alexei Starovoitov writes: > > > Please implement proper indirect calls and jumps. > > I am still not convinced this will actually solve our problem; but OK, I > can give it a shot. If you're not convinced let's talk abou

Re: [PATCH net] net: avoid possible false sharing in sk_leave_memory_pressure()

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 12:55:53 -0700, Eric Dumazet wrote: > As mentioned in > https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-improve-performance > a C compiler can legally transform : > > if (memory_pressure && *memory_pressure) > *memory_pressure = 0; > > to : > > i

Re: [PATCH net-next] Change in Openvswitch to support MPLS label depth of 3 in ingress direction

2019-10-09 Thread Martin Varghese
On Wed, Oct 09, 2019 at 08:29:51AM -0700, Pravin Shelar wrote: > On Mon, Oct 7, 2019 at 9:41 PM Martin Varghese > wrote: > > > > From: Martin Varghese > > > > The openvswitch was supporting a MPLS label depth of 1 in the ingress > > direction though the userspace OVS supports a max depth of 3 lab

Re: [PATCH net] tun: remove possible false sharing in tun_flow_update()

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 09:20:02 -0700, Eric Dumazet wrote: > As mentioned in > https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-improve-performance > a C compiler can legally transform > > if (e->queue_index != queue_index) > e->queue_index = queue_index; > > to : > >

Re: [PATCH net] netfilter: conntrack: avoid possible false sharing

2019-10-09 Thread Eric Dumazet
On 10/9/19 9:24 PM, Jakub Kicinski wrote: > On Wed, 9 Oct 2019 09:19:13 -0700, Eric Dumazet wrote: >> As hinted by KCSAN, we need at least one READ_ONCE() >> to prevent a compiler optimization. >> >> More details on : >> https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-impro

[PATCH bpf-next] scripts/bpf: fix xdp_md forward declaration typo

2019-10-09 Thread Andrii Nakryiko
Fix typo in struct xpd_md, generated from bpf_helpers_doc.py, which is causing compilation warnings for programs using bpf_helpers.h Fixes: 7a387bed47f7 ("scripts/bpf: teach bpf_helpers_doc.py to dump BPF helper definitions") Signed-off-by: Andrii Nakryiko --- scripts/bpf_helpers_doc.py | 2 +-

Re: [PATCH net] netfilter: conntrack: avoid possible false sharing

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 09:19:13 -0700, Eric Dumazet wrote: > As hinted by KCSAN, we need at least one READ_ONCE() > to prevent a compiler optimization. > > More details on : > https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-improve-performance > > [...] > > Fixes: cc16921351d8

[PATCH v2 bpf-next 08/12] bpf: add support for BTF pointers to interpreter

2019-10-09 Thread Alexei Starovoitov
Pointer to BTF object is a pointer to kernel object or NULL. The memory access in the interpreter has to be done via probe_kernel_read to avoid page faults. Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko --- include/linux/filter.h | 3 +++ kernel/bpf/core.c | 19 +

[PATCH v2 bpf-next 09/12] bpf: add support for BTF pointers to x86 JIT

2019-10-09 Thread Alexei Starovoitov
Pointer to BTF object is a pointer to kernel object or NULL. Such pointers can only be used by BPF_LDX instructions. The verifier changed their opcode from LDX|MEM|size to LDX|PROBE_MEM|size to make JITing easier. The number of entries in extable is the number of BPF_LDX insns that access kernel me

[PATCH v2 bpf-next 11/12] bpf: disallow bpf_probe_read[_str] helpers

2019-10-09 Thread Alexei Starovoitov
Disallow bpf_probe_read() and bpf_probe_read_str() helpers in raw_tracepoint bpf programs that use in-kernel BTF to track types of memory accesses. Signed-off-by: Alexei Starovoitov --- kernel/trace/bpf_trace.c | 4 1 file changed, 4 insertions(+) diff --git a/kernel/trace/bpf_trace.c b/ke

[PATCH v2 bpf-next 06/12] bpf: implement accurate raw_tp context access via BTF

2019-10-09 Thread Alexei Starovoitov
libbpf analyzes bpf C program, searches in-kernel BTF for given type name and stores it into expected_attach_type. The kernel verifier expects this btf_id to point to something like: typedef void (*btf_trace_kfree_skb)(void *, struct sk_buff *skb, void *loc); which represents signature of raw_trace

Re: [PATCHv2 net-next] team: call RCU read lock when walking the port_list

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 20:18:28 +0800, Hangbin Liu wrote: > Before reading the team port list, we need to acquire the RCU read lock. > Also change list_for_each_entry() to list_for_each_entry_rcu(). > > v2: > repost the patch to net-next and remove fixes flag as this is a cosmetic > change. > > Sugg

[PATCH v2 bpf-next 05/12] libbpf: auto-detect btf_id of raw_tracepoint

2019-10-09 Thread Alexei Starovoitov
For raw tracepoint program types libbpf will try to find btf_id of raw tracepoint in vmlinux's BTF. It's a responsiblity of bpf program author to annotate the program with SEC("raw_tracepoint/name") where "name" is a valid raw tracepoint. If "name" is indeed a valid raw tracepoint then in-kernel BT

[PATCH v2 bpf-next 07/12] bpf: attach raw_tp program with BTF via type name

2019-10-09 Thread Alexei Starovoitov
BTF type id specified at program load time has all necessary information to attach that program to raw tracepoint. Use kernel type name to find raw tracepoint. Signed-off-by: Alexei Starovoitov --- kernel/bpf/syscall.c | 67 +--- 1 file changed, 44 inserti

[PATCH v2 bpf-next 12/12] selftests/bpf: add kfree_skb raw_tp test

2019-10-09 Thread Alexei Starovoitov
Load basic cls_bpf program. Load raw_tracepoint program and attach to kfree_skb raw tracepoint. Trigger cls_bpf via prog_test_run. At the end of test_run kernel will call kfree_skb which will trigger trace_kfree_skb tracepoint. Which will call our raw_tracepoint program. Which will take that skb an

[PATCH v2 bpf-next 04/12] bpf: add attach_btf_id attribute to program load

2019-10-09 Thread Alexei Starovoitov
Add attach_btf_id attribute to prog_load command. It's similar to existing expected_attach_type attribute which is used in several cgroup based program types. Unfortunately expected_attach_type is ignored for tracing programs and cannot be reused for new purpose. Hence introduce attach_btf_id to ve

[PATCH v2 bpf-next 10/12] bpf: check types of arguments passed into helpers

2019-10-09 Thread Alexei Starovoitov
Introduce new helper that reuses existing skb perf_event output implementation, but can be called from raw_tracepoint programs that receive 'struct sk_buff *' as tracepoint argument or can walk other kernel data structures to skb pointer. In order to do that teach verifier to resolve true C types

[PATCH v2 bpf-next 03/12] bpf: process in-kernel BTF

2019-10-09 Thread Alexei Starovoitov
If in-kernel BTF exists parse it and prepare 'struct btf *btf_vmlinux' for further use by the verifier. In-kernel BTF is trusted just like kallsyms and other build artifacts embedded into vmlinux. Yet run this BTF image through BTF verifier to make sure that it is valid and it wasn't mangled during

[PATCH v2 bpf-next 02/12] bpf: add typecast to bpf helpers to help BTF generation

2019-10-09 Thread Alexei Starovoitov
When pahole converts dwarf to btf it emits only used types. Wrap existing bpf helper functions into typedef and use it in typecast to make gcc emits this type into dwarf. Then pahole will convert it to btf. The "btf_#name_of_helper" types will be used to figure out types of arguments of bpf helpers

[PATCH v2 bpf-next 00/12] bpf: revolutionize bpf tracing

2019-10-09 Thread Alexei Starovoitov
v1->v2: - addressed feedback from Andrii and Eric. Thanks a lot for review! - added missing check at raw_tp attach time. - Andrii noticed that expected_attach_type cannot be reused. Had to introduce new field to bpf_attr. - cleaned up logging nicely by introducing bpf_log() helper. - rebased. Re

[PATCH v2 bpf-next 01/12] bpf: add typecast to raw_tracepoints to help BTF generation

2019-10-09 Thread Alexei Starovoitov
When pahole converts dwarf to btf it emits only used types. Wrap existing __bpf_trace_##template() function into btf_trace_##template typedef and use it in type cast to make gcc emits this type into dwarf. Then pahole will convert it to btf. The "btf_trace_" prefix will be used to identify BTF enab

Re: [PATCH net v2] netns: fix NLM_F_ECHO mechanism for RTM_NEWNSID

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 11:19:10 +0200, Nicolas Dichtel wrote: > The flag NLM_F_ECHO aims to reply to the user the message notified to all > listeners. > It was not the case with the command RTM_NEWNSID, let's fix this. > > Fixes: 0c7aecd4bde4 ("netns: add rtnl cmd to add and get peer netns ids") > Re

Re: [PATCH net] tun: remove possible false sharing in tun_flow_update()

2019-10-09 Thread Jason Wang
On 2019/10/10 上午12:20, Eric Dumazet wrote: As mentioned in https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-improve-performance a C compiler can legally transform if (e->queue_index != queue_index) e->queue_index = queue_index; to : e->queue_index = queue

Re: [PATCH bpf-next 05/10] bpf: implement accurate raw_tp context access via BTF

2019-10-09 Thread Alexei Starovoitov
On 10/8/19 10:10 PM, Andrii Nakryiko wrote: > for_each_member(i, t, member) { > if (moff + msize <= off) > continue; /* no overlap with member, yet, keep iterating */ > if (moff >= off + size) > break; /* won't find anything, field is already too far */ > > /* over

Re: [patch net-next 3/4] netdevsim: implement couple of testing devlink health reporters

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 13:04:44 +0200, Jiri Pirko wrote: > From: Jiri Pirko > > Implement "empty" and "dummy" reporters. The first one is really simple > and does nothing. The other one has debugfs files to trigger breakage > and it is able to do recovery. The ops also implement dummy fmsg > content

Re: [PATCH bpf-next 03/10] bpf: process in-kernel BTF

2019-10-09 Thread Alexei Starovoitov
On 10/9/19 1:51 PM, Martin Lau wrote: >> err = btf_check_all_metas(env); >> +if (err) >> +goto errout; >> + > Considering btf_vmlinux is already safe, any concern in making an extra > call to btf_check_all_types()? Only concern is additional memory resolved_* arrays will take. The

Re: [patch net-next 2/4] devlink: propagate extack down to health reporter ops

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 13:04:43 +0200, Jiri Pirko wrote: > From: Jiri Pirko > > During health reporter operations, driver might want to fill-up > the extack message, so propagate extack down to the health reporter ops. > > Signed-off-by: Jiri Pirko I wonder how useful this is for non-testing :( W

Re: [PATCH net-next 0/5] net/smc: improve termination handling

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 10:07:42 +0200, Karsten Graul wrote: > First set of patches to improve termination handling. Applied, thanks. Out of curiosity why does net/sock.h have to include net/smc.h? This SMC-specific series causes half of the kernel to rebuild 🤨

Re: [PATCH] DIM: fix dim.h kernel-doc and headers

2019-10-09 Thread Jakub Kicinski
On Tue, 8 Oct 2019 21:03:14 -0700, Randy Dunlap wrote: > From: Randy Dunlap > > Lots of fixes to kernel-doc in structs, enums, and functions. > Also add header files that are being used but not yet #included. > > Signed-off-by: Randy Dunlap > Cc: Yamin Friedman > Cc: Tal Gilboa > Cc: Saeed Ma

Re: [PATCH net 0/3] net/smc: fixes for -net

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 10:04:38 +0200, Karsten Graul wrote: > Fixes for -net, more info in commit logs. Please write a sentence or two describing the nature of the fixes. This message ends up in merge commits in the tree, pointing at the commits themselves is unhelpful. Please provide Fixes tags poi

Re: [PATCH net v1] net: taprio: Fix returning EINVAL when configuring without flags

2019-10-09 Thread Jakub Kicinski
On Tue, 8 Oct 2019 16:20:07 -0700, Vinicius Costa Gomes wrote: > When configuring a taprio instance if "flags" is not specified (or > it's zero), taprio currently replies with an "Invalid argument" error. > > So, set the return value to zero after we are done with all the > checks. > > Fixes: 9c

Re: [RFC PATCH] net: hns3: add devlink health dump support for hw mac tbl

2019-10-09 Thread Yunsheng Lin
On 2019/10/5 10:06, Yunsheng Lin wrote: > On 2019/9/30 17:27, Jiri Pirko wrote: >> Sun, Sep 29, 2019 at 02:13:43PM CEST, linyunsh...@huawei.com wrote: >>> This patch adds the devlink health dump support for hw mac tbl, >>> which helps to debug some hardware packet switching problem or >>> misconfig

Re: FW: [PATCH bpf-next 2/4] xsk: allow AF_XDP sockets to receive packets directly from a queue

2019-10-09 Thread Alexei Starovoitov
On Wed, Oct 9, 2019 at 12:12 PM Samudrala, Sridhar wrote: > >> 34.57% xdpsock xdpsock [.] main > >> 17.19% ksoftirqd/1 [kernel.vmlinux] [k] ___bpf_prog_run > >> 13.12% xdpsock [kernel.vmlinux] [k] ___bpf_prog_run > > > > That must be a bad joke. >

Re: [PATCH 2/3] ixgbe: Add UDP segmentation offload support

2019-10-09 Thread Josh Hunt
On 10/9/19 3:06 PM, Josh Hunt wrote: Repost from a series by Alexander Duyck to add UDP segmentation offload support to the igb driver: https://lore.kernel.org/netdev/20180504003916.4769.66271.stgit@localhost.localdomain/ CC: Alexander Duyck CC: Willem de Bruijn Signed-off-by: Josh Hunt ---

Re: [PATCH net 0/2] s390/qeth: fixes 2019-10-08

2019-10-09 Thread Jakub Kicinski
On Tue, 8 Oct 2019 18:21:05 +0200, Julian Wiedmann wrote: > Hi Dave, > > please apply the following two patches to your net tree. > > Alexandra fixes two issues in the initialization code for vnicc cmds. > One is an uninitialized variable when a cmd fails, the other that we > wouldn't recover co

Re: [PATCH 3/3] i40e: Add UDP segmentation offload support

2019-10-09 Thread Josh Hunt
On 10/9/19 5:39 PM, Samudrala, Sridhar wrote: On 10/9/2019 3:06 PM, Josh Hunt wrote: Based on a series from Alexander Duyck this change adds UDP segmentation offload support to the i40e driver. CC: Alexander Duyck CC: Willem de Bruijn Signed-off-by: Josh Hunt ---   drivers/net/ethernet/int

Re: [PATCH -net] phylink: fix kernel-doc warnings

2019-10-09 Thread Jakub Kicinski
On Tue, 8 Oct 2019 08:39:04 -0700, Randy Dunlap wrote: > From: Randy Dunlap > > Fix kernel-doc warnings in phylink.c: > > ../drivers/net/phy/phylink.c:595: warning: Function parameter or member > 'config' not described in 'phylink_create' > ../drivers/net/phy/phylink.c:595: warning: Excess func

Re: [PATCH 3/3] i40e: Add UDP segmentation offload support

2019-10-09 Thread Samudrala, Sridhar
On 10/9/2019 3:06 PM, Josh Hunt wrote: Based on a series from Alexander Duyck this change adds UDP segmentation offload support to the i40e driver. CC: Alexander Duyck CC: Willem de Bruijn Signed-off-by: Josh Hunt --- drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + drivers/net/ether

Re: [PATCH next] blackhole_netdev: fix syzkaller reported issue

2019-10-09 Thread महेश बंडेवार
On Wed, Oct 9, 2019 at 4:15 PM Mahesh Bandewar wrote: > > While invalidating the dst, we assign backhole_netdev instead of > loopback device. However, this device does not have idev pointer > and hence no ip6_ptr even if IPv6 is enabled. Possibly this has > triggered the syzbot reported crash. > >

Re: [PATCH net-next 0/4] sctp: add some missing events from rfc5061

2019-10-09 Thread Jakub Kicinski
On Tue, 8 Oct 2019 19:27:32 +0800, Xin Long wrote: > There are 4 events defined in rfc5061 missed in linux sctp: > SCTP_ADDR_ADDED, SCTP_ADDR_REMOVED, SCTP_ADDR_MADE_PRIM and > SCTP_SEND_FAILED_EVENT. > > This patchset is to add them up. Applied, thanks.

Re: [PATCH net] sctp: add chunks to sk_backlog when the newsk sk_socket is not set

2019-10-09 Thread Jakub Kicinski
On Tue, 8 Oct 2019 19:09:23 +0800, Xin Long wrote: > This patch is to fix a NULL-ptr deref in selinux_socket_connect_helper: > > [...] kasan: GPF could be caused by NULL-ptr deref or user memory access > [...] RIP: 0010:selinux_socket_connect_helper+0x94/0x460 > [...] Call Trace: > [...]

[PATCH v2 net-next 5/8] net: mvneta: add basic XDP support

2019-10-09 Thread Lorenzo Bianconi
Add basic XDP support to mvneta driver for devices that rely on software buffer management. Currently supported verdicts are: - XDP_DROP - XDP_PASS - XDP_REDIRECT - XDP_ABORTED Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 144 -- 1 file chan

[PATCH next] ipvlan: consolidate TSO flags using NETIF_F_ALL_TSO

2019-10-09 Thread Mahesh Bandewar
This will ensure that any new TSO related flags added (which would be part of ALL_TSO mask and IPvlan driver doesn't need to update every time new flag gets added. Signed-off-by: Mahesh Bandewar Suggested-by: Eric Dumazet --- drivers/net/ipvlan/ipvlan_main.c | 4 ++-- 1 file changed, 2 insertio

[PATCH v2 net-next 8/8] net: mvneta: add XDP_TX support

2019-10-09 Thread Lorenzo Bianconi
Implement XDP_TX verdict and ndo_xdp_xmit net_device_ops function pointer Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 126 -- 1 file changed, 119 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/n

[PATCH v2 net-next 2/8] net: mvneta: introduce page pool API for sw buffer manager

2019-10-09 Thread Lorenzo Bianconi
Use the page_pool api for allocations and DMA handling instead of __dev_alloc_page()/dma_map_page() and free_page()/dma_unmap_page(). Pages are unmapped using page_pool_release_page before packets go into the network stack. The page_pool API offers buffer recycling capabilities for XDP but allocat

[PATCH v2 net-next 1/8] net: mvneta: introduce mvneta_update_stats routine

2019-10-09 Thread Lorenzo Bianconi
Introduce mvneta_update_stats routine to collect {rx/tx} statistics (packets and bytes). This is a preliminary patch to add XDP support to mvneta driver Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 41 +-- 1 file changed, 20 insertions(+), 2

[PATCH v2 net-next 7/8] net: mvneta: make tx buffer array agnostic

2019-10-09 Thread Lorenzo Bianconi
Allow tx buffer array to contain both skb and xdp buffers in order to enable xdp frame recycling adding XDP_TX verdict support Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 66 +-- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git

[PATCH v2 net-next 3/8] net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine

2019-10-09 Thread Lorenzo Bianconi
Refactor mvneta_rx_swbm code introducing mvneta_swbm_rx_frame and mvneta_swbm_add_rx_fragment routines. Rely on build_skb in oreder to allocate skb since the previous patch introduced buffer recycling using the page_pool API. This patch fixes even an issue in the original driver where dma buffers a

[PATCH v2 net-next 6/8] net: mvneta: move header prefetch in mvneta_swbm_rx_frame

2019-10-09 Thread Lorenzo Bianconi
Move data buffer prefetch in mvneta_swbm_rx_frame after dma_sync_single_range_for_cpu Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/marvell/mvneta.c | 16 1 file changed, 8 insertions(+), 8 deleti

[PATCH v2 net-next 4/8] net: mvneta: sync dma buffers before refilling hw queues

2019-10-09 Thread Lorenzo Bianconi
mvneta driver can run on not cache coherent devices so it is necessary to sync dma buffers before sending them to the device in order to avoid memory corruption. This patch introduce a performance penalty and it is necessary to introduce a more sophisticated logic in order to avoid dma sync as much

[PATCH v2 net-next 0/8] add XDP support to mvneta driver

2019-10-09 Thread Lorenzo Bianconi
Add XDP support to mvneta driver for devices that rely on software buffer management. Supported verdicts are: - XDP_DROP - XDP_PASS - XDP_REDIRECT - XDP_TX Moreover set ndo_xdp_xmit net_device_ops function pointer in order to support redirecting from other device (e.g. virtio-net). Convert mvneta d

[PATCH next] blackhole_netdev: fix syzkaller reported issue

2019-10-09 Thread Mahesh Bandewar
While invalidating the dst, we assign backhole_netdev instead of loopback device. However, this device does not have idev pointer and hence no ip6_ptr even if IPv6 is enabled. Possibly this has triggered the syzbot reported crash. The syzbot report does not have reproducer, however, this is the on

Re: [PATCH net] bonding: fix potential NULL deref in bond_update_slave_arr

2019-10-09 Thread Jakub Kicinski
On Mon, 7 Oct 2019 15:43:01 -0700, Eric Dumazet wrote: > syzbot got a NULL dereference in bond_update_slave_arr() [1], > happening after a failure to allocate bond->slave_arr > > A workqueue (bond_slave_arr_handler) is supposed to retry > the allocation later, but if the slave is removed before >

Re: [PATCH bpf-next 0/3] Fix BTF-to-C converter's padding generation

2019-10-09 Thread Andrii Nakryiko
On Wed, Oct 9, 2019 at 3:49 PM Alexei Starovoitov wrote: > > On Tue, Oct 8, 2019 at 4:12 PM Andrii Nakryiko wrote: > > > > Fix BTF-to-C logic of handling padding at the end of a struct. Fix existing > > test that should have captured this. Also move test_btf_dump into a > > test_progs > > test t

[RFC PATCH v3 05/10] tcp, ulp: Add clone operation to tcp_ulp_ops

2019-10-09 Thread Mat Martineau
If ULP is used on a listening socket, icsk_ulp_ops and icsk_ulp_data are copied when the listener is cloned. Sometimes the clone is immediately deleted, which will invoke the release op on the clone and likely corrupt the listening socket's icsk_ulp_data. The clone operation is invoked immediately

[RFC PATCH v3 06/10] mptcp: Add MPTCP to skb extensions

2019-10-09 Thread Mat Martineau
Add enum value for MPTCP and update config dependencies Signed-off-by: Mat Martineau Signed-off-by: Matthieu Baerts --- include/linux/skbuff.h | 3 +++ include/net/mptcp.h| 27 +++ net/core/skbuff.c | 7 +++ 3 files changed, 37 insertions(+) create mode 1

[RFC PATCH v3 02/10] sock: Make sk_protocol a 16-bit value

2019-10-09 Thread Mat Martineau
Match the 16-bit width of skbuff->protocol. Fills an 8-bit hole so sizeof(struct sock) does not change. Signed-off-by: Mat Martineau --- include/net/sock.h | 4 ++-- include/trace/events/sock.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/sock.h b/i

[RFC PATCH v3 07/10] tcp: Prevent coalesce/collapse when skb has MPTCP extensions

2019-10-09 Thread Mat Martineau
The MPTCP extension data needs to be preserved as it passes through the TCP stack. Make sure that these skbs are not appended to others during coalesce or collapse, so the data remains associated with the payload of the given skb. Signed-off-by: Mat Martineau --- include/net/mptcp.h | 16 +

[RFC PATCH v3 08/10] tcp: Export TCP functions and ops struct

2019-10-09 Thread Mat Martineau
MPTCP will make use of tcp_send_mss() and tcp_push() when sending data to specific TCP subflows. tcp_request_sock_ipv4_ops will be referenced during TCP subflow creation. Signed-off-by: Mat Martineau Signed-off-by: Peter Krystad --- include/net/tcp.h | 5 + net/ipv4/tcp.c | 6 +++---

[RFC PATCH v3 09/10] tcp: Check for filled TCP option space before SACK

2019-10-09 Thread Mat Martineau
The SACK code would potentially add four bytes to the expected TCP option size even if all option space was already used. Signed-off-by: Mat Martineau --- net/ipv4/tcp_output.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 8469a109f0aa

[RFC PATCH v3 10/10] tcp: clean ext on tx recycle

2019-10-09 Thread Mat Martineau
From: Paolo Abeni Otherwise we will find stray/unexpected/old extensions value on next iteration. On tcp_write_xmit() we can end-up splitting an already queued skb in two parts, via tso_fragment(). The newly created skb can be allocated via the tx cache and the mptcp stack will not be aware of i

[RFC PATCH v3 00/10] Multipath TCP prerequisites

2019-10-09 Thread Mat Martineau
The MPTCP upstreaming community has prepared a net-next RFCv3 patch set for review. The scope of this patch set is limited to prerequisite TCP core changes so we can get focused feedback in these areas. In this patch set we introduce some MPTCP definitions, additional ULP and skb extension featu

[RFC PATCH v3 03/10] tcp: Define IPPROTO_MPTCP

2019-10-09 Thread Mat Martineau
To open a MPTCP socket with socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP), IPPROTO_MPTCP needs a value that differs from IPPROTO_TCP. The existing IPPROTO numbers mostly map directly to IANA-specified protocol numbers. MPTCP does not have a protocol number allocated because MPTCP packets use the TCP

[RFC PATCH v3 04/10] tcp: Add MPTCP option number

2019-10-09 Thread Mat Martineau
TCP option 30 is allocated for MPTCP by the IANA. Signed-off-by: Mat Martineau --- include/net/tcp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/tcp.h b/include/net/tcp.h index c9a3f9688223..382e245a7909 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -182,6 +182,7

[RFC PATCH v3 01/10] net: Make sock protocol value checks more specific

2019-10-09 Thread Mat Martineau
SK_PROTOCOL_MAX is only used in two places, for DECNet and AX.25. The limits have more to do with the those protocol definitions than they do with the data type of sk_protocol, so remove SK_PROTOCOL_MAX and use U8_MAX directly. Signed-off-by: Mat Martineau --- include/net/sock.h | 1 - net/a

Re: Applied "spi: Add a PTP system timestamp to the transfer structure" to the spi tree

2019-10-09 Thread Vladimir Oltean
On Thu, 10 Oct 2019 at 01:14, Jakub Kicinski wrote: > > On Tue, 8 Oct 2019 17:42:59 +0100, Mark Brown wrote: > > On Tue, Oct 08, 2019 at 03:58:51PM +0300, Vladimir Oltean wrote: > > > > > Dave, do you think you can somehow integrate this patch into net-next > > > as well, so that I can send some f

Re: [PATCH bpf-next 0/3] Fix BTF-to-C converter's padding generation

2019-10-09 Thread Alexei Starovoitov
On Tue, Oct 8, 2019 at 4:12 PM Andrii Nakryiko wrote: > > Fix BTF-to-C logic of handling padding at the end of a struct. Fix existing > test that should have captured this. Also move test_btf_dump into a test_progs > test to leverage common infrastructure. Applied. But I see some build weirdness.

Re: [PATCH 0/3] igb, ixgbe, i40e UDP segmentation offload support

2019-10-09 Thread Alexander Duyck
On Wed, Oct 9, 2019 at 3:08 PM Josh Hunt wrote: > > Alexander Duyck posted a series in 2018 proposing adding UDP segmentation > offload support to ixgbe and ixgbevf, but those patches were never > accepted: > > https://lore.kernel.org/netdev/20180504003556.4769.11407.stgit@localhost.localdomain/ >

[PATCH net] net: silence KCSAN warnings about sk->sk_backlog.len reads

2019-10-09 Thread Eric Dumazet
sk->sk_backlog.len can be written by BH handlers, and read from process contexts in a lockless way. Note the write side should also use WRITE_ONCE() or a variant. We need some agreement about the best way to do this. syzbot reported : BUG: KCSAN: data-race in tcp_add_backlog / tcp_grow_window.is

[PATCH net] net: annotate sk->sk_rcvlowat lockless reads

2019-10-09 Thread Eric Dumazet
sock_rcvlowat() or int_sk_rcvlowat() might be called without the socket lock for example from tcp_poll(). Use READ_ONCE() to document the fact that other cpus might change sk->sk_rcvlowat under us and avoid KCSAN splats. Use WRITE_ONCE() on write sides too. Signed-off-by: Eric Dumazet --- incl

[PATCH net] net: silence KCSAN warnings around sk_add_backlog() calls

2019-10-09 Thread Eric Dumazet
sk_add_backlog() callers usually read sk->sk_rcvbuf without owning the socket lock. This means sk_rcvbuf value can be changed by other cpus, and KCSAN complains. Add READ_ONCE() annotations to document the lockless nature of these reads. Note that writes over sk_rcvbuf should also use WRITE_ONCE(

Re: Applied "spi: Add a PTP system timestamp to the transfer structure" to the spi tree

2019-10-09 Thread Jakub Kicinski
On Tue, 8 Oct 2019 17:42:59 +0100, Mark Brown wrote: > On Tue, Oct 08, 2019 at 03:58:51PM +0300, Vladimir Oltean wrote: > > > Dave, do you think you can somehow integrate this patch into net-next > > as well, so that I can send some further patches that depend on the > > newly introduced ptp_sts m

[PATCH net] tcp: annotate lockless access to tcp_memory_pressure

2019-10-09 Thread Eric Dumazet
tcp_memory_pressure is read without holding any lock, and its value could be changed on other cpus. Use READ_ONCE() to annotate these lockless reads. The write side is already using atomic ops. Fixes: b8da51ebb1aa ("tcp: introduce tcp_under_memory_pressure()") Signed-off-by: Eric Dumazet --- i

[PATCH 0/3] igb, ixgbe, i40e UDP segmentation offload support

2019-10-09 Thread Josh Hunt
Alexander Duyck posted a series in 2018 proposing adding UDP segmentation offload support to ixgbe and ixgbevf, but those patches were never accepted: https://lore.kernel.org/netdev/20180504003556.4769.11407.stgit@localhost.localdomain/ This series is a repost of his ixgbe patch along with a simi

[PATCH 2/3] ixgbe: Add UDP segmentation offload support

2019-10-09 Thread Josh Hunt
Repost from a series by Alexander Duyck to add UDP segmentation offload support to the igb driver: https://lore.kernel.org/netdev/20180504003916.4769.66271.stgit@localhost.localdomain/ CC: Alexander Duyck CC: Willem de Bruijn Signed-off-by: Josh Hunt --- drivers/net/ethernet/intel/ixgbe/ixgbe_

[PATCH 1/3] igb: Add UDP segmentation offload support

2019-10-09 Thread Josh Hunt
Based on a series from Alexander Duyck this change adds UDP segmentation offload support to the igb driver. CC: Alexander Duyck CC: Willem de Bruijn Signed-off-by: Josh Hunt --- drivers/net/ethernet/intel/igb/e1000_82575.h | 1 + drivers/net/ethernet/intel/igb/igb_main.c| 23 +

[PATCH 3/3] i40e: Add UDP segmentation offload support

2019-10-09 Thread Josh Hunt
Based on a series from Alexander Duyck this change adds UDP segmentation offload support to the i40e driver. CC: Alexander Duyck CC: Willem de Bruijn Signed-off-by: Josh Hunt --- drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + drivers/net/ethernet/intel/i40e/i40e_txrx.c | 12 +---

Re: [PATCH net] Documentation: net: fix path to devlink-trap-netdevsim

2019-10-09 Thread Jakub Kicinski
On Wed, 9 Oct 2019 22:34:13 +0300, Ido Schimmel wrote: > On Wed, Oct 09, 2019 at 12:06:21PM -0700, Jakub Kicinski wrote: > > make htmldocs complains: > > Documentation/networking/devlink-trap.rst:175: WARNING: unknown document: > > /devlink-trap-netdevsim > > > > make the path relative. > > > >

[PATCH net] net: add {READ|WRITE}_ONCE() annotations on ->rskq_accept_head

2019-10-09 Thread Eric Dumazet
reqsk_queue_empty() is called from inet_csk_listen_poll() while other cpus might write ->rskq_accept_head value. Use {READ|WRITE}_ONCE() to avoid compiler tricks and potential KCSAN splats. Fixes: fff1f3001cc5 ("tcp: add a spinlock to protect struct request_sock_queue") Signed-off-by: Eric Dumaze

Re: [PATCH net] netfilter: conntrack: avoid possible false sharing

2019-10-09 Thread Pablo Neira Ayuso
On Wed, Oct 09, 2019 at 09:19:13AM -0700, Eric Dumazet wrote: > As hinted by KCSAN, we need at least one READ_ONCE() > to prevent a compiler optimization. > > More details on : > https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-improve-performance > > sysbot report : > BUG: KC

[PATCH net-next 1/1] tc-testing: updated pedit test cases

2019-10-09 Thread Roman Mashak
Added test case for layered IP operation for a single source IP4/IP6 address and a single destination IP4/IP6 address. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/pedit.json | 101 - 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/to

Re: [PATCH bpf-next 03/10] bpf: process in-kernel BTF

2019-10-09 Thread Martin Lau
On Fri, Oct 04, 2019 at 10:03:07PM -0700, Alexei Starovoitov wrote: > If in-kernel BTF exists parse it and prepare 'struct btf *btf_vmlinux' > for further use by the verifier. > In-kernel BTF is trusted just like kallsyms and other build artifacts > embedded into vmlinux. > Yet run this BTF image t

Re: [PATCH v13 2/4] bpf: added new helper bpf_get_ns_current_pid_tgid

2019-10-09 Thread Carlos Antonio Neira Bustos
On Wed, Oct 09, 2019 at 12:50:10PM -0700, Andrii Nakryiko wrote: > On Wed, Oct 9, 2019 at 10:45 AM Carlos Antonio Neira Bustos > wrote: > > > > On Wed, Oct 09, 2019 at 09:14:42AM -0700, Andrii Nakryiko wrote: > > > On Wed, Oct 9, 2019 at 8:27 AM Carlos Neira > > > wrote: > > > > > > > > New bpf

[PATCH v2 bpf-next 2/2] selftests/bpf: add read-only map values propagation tests

2019-10-09 Thread Andrii Nakryiko
Add tests checking that verifier does proper constant propagation for read-only maps. If constant propagation didn't work, skipp_loop and part_loop BPF programs would be rejected due to BPF verifier otherwise not being able to prove they ever complete. With constant propagation, though, they are su

[PATCH v2 bpf-next 0/2] Track read-only map contents as known scalars in BPF verifiers

2019-10-09 Thread Andrii Nakryiko
With BPF maps supporting direct map access (currently, array_map w/ single element, used for global data) that are read-only both from system call and BPF side, it's possible for BPF verifier to track its contents as known constants. Now it's possible for user-space control app to pre-initialize r

[PATCH v2 bpf-next 1/2] bpf: track contents of read-only maps as scalars

2019-10-09 Thread Andrii Nakryiko
Maps that are read-only both from BPF program side and user space side have their contents constant, so verifier can track referenced values precisely and use that knowledge for dead code elimination, branch pruning, etc. This patch teaches BPF verifier how to do this. Signed-off-by: Andrii Nakryi

Re: [PATCH bpf-next 08/10] bpf: check types of arguments passed into helpers

2019-10-09 Thread Alexei Starovoitov
On 10/9/19 11:01 AM, Andrii Nakryiko wrote: > On Fri, Oct 4, 2019 at 10:04 PM Alexei Starovoitov wrote: >> >> Introduce new helper that reuses existing skb perf_event output >> implementation, but can be called from raw_tracepoint programs >> that receive 'struct sk_buff *' as tracepoint argument

[PATCH net] net: avoid possible false sharing in sk_leave_memory_pressure()

2019-10-09 Thread Eric Dumazet
As mentioned in https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONCE#it-may-improve-performance a C compiler can legally transform : if (memory_pressure && *memory_pressure) *memory_pressure = 0; to : if (memory_pressure) *memory_pressure = 0; Fixes: 0604475119de ("tcp

Re: [PATCH v13 2/4] bpf: added new helper bpf_get_ns_current_pid_tgid

2019-10-09 Thread Andrii Nakryiko
On Wed, Oct 9, 2019 at 10:45 AM Carlos Antonio Neira Bustos wrote: > > On Wed, Oct 09, 2019 at 09:14:42AM -0700, Andrii Nakryiko wrote: > > On Wed, Oct 9, 2019 at 8:27 AM Carlos Neira wrote: > > > > > > New bpf helper bpf_get_ns_current_pid_tgid, > > > This helper will return pid and tgid from cu

Re: [PATCH bpf-next 09/10] bpf: disallow bpf_probe_read[_str] helpers

2019-10-09 Thread Alexei Starovoitov
On 10/8/19 10:29 PM, Andrii Nakryiko wrote: > On Fri, Oct 4, 2019 at 10:04 PM Alexei Starovoitov wrote: >> >> Disallow bpf_probe_read() and bpf_probe_read_str() helpers in >> raw_tracepoint bpf programs that use in-kernel BTF to track >> types of memory accesses. >> >> Signed-off-by: Alexei Starov

Re: [PATCH net] Documentation: net: fix path to devlink-trap-netdevsim

2019-10-09 Thread Ido Schimmel
On Wed, Oct 09, 2019 at 12:06:21PM -0700, Jakub Kicinski wrote: > make htmldocs complains: > Documentation/networking/devlink-trap.rst:175: WARNING: unknown document: > /devlink-trap-netdevsim > > make the path relative. > > Fixes: 9e0874570488 ("Documentation: Add description of netdevsim traps

  1   2   >