Re: [PATCH v4 3/8] MIPS: Octeon: Add a global resource manager.

2017-11-30 Thread Philippe Ombredanne
Carlos, On Thu, Nov 30, 2017 at 11:53 PM, James Hogan wrote: > On Tue, Nov 28, 2017 at 04:55:35PM -0800, David Daney wrote: >> From: Carlos Munoz >> >> Add a global resource manager to manage tagged pointers within >> bootmem allocated memory. This is

[PATCH 1/1] timecounter: Make cyclecounter struct part of timecounter struct

2017-11-30 Thread Sagar Arun Kamble
There is no real need for the users of timecounters to define cyclecounter and timecounter variables separately. Since timecounter will always be based on cyclecounter, have cyclecounter struct as member of timecounter struct. Suggested-by: Chris Wilson Signed-off-by:

Re: Creating cyclecounter and lock member in timecounter structure [ Was Re: [RFC 1/4] drm/i915/perf: Add support to correlate GPU timestamp with system time]

2017-11-30 Thread Sagar Arun Kamble
On 12/1/2017 2:33 AM, Saeed Mahameed wrote: On Mon, Nov 27, 2017 at 2:05 AM, Sagar Arun Kamble wrote: On 11/24/2017 7:01 PM, Thomas Gleixner wrote: On Fri, 24 Nov 2017, Sagar Arun Kamble wrote: On 11/24/2017 12:29 AM, Thomas Gleixner wrote: On Thu, 23 Nov 2017,

Re: KASAN: stack-out-of-bounds Read in xfrm_state_find (3)

2017-11-30 Thread Steffen Klassert
On Wed, Nov 22, 2017 at 08:05:00AM -0800, syzbot wrote: > syzkaller has found reproducer for the following crash on > 0c86a6bd85ff0629cd2c5141027fc1c8bb6cde9c > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw

With All Due Respect!!!

2017-11-30 Thread Mrs.Louisa Benicio
My Sincere Greetings, I am (MRS.LOUISA BENICIO); I have decided to donate what I have to you / Motherless babies/ Less privileged/ Churches/ Widows' because I am dying and diagnosed for cancer for two years now. I have been touched by Almighty God to donate from what I have inherited from my late

Re: [RFC PATCH] net_sched: bulk free tcf_block

2017-11-30 Thread Cong Wang
On Wed, Nov 29, 2017 at 6:25 AM, Paolo Abeni wrote: > Currently deleting qdisc with a large number of children and filters > can take a lot of time: > > tc qdisc add dev lo root htb > for I in `seq 1 1000`; do > tc class add dev lo parent 1: classid 1:$I htb rate

Re: [PATCH 1/3] vhost: fix skb leak in handle_rx()

2017-11-30 Thread Jason Wang
On 2017年12月01日 13:54, w...@redhat.com wrote: From: Wei Xu Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread:

Re: [PATCH 3/3] tap: free skb if flags error

2017-11-30 Thread Jason Wang
On 2017年12月01日 13:54, w...@redhat.com wrote: From: Wei Xu tap_recvmsg() supports accepting skb by msg_control after commit 3b4ba04acca8 ("tap: support receiving skb from msg_control"), the skb if presented should be freed within the function, otherwise it would be leaked.

Re: [PATCH net v2 2/3] xfrm: Add an activate() offload dev op

2017-11-30 Thread Steffen Klassert
On Tue, Nov 28, 2017 at 07:55:41PM +0200, av...@mellanox.com wrote: > From: Aviv Heller > > Adding the state to the offload device prior to replay init in > xfrm_state_construct() will result in NULL dereference if a matching > ESP packet is received in between. > > In order

Re: [PATCH 2/3] tun: free skb in early errors

2017-11-30 Thread Jason Wang
On 2017年12月01日 13:54, w...@redhat.com wrote: From: Wei Xu tun_recvmsg() supports accepting skb by msg_control after commit ac77cfd4258f ("tun: support receiving skb through msg_control"), the skb if presented should be freed within the function, otherwise it would be leaked.

Re: [PATCH net v2 3/3] xfrm: Remove redundant state assignment in xfrm_input()

2017-11-30 Thread Steffen Klassert
On Tue, Nov 28, 2017 at 07:55:42PM +0200, av...@mellanox.com wrote: > From: Aviv Heller > > x is already initialized to the same value, above. > > Signed-off-by: Aviv Heller > Signed-off-by: Yevgeny Kliteynik Applied to

Re: [PATCH net v2 1/3] xfrm: Fix xfrm_input() to verify state is valid when (encap_type < 0)

2017-11-30 Thread Steffen Klassert
On Tue, Nov 28, 2017 at 07:55:40PM +0200, av...@mellanox.com wrote: > From: Aviv Heller > > Code path when (encap_type < 0) does not verify the state is valid > before progressing. > > This will result in a crash if, for instance, x->km.state == > XFRM_STATE_ACQ. > > Fixes:

Re: [PATCH net-next 3/3] xfrm: Add ESN support for IPSec HW offload

2017-11-30 Thread Steffen Klassert
On Tue, Nov 28, 2017 at 11:49:30AM +0200, yoss...@mellanox.com wrote: > From: Yossef Efraim > > This patch adds ESN support to IPsec device offload. > Adding new xfrm device operation to synchronize device ESN. > > Signed-off-by: Yossef Efraim > ---

Re: [PATCH net-next 2/3] xfrm: Fix xfrm_dev_state_add to fail for unsupported HW SA option

2017-11-30 Thread Steffen Klassert
On Tue, Nov 28, 2017 at 11:49:29AM +0200, yoss...@mellanox.com wrote: > From: Yossef Efraim > > xfrm_dev_state_add function returns success for unsupported HW SA options. > Resulting the calling function to create SW SA without corrlating HW SA. > Desipte IPSec device

Re: [PATCH net-next 1/3] xfrm: Fix xfrm_replay_overflow_offload_esn

2017-11-30 Thread Steffen Klassert
On Tue, Nov 28, 2017 at 11:49:28AM +0200, yoss...@mellanox.com wrote: > From: Yossef Efraim > > In case of wrap around, replay_esn->oseq_hi is not updated > before it is tested for it's actual value, leading function > to fail with overflow indication and packets being

Re: [PATCH V11 0/5] hash addresses printed with %p

2017-11-30 Thread Sergey Senozhatsky
On (11/30/17 19:26), Sergey Senozhatsky wrote: > On (11/30/17 10:23), David Laight wrote: > [..] > > > Maybe I'm being thick, but... if we're rendering these addresses > > > unusable by hashing them, why not just print something like > > > "" in their place? That loses the uniqueness thing but I

Re: [PATCH ipsec] xfrm: fix XFRMA_OUTPUT_MARK policy entry

2017-11-30 Thread Steffen Klassert
On Wed, Nov 29, 2017 at 06:23:56PM +0100, Michal Kubecek wrote: > This seems to be an obvious typo, NLA_U32 is type of the attribute, not its > (minimal) length. > > Fixes: 077fbac405bf ("net: xfrm: support setting an output mark.") > Signed-off-by: Michal Kubecek Patch

[PATCH 3/3] tap: free skb if flags error

2017-11-30 Thread wexu
From: Wei Xu tap_recvmsg() supports accepting skb by msg_control after commit 3b4ba04acca8 ("tap: support receiving skb from msg_control"), the skb if presented should be freed within the function, otherwise it would be leaked. Signed-off-by: Wei Xu

[PATCH 1/3] vhost: fix skb leak in handle_rx()

2017-11-30 Thread wexu
From: Wei Xu Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html Eventually we figured out that it was a

[PATCH net,stable v3] vhost: fix a few skb leaks

2017-11-30 Thread wexu
From: Wei Xu Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev@vger.kernel.org/msg187936.html This is v3. v3: - move freeing skb from

[PATCH 2/3] tun: free skb in early errors

2017-11-30 Thread wexu
From: Wei Xu tun_recvmsg() supports accepting skb by msg_control after commit ac77cfd4258f ("tun: support receiving skb through msg_control"), the skb if presented should be freed within the function, otherwise it would be leaked. Signed-off-by: Wei Xu

Re: [PATCH ipsec] xfrm: add documentation for xfrm device offload api

2017-11-30 Thread Steffen Klassert
On Mon, Nov 20, 2017 at 02:26:07PM -0800, Shannon Nelson wrote: > Add a writeup on how to use the XFRM device offload API, and > mention this new file in the index. > > Signed-off-by: Shannon Nelson Applied to ipsec-next, thanks a lot for this documentation!

Re: [PATCH ipsec-next] net: xfrm: allow clearing socket xfrm policies.

2017-11-30 Thread Steffen Klassert
On Mon, Nov 20, 2017 at 07:26:02PM +0900, Lorenzo Colitti wrote: > Currently it is possible to add or update socket policies, but > not clear them. Therefore, once a socket policy has been applied, > the socket cannot be used for unencrypted traffic. > > This patch allows (privileged) users to

[PATCH net-next 08/13] nfp: bpf: correct the encoding for No-Dest immed

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang When immed is used with No-Dest, the emitter should use reg.dst instead of reg.areg for the destination, using the latter will actually encode register zero. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski

[PATCH net-next 11/13] nfp: bpf: implement memory bulk copy for length within 32-bytes

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang For NFP, we want to re-group a sequence of load/store pairs lowered from memcpy/memmove into single memory bulk operation which then could be accelerated using NFP CPP bus. This patch extends the existing load/store auxiliary information by adding two

[PATCH net-next 06/13] nfp: bpf: don't do ld/shifts combination if shifts are jump destination

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang If any of the shift insns in the ld/shift sequence is jump destination, don't do combination. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski ---

[PATCH net-next 12/13] nfp: bpf: implement memory bulk copy for length bigger than 32-bytes

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang When the gathered copy length is bigger than 32-bytes and within 128-bytes (the maximum length a single CPP Pull/Push request can finish), the strategy of read/write are changeed into: * Read. - use direct reference mode when length is within

[PATCH net-next 09/13] nfp: bpf: encode indirect commands

2017-11-30 Thread Jakub Kicinski
Add support for emitting commands with field overwrites. Signed-off-by: Jakub Kicinski Signed-off-by: Jiong Wang --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 17 + drivers/net/ethernet/netronome/nfp/nfp_asm.h | 3

[PATCH net-next 03/13] nfp: bpf: record jump destination to simplify jump fixup

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang eBPF insns are internally organized as dual-list inside NFP offload JIT. Random access to an insn needs to be done by either forward or backward traversal along the list. One place we need to do such traversal is at nfp_fixup_branches where one

[PATCH net-next 07/13] nfp: bpf: relax source operands check

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang The NFP normally requires the source operands to be difference addressing modes, but we should rule out the very special NN_REG_NONE type. There are instruction that ignores both A/B operands, for example: local_csr_rd For these instructions, we

[PATCH net-next 04/13] nfp: bpf: flag jump destination to guide insn combine optimizations

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang NFP eBPF offload JIT engine is doing some instruction combine based optimizations which however must not be safe if the combined sequences are across basic block boarders. Currently, there are post checks during fixing jump destinations. If the jump

[PATCH net-next 01/13] nfp: fix old kdoc issues

2017-11-30 Thread Jakub Kicinski
Since commit 3a025e1d1c2e ("Add optional check for bad kernel-doc comments") when built with W=1 build will complain about kdoc errors. Fix the kdoc issues we have. kdoc is still confused by defines in nfp_net_ctrl.h but those are not really errors. Signed-off-by: Jakub Kicinski

[PATCH net-next 10/13] nfp: bpf: factor out is_mbpf_load & is_mbpf_store

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang It is usual that we need to check if one BPF insn is for loading/storeing data from/to memory. Therefore, it makes sense to factor out related code to become common helper functions. Signed-off-by: Jiong Wang Reviewed-by:

[PATCH net-next 05/13] nfp: bpf: don't do ld/mask combination if mask is jump destination

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang If the mask insn in the ld/mask pair is jump destination, then don't do combination. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 3

[PATCH net-next 13/13] nfp: bpf: detect load/store sequences lowered from memory copy

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang This patch add the optimization frontend, but adding a new eBPF IR scan pass "nfp_bpf_opt_ldst_gather". The pass will traverse the IR to recognize the load/store pairs sequences that come from lowering of memory copy builtins. The gathered memory copy

[PATCH net-next 00/13] nfp: bpf: jump resolution and memcpy update

2017-11-30 Thread Jakub Kicinski
Hi! Jiong says: Currently, compiler will lower memcpy function call in XDP/eBPF C program into a sequence of eBPF load/store pairs for some scenarios. Compiler is thinking this "inline" optimiation is beneficial as it could avoid function call and also increase code locality. However,

[PATCH net-next 02/13] nfp: bpf: support backward jump

2017-11-30 Thread Jakub Kicinski
From: Jiong Wang This patch adds support for backward jump on NFP. - restrictions on backward jump in various functions have been removed. - nfp_fixup_branches now supports backward jump. There is one thing to note, currently an input eBPF JMP insn may generate

[PATCH net-next 3/7] bpf: don't mark FP reg as uninit

2017-11-30 Thread Alexei Starovoitov
when verifier hits an internal bug don't mark register R10==FP as uninit, since it's read only register and it's not technically correct to let verifier run further, since it may assume that R10 has valid auxiliary state. While developing subsequent patches this issue was discovered, though the

[PATCH net-next 6/7] bpf: cleanup register_is_null()

2017-11-30 Thread Alexei Starovoitov
don't pass large struct bpf_reg_state by value. Instead pass it by pointer. Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Daniel Borkmann --- kernel/bpf/verifier.c | 20 ++-- 1 file

[PATCH net-next 0/7] bpf: verifier improvements and cleanups

2017-11-30 Thread Alexei Starovoitov
Small set of verifier improvements and cleanups which is necessary for bigger patch set of bpf-to-bpf calls coming later. See individual patches for details. Tested on x86 and arm64 hw. Alexei Starovoitov (7): bpf: fix stack state printing in verifier log bpf: print liveness info to verifier

[PATCH net-next 4/7] bpf: improve verifier liveness marks

2017-11-30 Thread Alexei Starovoitov
registers with pointers filled from stack were missing live_written marks which caused liveness propagation to unnecessary mark more registers as live_read and miss state pruning opportunities later on. before after bpf_lb-DLB_L3.o 2285 2270 bpf_lb-DLB_L4.o

[PATCH net-next 1/7] bpf: fix stack state printing in verifier log

2017-11-30 Thread Alexei Starovoitov
fix incorrect stack state prints in print_verifier_state() Fixes: 638f5b90d460 ("bpf: reduce verifier memory consumption") Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Daniel Borkmann ---

[PATCH net-next 5/7] bpf: improve JEQ/JNE path walking

2017-11-30 Thread Alexei Starovoitov
verifier knows how to trim paths that are known not to be taken at run-time when register containing run-time constant is compared with another constant. It was done only for JEQ comparison. Extend it to include JNE as well. More cases can be added in the future. before

[PATCH net-next 7/7] selftests/bpf: adjust test_align expected output

2017-11-30 Thread Alexei Starovoitov
since verifier started to print liveness state of the registers adjust expected output of test_align. Now this test checks for both proper alignment handling by verifier and correctness of liveness marks. Signed-off-by: Alexei Starovoitov Acked-by: Daniel Borkmann

[PATCH net-next 2/7] bpf: print liveness info to verifier log

2017-11-30 Thread Alexei Starovoitov
let verifier print register and stack liveness information into verifier log Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Daniel Borkmann --- kernel/bpf/verifier.c | 24 1 file

Re: [RFC] virtio-net: help live migrate SR-IOV devices

2017-11-30 Thread Michael S. Tsirkin
On Thu, Nov 30, 2017 at 12:48:22PM -0800, Jakub Kicinski wrote: > On Thu, 30 Nov 2017 15:54:40 +0200, Michael S. Tsirkin wrote: > > On Wed, Nov 29, 2017 at 07:51:38PM -0800, Jakub Kicinski wrote: > > > On Thu, 30 Nov 2017 11:29:56 +0800, Jason Wang wrote: > > > > On 2017年11月29日 03:27, Jesse

Re: netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'

2017-11-30 Thread Al Viro
On Fri, Dec 01, 2017 at 03:48:59AM +, Al Viro wrote: > Something similar to get_prog_path_type() above might make for a usable > primitive, IMO... Incidentally, bpf_obj_get_user()/bpf_obj_do_get() should just use user_path(), rather than wanking with

Re: [PATCH] netfilter: add overflow checks in xt_bpf.c

2017-11-30 Thread Willem de Bruijn
On Thu, Nov 30, 2017 at 11:08 PM, Jann Horn wrote: > On Fri, Dec 1, 2017 at 5:04 AM, Willem de Bruijn > wrote: >> On Thu, Nov 30, 2017 at 7:46 PM, Jann Horn wrote: >>> Check whether inputs from userspace are too long (explicit

Re: [PATCH] netfilter: add overflow checks in xt_bpf.c

2017-11-30 Thread Jann Horn
On Fri, Dec 1, 2017 at 5:04 AM, Willem de Bruijn wrote: > On Thu, Nov 30, 2017 at 7:46 PM, Jann Horn wrote: >> Check whether inputs from userspace are too long (explicit length field too >> big or string not null-terminated) to avoid

Re: [PATCH] netfilter: add overflow checks in xt_bpf.c

2017-11-30 Thread Willem de Bruijn
On Thu, Nov 30, 2017 at 7:46 PM, Jann Horn wrote: > Check whether inputs from userspace are too long (explicit length field too > big or string not null-terminated) to avoid out-of-bounds reads. > > As far as I can tell, this can at worst lead to very limited kernel heap >

Re: [PATCH net-next 2/5] rhashtable: Add rhastable_walk_peek

2017-11-30 Thread Tom Herbert
On Thu, Nov 30, 2017 at 5:21 PM, Herbert Xu wrote: > On Thu, Nov 30, 2017 at 05:15:16PM -0800, Tom Herbert wrote: >> >> We don't need a guarantee of stability, but what I am seeing is that >> we're consisitently dropping entries on when doing a multi-part >> netlink

Re: netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'

2017-11-30 Thread Al Viro
On Fri, Dec 01, 2017 at 01:33:04AM +, Al Viro wrote: > Use of file descriptors should be limited to "got a number from userland, > convert to struct file *" on the way in and "install struct file * into > descriptor table and return the descriptor to userland" on the way out. > And the latter

[PATCH net-next] net: hns3: Refactors "reset" handling code in HCLGE layer of HNS3 driver

2017-11-30 Thread Salil Mehta
This patch refactors the code of the reset feature in HCLGE layer of HNS3 PF driver. Prime motivation to do this change is: 1. To reduce the time for which common miscellaneous Vector 0 interrupt is disabled because of the reset. 2. Simplification of reset request submission and pending reset

Re: [PATCH net 1/2] bpf: set maximum number of attached progs to 64 for a single perf tp

2017-11-30 Thread Yonghong Song
On 11/30/17 6:07 PM, Daniel Borkmann wrote: On 11/30/2017 10:47 PM, Yonghong Song wrote: cgropu+bpf prog array has a maximum number of 64 programs. Let us apply the same limit here. Signed-off-by: Yonghong Song Both applied to bpf tree, thanks! Please add a proper Fixes tags

Re: [PATCH net-next 3/5] bpftool: implement cgattach command

2017-11-30 Thread Jakub Kicinski
On Thu, 30 Nov 2017 13:43:00 +, Roman Gushchin wrote: > + attach_type = parse_attach_type(argv[2]); > + if (attach_type == __MAX_BPF_ATTACH_TYPE) { > + bpf_object__close(obj); > + close(prog_fd); > + close(cgroup_fd); > + p_err("Invalid

Re: [PATCH net-next 0/5] bpftool: cgroup bpf operations

2017-11-30 Thread Jakub Kicinski
Hi Roman! On Thu, 30 Nov 2017 13:42:57 +, Roman Gushchin wrote: > This patchset adds basic cgroup bpf operations to bpftool. > > Right now there is no convenient way to perform these operations. > The /samples/bpf/load_sock_ops.c implements attach/detacg operations, > but only for

Re: [PATCH net 1/2] bpf: set maximum number of attached progs to 64 for a single perf tp

2017-11-30 Thread Daniel Borkmann
On 11/30/2017 10:47 PM, Yonghong Song wrote: > cgropu+bpf prog array has a maximum number of 64 programs. > Let us apply the same limit here. > > Signed-off-by: Yonghong Song Both applied to bpf tree, thanks! Please add a proper Fixes tags in the future; took care of it this time.

Re: [RFC] bpf: offload: report device information for offloaded programs

2017-11-30 Thread Jakub Kicinski
Hi Kirill, On Thu, 30 Nov 2017 16:19:13 +0300, Kirill Tkhai wrote: > > @@ -164,6 +166,38 @@ int bpf_prog_offload_compile(struct bpf_prog *prog) > > return bpf_prog_offload_translate(prog); > > } > > > > +int bpf_prog_offload_info_fill(struct bpf_prog_info *info, > > +

[PATCH net] ipvlan: Add the skb->mark as flow4's member to lookup route

2017-11-30 Thread gfree . wind
From: Gao Feng Current codes don't use skb->mark to assign flowi4_mark, it would make the policy route rule with fwmark doesn't work as expected. Signed-off-by: Gao Feng --- drivers/net/ipvlan/ipvlan_core.c | 1 + 1 file changed, 1 insertion(+)

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread James Morris
On Thu, 30 Nov 2017, Eric Dumazet wrote: > On Wed, 2017-11-29 at 19:16 -0800, Casey Schaufler wrote: > > On 11/29/2017 4:31 PM, James Morris wrote: > > > On Wed, 29 Nov 2017, Casey Schaufler wrote: > > > > > > > I see that there is a proposed fix later in the thread, but I > > > > don't see > >

Re: [PATCH v4 3/8] MIPS: Octeon: Add a global resource manager.

2017-11-30 Thread David Daney
On 11/30/2017 02:53 PM, James Hogan wrote: On Tue, Nov 28, 2017 at 04:55:35PM -0800, David Daney wrote: From: Carlos Munoz Add a global resource manager to manage tagged pointers within bootmem allocated memory. This is used by various functional blocks in the Octeon core

[PATCH net-next v2 6/8] selftests/bpf: add offload test based on netdevsim

2017-11-30 Thread Jakub Kicinski
Add a test of BPF offload control path interfaces based on just-added netdevsim driver. Perform various checks of both the stack and the expected driver behaviour. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Reviewed-by:

[PATCH net-next v2 2/8] net: xdp: report flags program was installed with on query

2017-11-30 Thread Jakub Kicinski
Some drivers enforce that flags on program replacement and removal must match the flags passed on install. This leaves the possibility open to enable simultaneous loading of XDP programs both to HW and DRV. Allow such drivers to report the flags back to the stack. Signed-off-by: Jakub Kicinski

[PATCH net-next v2 0/8] xdp: make stack perform remove and tests

2017-11-30 Thread Jakub Kicinski
Hi! The purpose of this series is to add a software model of BPF offloads to make it easier for everyone to test them and make some of the more arcane rules and assumptions more clear. The series starts with 3 patches aiming to make XDP handling in the drivers less error prone. Currently driver

[PATCH net-next v2 8/8] net: dummy: remove fake SR-IOV functionality

2017-11-30 Thread Jakub Kicinski
netdevsim driver seems like a better place for fake SR-IOV functionality. Remove the code previously added to dummy. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet --- CC: Phil Sutter CC: Sabrina Dubroca

[PATCH net-next v2 7/8] netdevsim: add SR-IOV functionality

2017-11-30 Thread Jakub Kicinski
dummy driver was extended with VF-related netdev APIs for testing SR-IOV-related software. netdevsim did not exist back then. Implement SR-IOV functionality in netdevsim. Notable difference is that since netdevsim has no module parameters, we will actually create a device with sriov_numvfs

[PATCH net-next v2 1/8] net: xdp: avoid output parameters when querying XDP prog

2017-11-30 Thread Jakub Kicinski
The output parameters will get unwieldy if we want to add more information about the program. Simply pass the entire struct netdev_bpf in. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Reviewed-by: Quentin Monnet

[PATCH net-next v2 3/8] net: xdp: make the stack take care of the tear down

2017-11-30 Thread Jakub Kicinski
Since day one of XDP drivers had to remember to free the program on the remove path. This leads to code duplication and is error prone. Make the stack query the installed programs on unregister and if something is installed, remove the program. Freeing of program attached to XDP generic is

[PATCH net-next v2 4/8] netdevsim: add software driver for testing offloads

2017-11-30 Thread Jakub Kicinski
To be able to run selftests without any hardware required we need a software model. The model can also serve as an example implementation for those implementing actual HW offloads. The dummy driver have previously been extended to test SR-IOV, but the general consensus seems to be against adding

[PATCH net-next v2 5/8] netdevsim: add bpf offload support

2017-11-30 Thread Jakub Kicinski
Add support for loading programs for netdevsim devices and expose the related information via DebugFS. Both offload of XDP and cls_bpf programs is supported. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Reviewed-by: Quentin

Re: netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'

2017-11-30 Thread Al Viro
On Thu, Nov 30, 2017 at 04:57:30PM -0800, Kees Cook wrote: > On Mon, Oct 9, 2017 at 4:10 PM, David Miller wrote: > > Shmulik Ladkani (1): > > netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1' > > This adds a new user of set_fs(), which we're trying

Re: [PATCH net-next 2/5] rhashtable: Add rhastable_walk_peek

2017-11-30 Thread Herbert Xu
On Thu, Nov 30, 2017 at 05:15:16PM -0800, Tom Herbert wrote: > > We don't need a guarantee of stability, but what I am seeing is that > we're consisitently dropping entries on when doing a multi-part > netlink walk. We start iterating over the table filling in the netlink > info. But eventually

Re: [PATCH net-next 2/5] rhashtable: Add rhastable_walk_peek

2017-11-30 Thread Tom Herbert
On Thu, Nov 30, 2017 at 4:38 PM, Herbert Xu wrote: > On Thu, Nov 30, 2017 at 04:03:02PM -0800, Tom Herbert wrote: >> This function is like rhashtable_walk_next except that it only returns >> the current element in the inter and does not advance the iter. >> >> This

[PATCH net-next v4 2/2] net: ethernet: socionext: add AVE ethernet driver

2017-11-30 Thread Kunihiko Hayashi
The UniPhier platform from Socionext provides the AVE ethernet controller that includes MAC and MDIO bus supporting RGMII/RMII modes. The controller is named AVE. Signed-off-by: Kunihiko Hayashi Signed-off-by: Jassi Brar ---

[PATCH net-next v4 1/2] dt-bindings: net: add DT bindings for Socionext UniPhier AVE

2017-11-30 Thread Kunihiko Hayashi
DT bindings for the AVE ethernet controller found on Socionext's UniPhier platforms. Signed-off-by: Kunihiko Hayashi Signed-off-by: Jassi Brar Acked-by: Rob Herring --- .../bindings/net/socionext,uniphier-ave4.txt

[PATCH net-next v4 0/2] add UniPhier AVE ethernet support

2017-11-30 Thread Kunihiko Hayashi
This series adds support for Socionext AVE ethernet controller implemented on UniPhier SoCs. This driver supports RGMII/RMII modes. v3: http://www.spinics.net/lists/netdev/msg462550.html The PHY patch included in v1 has already separated in: http://www.spinics.net/lists/netdev/msg454595.html

Re: [Patch net-next] act_mirred: get rid of mirred_list_lock spinlock

2017-11-30 Thread Cong Wang
On Thu, Nov 30, 2017 at 3:12 PM, Eric Dumazet wrote: > On Thu, 2017-11-30 at 14:53 -0800, Cong Wang wrote: >> @@ -55,13 +54,10 @@ static void tcf_mirred_release(struct tc_action >> *a, int bind) >> struct tcf_mirred *m = to_mirred(a); >> struct net_device *dev;

Re: netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'

2017-11-30 Thread Kees Cook
On Mon, Oct 9, 2017 at 4:10 PM, David Miller wrote: > Shmulik Ladkani (1): > netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1' This adds a new user of set_fs(), which we're trying to eliminate (or at least not expand): + set_fs(KERNEL_DS); +

[PATCH] netfilter: add overflow checks in xt_bpf.c

2017-11-30 Thread Jann Horn
Check whether inputs from userspace are too long (explicit length field too big or string not null-terminated) to avoid out-of-bounds reads. As far as I can tell, this can at worst lead to very limited kernel heap memory disclosure or oopses. This bug can be triggered by an unprivileged user

Re: [PATCH net-next 2/5] rhashtable: Add rhastable_walk_peek

2017-11-30 Thread Herbert Xu
On Thu, Nov 30, 2017 at 04:03:02PM -0800, Tom Herbert wrote: > This function is like rhashtable_walk_next except that it only returns > the current element in the inter and does not advance the iter. > > This patch also creates __rhashtable_walk_find_next. It finds the next > element in the table

[PATCH net-next 00/11] net: ethernet: ti: cpsw/ale clean up and optimization

2017-11-30 Thread Grygorii Strashko
This is set of non critical clean ups and optimizations for TI CPSW and ALE drivers. Rebased on top on net-next. Grygorii Strashko (11): net: ethernet: ti: cpsw: drop unused var poll from cpsw_update_channels_res net: ethernet: ti: cpsw: use proper io apis net: ethernet: ti: cpsw: move

[PATCH net-next 04/11] net: ethernet: ti: cpsw: move mac_hi/lo defines in cpsw.h

2017-11-30 Thread Grygorii Strashko
Move mac_hi/lo defines in common header cpsw.h and re-use them for netcp_ethss.c. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw.c| 4 drivers/net/ethernet/ti/cpsw.h| 4 drivers/net/ethernet/ti/netcp_ethss.c | 5 + 3

[PATCH net-next 03/11] net: ethernet: ti: cpsw: move platform data struct to .c file

2017-11-30 Thread Grygorii Strashko
CPSW platform data struct cpsw_platform_data and struct cpsw_slave_data are used only incide cpsw.c module, so move these definitions there. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw.c | 21 + drivers/net/ethernet/ti/cpsw.h |

[PATCH net-next 02/11] net: ethernet: ti: cpsw: use proper io apis

2017-11-30 Thread Grygorii Strashko
Switch to use writel_relaxed/readl_relaxed() IO API instead of raw version as it is recommended. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git

[PATCH net-next 06/11] net: ethernet: ti: ale: use proper io apis

2017-11-30 Thread Grygorii Strashko
Switch to use writel_relaxed/readl_relaxed() IO API instead of raw version as it is recommended. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw_ale.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git

[PATCH net-next 05/11] net: ethernet: ti: cpsw: fix ale port numbers

2017-11-30 Thread Grygorii Strashko
TI OMAP/Sitara SoCs have fixed number of ALE ports 3, which includes Host port also. Hence, use fixed value instead of value calcualted from DT, which can be set by user and might not reflect actual HW configuration. Signed-off-by: Grygorii Strashko ---

[PATCH net-next 10/11] net: ethernet: ti: ale: use devm_kzalloc in cpsw_ale_create()

2017-11-30 Thread Grygorii Strashko
Use cpsw_ale_create in cpsw_ale_create(). This also makes cpsw_ale_destroy() function nop, so remove it. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw.c| 17 +++-- drivers/net/ethernet/ti/cpsw_ale.c| 11 +--

[PATCH net-next 09/11] net: ethernet: ti: ale: move static initialization in cpsw_ale_create()

2017-11-30 Thread Grygorii Strashko
Move static initialization from cpsw_ale_start() to cpsw_ale_create() as it does not make much sence to perform static initializtion in cpsw_ale_start() which is called everytime netif[s] is opened. Signed-off-by: Grygorii Strashko ---

[PATCH net-next 07/11] net: ethernet: ti: ale: disable ale from stop()

2017-11-30 Thread Grygorii Strashko
ALE is enabled from cpsw_ale_start() now, but disabled only from cpsw_ale_destroy() which introduces inconsitance as cpsw_ale_start() is called when netif[s] is opened, but cpsw_ale_destroy() is called when driver is removed. Hence, move ALE disabling in cpsw_ale_stop(). Signed-off-by: Grygorii

[PATCH 3/3] make sock_alloc_file() do sock_release() on failures

2017-11-30 Thread Al Viro
This changes calling conventions (and simplifies the hell out the callers). New rules: once struct socket had been passed to sock_alloc_file(), it's been consumed either by struct file or by sock_release() done by sock_alloc_file(). Either way the caller should not do sock_release() after that

[PATCH net-next 08/11] net: ethernet: ti: ale: optimize ale entry mask bits configuartion

2017-11-30 Thread Grygorii Strashko
The ale->params.ale_ports parameter can be used to deriver values for all ale entry mask bits: port_mask_bits, port_mask_bits, port_num_bits. Hence, calculate above values and drop all hardcoded values. For port_num_bits calcualtion use order_base_2() API. Signed-off-by: Grygorii Strashko

[PATCH 2/3] fix kcm_clone()

2017-11-30 Thread Al Viro
1) it's fput() or sock_release(), not both 2) don't do fd_install() until the last failure exit. 3) not a bug per se, but... don't attach socket to struct file until it's set up. Take reserving descriptor into the caller, move fd_install() to the caller, sanitize failure exits and calling

[PATCH net-next 01/11] net: ethernet: ti: cpsw: drop unused var poll from cpsw_update_channels_res

2017-11-30 Thread Grygorii Strashko
Drop unused variable "poll" from cpsw_update_channels_res(). Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index a73600d..523c110

[PATCH 1/3] socketpair(): allocate descriptors first

2017-11-30 Thread Al Viro
simplifies failure exits considerably... Signed-off-by: Al Viro --- net/socket.c | 89 ++-- 1 file changed, 38 insertions(+), 51 deletions(-) diff --git a/net/socket.c b/net/socket.c index

[PATCH net-next 11/11] net: ethernet: ti: ale: fix port check in cpsw_ale_control_set/get

2017-11-30 Thread Grygorii Strashko
ALE ports number includes the Host port and ext Ports, and ALE ports numbering starts from 0, so correct corresponding port checks in cpsw_ale_control_set/get(). Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw_ale.c | 4 ++-- 1 file changed, 2

[RFC][PATCHES] sock_alloc_file() cleanups and fixes

2017-11-30 Thread Al Viro
Almost all sock_alloc_file() callers want sock_release() in case of failure. Currently it consumes socket on success (it will be destroyed on final fput() of resulting file) and leaves it alone on failure. Making it consume socket in all cases makes for simpler life in callers.

[PATCH net-next 2/5] rhashtable: Add rhastable_walk_peek

2017-11-30 Thread Tom Herbert
This function is like rhashtable_walk_next except that it only returns the current element in the inter and does not advance the iter. This patch also creates __rhashtable_walk_find_next. It finds the next element in the table when the entry cached in iter is NULL or at the end of a slot.

[PATCH net-next 4/5] spinlock: Add library function to allocate spinlock buckets array

2017-11-30 Thread Tom Herbert
Add two new library functions: alloc_bucket_spinlocks and free_bucket_spinlocks. These are used to allocate and free an array of spinlocks that are useful as locks for hash buckets. The interface specifies the maximum number of spinlocks in the array as well as a CPU multiplier to derive the

[PATCH net-next 1/5] rhashtable: Don't reset walker table in rhashtable_walk_start

2017-11-30 Thread Tom Herbert
Remove the code that resets the walker table. The walker table should only be initialized in the walk init function or when a future table is encountered. If the walker table is NULL this is the indication that the walk has completed and this information can be used to break a multi-call walk in

[PATCH net-next 5/5] rhashtable: Call library function alloc_bucket_locks

2017-11-30 Thread Tom Herbert
To allocate the array of bucket locks for the hash table we now call library function alloc_bucket_spinlocks. This function is based on the old alloc_bucket_locks in rhashtable and should produce the same effect. Signed-off-by: Tom Herbert --- lib/rhashtable.c | 47

  1   2   3   4   >