Re: [PATCH v3 bpf-next 05/19] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-12 Thread Jiong Wang
Jakub Kicinski writes: > On Fri, 12 Apr 2019 22:59:38 +0100, Jiong Wang wrote: >> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c >> index c722015..3c5ca00 100644 >> --- a/kernel/bpf/verifier.c >> +++ b/kernel/bpf/verifier.c >> @@ -1135,7 +1135,7 @@ static int check_subprogs(struct bp

Re: [PATCH 9/9] udpv6: Check address length before reading address family

2019-04-12 Thread Tetsuo Handa
On 2019/04/13 1:49, Andrey Ignatov wrote: > Such a check wasn't added since it's already checked in > inet_dgram_connect, the only place where udpv6_pre_connect is called: > > int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, > int addr_len, int flags)

Re: [PATCH bpf] libbpf: add binary to gitignore

2019-04-12 Thread Jakub Kicinski
On Sat, 13 Apr 2019 03:37:32 +0200, Matteo Croce wrote: > Some binaries are generated when building libbpf from tools/lib/bpf/, > namely libbpf.so.0.0.2 and libbpf.so.0. > Add them to the local .gitignore. > > Signed-off-by: Matteo Croce Reviewed-by: Jakub Kicinski Thanks!

[PATCH bpf] libbpf: add binary to gitignore

2019-04-12 Thread Matteo Croce
Some binaries are generated when building libbpf from tools/lib/bpf/, namely libbpf.so.0.0.2 and libbpf.so.0. Add them to the local .gitignore. Signed-off-by: Matteo Croce --- tools/lib/bpf/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/.gitignore b/tools/lib/bpf/.g

Re: [PATCH v3 bpf-next 11/19] libbpf: add "prog_flags" to bpf_program/bpf_prog_load_attr/bpf_load_program_attr

2019-04-12 Thread Jakub Kicinski
On Fri, 12 Apr 2019 22:59:44 +0100, Jiong Wang wrote: > libbpf doesn't allow passing "prog_flags" during bpf program load in a > couple of load related APIs, "bpf_load_program_xattr", "load_program" and > "bpf_prog_load_xattr". > > It makes sense to allow passing "prog_flags" which is useful for >

Re: [PATCH v3 bpf-next 05/19] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-12 Thread Jakub Kicinski
On Fri, 12 Apr 2019 22:59:38 +0100, Jiong Wang wrote: > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > index c722015..3c5ca00 100644 > --- a/kernel/bpf/verifier.c > +++ b/kernel/bpf/verifier.c > @@ -1135,7 +1135,7 @@ static int check_subprogs(struct bpf_verifier_env *env) > */ > st

Re: [PATCH net-next 0/4] nfp: update to control structures

2019-04-12 Thread David Miller
From: Jakub Kicinski Date: Thu, 11 Apr 2019 20:27:03 -0700 > This series prepares NFP control structures for crypto offloads. > So far we mostly dealt with configuration requests under rtnl lock. > This will no longer be the case with crypto. Additionally we will > try to reuse the BPF control m

Re: [PATCH net] ipv4: recompile ip options in ipv4_link_failure

2019-04-12 Thread David Miller
From: Stephen Suryaputra Date: Fri, 12 Apr 2019 16:19:27 -0400 > Recompile IP options since IPCB may not be valid anymore when > ipv4_link_failure is called from arp_error_report. > > Refer to the commit 3da1ed7ac398 ("net: avoid use IPCB in cipso_v4_error") > and the commit before that (9ef6b42

Re: [PATCH v3 bpf-next 04/19] bpf: refactor "check_reg_arg" to eliminate code redundancy

2019-04-12 Thread Alexei Starovoitov
On Fri, Apr 12, 2019 at 10:59:37PM +0100, Jiong Wang wrote: > There are a few "regs[regno]" here are there across "check_reg_arg", this > patch factor it out into a simple "reg" pointer. The intention is to > simplify code indentation and make the later patches in this set look > cleaner. > > Revi

Re: [PATCH net-next] ipv6: Remove flowi6_oif compare from __ip6_route_redirect

2019-04-12 Thread David Miller
From: David Ahern Date: Fri, 12 Apr 2019 10:31:14 -0700 > From: David Ahern > > In the review of 0b34eb004347 ("ipv6: Refactor __ip6_route_redirect"), > Martin noted that the flowi6_oif compare is moved to the new helper and > should be removed from __ip6_route_redirect. Fix the oversight. > >

Re: [PATCH v2 bpf-next 2/2] bpftool: Improve handling of ENOSPC on reuseport_array map dumps

2019-04-12 Thread Jakub Kicinski
On Fri, 12 Apr 2019 12:03:22 +0900, Benjamin Poirier wrote: > avoids outputting a series of > value: > No space left on device > > The value itself is not wrong but bpf_fd_reuseport_array_lookup_elem() can > only return it if the map was created with value_size = 8. There's nothing > b

Re: [PATCH v2 bpf-next 1/2] bpftool: Use print_entry_error() in case of ENOENT when dumping

2019-04-12 Thread Jakub Kicinski
On Fri, 12 Apr 2019 12:03:21 +0900, Benjamin Poirier wrote: > diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c > index e96903078991..71840faaeab5 100644 > --- a/tools/bpf/bpftool/map.c > +++ b/tools/bpf/bpftool/map.c > @@ -261,20 +261,19 @@ static void print_entry_json(struct bpf_map_

Re: [PATCH] qede: fix write to free'd pointer error and double free of ptp

2019-04-12 Thread David Miller
From: Colin King Date: Fri, 12 Apr 2019 15:13:27 +0100 > From: Colin Ian King > > The err2 error return path calls qede_ptp_disable that cleans up > on an error and frees ptp. After this, the free'd ptp is dereferenced > when ptp->clock is set to NULL and the code falls-through to error > path

Re: [PATCH v2 bpf-next 1/2] bpftool: Use print_entry_error() in case of ENOENT when dumping

2019-04-12 Thread Jakub Kicinski
On Sat, 13 Apr 2019 07:49:24 +0900, Benjamin Poirier wrote: > To be honest, I don't think the formatting in those print_entry_* > functions should change according to the length in any case. I think the > key and value for each entry should always be on the same line for ease > of grepping. A follo

Re: [patch net-next 0/4] netdevsim: Mostly cleanup in sdev/bpf iface area

2019-04-12 Thread David Miller
From: Jiri Pirko Date: Fri, 12 Apr 2019 14:49:25 +0200 > From: Jiri Pirko > > This patches does mainly internal netdevsim code shuffle. Nothing > serious, just small changes to help readability and preparations for > future work. Looks good, series applied. Thanks Jiri.

[PATCH bpf-next] selftests/bpf: make flow dissector tests more extensible

2019-04-12 Thread Stanislav Fomichev
Rewrite selftest to iterate over an array with input packet and expected flow_keys. This should make it easier to extend this test with additional cases without too much boilerplate. Signed-off-by: Stanislav Fomichev --- .../selftests/bpf/prog_tests/flow_dissector.c | 197 +++--- 1 f

Re: [RFC net-next 1/1] tdc.py: Introduce required plugins

2019-04-12 Thread Nicolas Dichtel
Le 12/04/2019 à 18:07, Lucas Bates a écrit : [snip] > So something like this? Note the usage of the keyword "requires", > > { > "id": "901f", > "name": "Add fw filter with prio at 32-bit maxixum", > "category": [ > "filter", > "fw" > ],

Re: [PATCH bpf-next] selftests/bpf: two scale tests

2019-04-12 Thread Alexei Starovoitov
On Fri, Apr 12, 2019 at 04:24:51PM -0700, Song Liu wrote: > On Fri, Apr 12, 2019 at 2:41 PM Alexei Starovoitov wrote: > > > > Add two tests to check that sequence of 1024 jumps is verifiable. > > > > Signed-off-by: Alexei Starovoitov > > Acked-by: Song Liu > > Shall we add a test that go beyon

Re: [PATCH net-next] net: dummy: use generic helper to report timestamping info

2019-04-12 Thread David Miller
From: Julian Wiedmann Date: Fri, 12 Apr 2019 13:06:13 +0200 > For reporting the common set of SW timestamping capabilities, use > ethtool_op_get_ts_info() instead of re-implementing it. > > Signed-off-by: Julian Wiedmann Applied.

Re: [PATCH net-next] net: veth: use generic helper to report timestamping info

2019-04-12 Thread David Miller
From: Julian Wiedmann Date: Fri, 12 Apr 2019 13:06:15 +0200 > For reporting the common set of SW timestamping capabilities, use > ethtool_op_get_ts_info() instead of re-implementing it. > > Signed-off-by: Julian Wiedmann Applied.

Re: [PATCH net-next] net: loopback: use generic helper to report timestamping info

2019-04-12 Thread David Miller
From: Julian Wiedmann Date: Fri, 12 Apr 2019 13:06:14 +0200 > For reporting the common set of SW timestamping capabilities, use > ethtool_op_get_ts_info() instead of re-implementing it. > > Signed-off-by: Julian Wiedmann Applied.

Re: [PATCH bpf-next] selftests/bpf: two scale tests

2019-04-12 Thread Song Liu
On Fri, Apr 12, 2019 at 2:41 PM Alexei Starovoitov wrote: > > Add two tests to check that sequence of 1024 jumps is verifiable. > > Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Shall we add a test that go beyond the 1M limit? > --- > tools/testing/selftests/bpf/test_verifier.c | 70

Re: [PATCH bpf-next] bpf: Fix distinct pointer types warning for ARCH=i386

2019-04-12 Thread Alexei Starovoitov
On Fri, Apr 12, 2019 at 4:01 PM Andrey Ignatov wrote: > > Fix a new warning reported by kbuild for make ARCH=i386: > >In file included from kernel/bpf/cgroup.c:11:0: >kernel/bpf/cgroup.c: In function '__cgroup_bpf_run_filter_sysctl': >include/linux/kernel.h:827:29: warning: comparison

[PATCH bpf-next] bpf: Fix distinct pointer types warning for ARCH=i386

2019-04-12 Thread Andrey Ignatov
Fix a new warning reported by kbuild for make ARCH=i386: In file included from kernel/bpf/cgroup.c:11:0: kernel/bpf/cgroup.c: In function '__cgroup_bpf_run_filter_sysctl': include/linux/kernel.h:827:29: warning: comparison of distinct pointer types lacks a cast (!!(sizeof((typeof(x

Re: [PATCH v2 bpf-next 1/2] bpftool: Use print_entry_error() in case of ENOENT when dumping

2019-04-12 Thread Benjamin Poirier
On 2019/04/12 11:28, Quentin Monnet wrote: [...] > > > { > > - int value_size = strlen(value); > > - bool single_line, break_names; > > + bool break_names; > > - break_names = info->key_size > 16 || value_size > 16; > > - single_line = info->key_size + value_size <= 24 && !break_names;

Re: [PATCH v2 net-next] net: phy: switch drivers to use dynamic feature detection

2019-04-12 Thread Andrew Lunn
On Fri, Apr 12, 2019 at 08:47:03PM +0200, Heiner Kallweit wrote: > Recently genphy_read_abilities() has been added that dynamically detects > clause 22 PHY abilities. I *think* this detection should work with all > supported PHY's, at least for the ones with basic features sets, i.e. > PHY_BASIC_FE

Re: [PATCH/RFC v2 bpf-next 11/19] libbpf: new global variable "libbpf_test_mode"

2019-04-12 Thread Jiong Wang
> If we want a more clean change in libbpf, it is more about how to offer clean > API to > pass "prog_flags" when load file/obj/raw_insn, I followed this path a little bit further: - naturally allow specify prog_flags through *_attr structure. - set high 32-bit randomization prog_flags throug

[PATCH v3 bpf-next 08/19] bpf: insert explicit zero extension insn when hardware doesn't do it implicitly

2019-04-12 Thread Jiong Wang
After previous patches, verifier has marked those instructions that really need zero extension on dst_reg. It is then for all back-ends to decide how to use such information to eliminate unnecessary zero extension code-gen during JIT compilation. One approach is: 1. Verifier insert explicit zer

[PATCH v3 bpf-next 02/19] bpf: refactor propagate_liveness to eliminate code redundance

2019-04-12 Thread Jiong Wang
Access to reg states were not factored out, the consequence is long code for dereferencing them which made the indentation not good for reading. This patch factor out these code so the core code in the loop could be easier to follow. Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang --- ke

[PATCH v3 bpf-next 01/19] bpf: refactor propagate_liveness to eliminate duplicated for loop

2019-04-12 Thread Jiong Wang
Propagation for register and stack slot are finished in separate for loop, while they are perfect to be put into a single loop. This could also let them share some common variables in later patches. Signed-off-by: Jiong Wang --- kernel/bpf/verifier.c | 4 +--- 1 file changed, 1 insertion(+), 3

[PATCH v3 bpf-next 18/19] riscv: bpf: eliminate zero extension code-gen

2019-04-12 Thread Jiong Wang
CC: Björn Töpel Signed-off-by: Jiong Wang --- arch/riscv/net/bpf_jit_comp.c | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/arch/riscv/net/bpf_jit_comp.c b/arch/riscv/net/bpf_jit_comp.c index 80b12aa..9cba262 100644 --- a/arch/riscv/net/bpf_

[PATCH v3 bpf-next 09/19] bpf: introduce new bpf prog load flags "BPF_F_TEST_RND_HI32"

2019-04-12 Thread Jiong Wang
x86_64 and AArch64 perhaps are two arches that running bpf testsuite frequently, however the zero extension insertion pass is not enabled for them because of their hardware support. It is critical to guarantee the pass correction as it is supposed to be enabled at default for a couple of other arc

[PATCH v3 bpf-next 04/19] bpf: refactor "check_reg_arg" to eliminate code redundancy

2019-04-12 Thread Jiong Wang
There are a few "regs[regno]" here are there across "check_reg_arg", this patch factor it out into a simple "reg" pointer. The intention is to simplify code indentation and make the later patches in this set look cleaner. Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang --- kernel/bpf/veri

[PATCH v3 bpf-next 07/19] bpf: reduce false alarm by refining helper call arg types

2019-04-12 Thread Jiong Wang
Unlike BPF to BPF function call, BPF helper call is calls to native insns that verifier can't walk. So, verifier needs helper proto type descriptions for data-flow purpose. There is such information already, but it is not differentiate sub-register read with full register read. This patch split "

[PATCH v3 bpf-next 00/19] bpf: eliminate zero extensions for sub-register writes

2019-04-12 Thread Jiong Wang
v3: - remove redundant check in "propagate_liveness_reg". (Jakub) - add extra check in "mark_reg_read" to prune more search. (Jakub) - re-implemented "prog_flags" passing mechanism, removed use of global switch inside libbpf. - enabled high 32-bit randomization beyond "test_verifier" an

[PATCH v3 bpf-next 10/19] bpf: randomize high 32-bit when BPF_F_TEST_RND_HI32 is set

2019-04-12 Thread Jiong Wang
This patch randomizes high 32-bit of a definition when BPF_F_TEST_RND_HI32 is set. It does this once the flag set no matter there is hardware zero extension support or not. Because this is a test feature and we want to deliver the most stressful test. Suggested-by: Alexei Starovoitov Signed-off-

[PATCH v3 bpf-next 17/19] x32: bpf: eliminate zero extension code-gen

2019-04-12 Thread Jiong Wang
Cc: Wang YanQing Signed-off-by: Jiong Wang --- arch/x86/net/bpf_jit_comp32.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c index 0d9cdff..8c6cf22 100644 --- a/arch/x86/net/bpf_j

[PATCH v3 bpf-next 03/19] bpf: factor out reg and stack slot propagation into "propagate_liveness_reg"

2019-04-12 Thread Jiong Wang
After code refactor in previous patches, the propagation logic inside the for loop in "propagate_liveness" becomes clear that they are good enough to be factored out into a common function "propagate_liveness_reg". Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang --- kernel/bpf/verifier.c

[PATCH v3 bpf-next 15/19] s390: bpf: eliminate zero extension code-gen

2019-04-12 Thread Jiong Wang
Cc: Martin Schwidefsky Cc: Heiko Carstens Signed-off-by: Jiong Wang --- arch/s390/net/bpf_jit_comp.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 51dd026..59592d7 100644 --- a/arch/s390/net/b

[PATCH v3 bpf-next 14/19] powerpc: bpf: eliminate zero extension code-gen

2019-04-12 Thread Jiong Wang
Cc: Naveen N. Rao Cc: Sandipan Das Signed-off-by: Jiong Wang --- arch/powerpc/net/bpf_jit_comp64.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c index 21a1dcd..d10621b 100644 --- a/arch/powerpc/ne

[PATCH v3 bpf-next 13/19] arm: bpf: eliminate zero extension code-gen

2019-04-12 Thread Jiong Wang
Cc: Shubham Bansal Signed-off-by: Jiong Wang --- arch/arm/net/bpf_jit_32.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index c8bfbbf..8cecd06 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/ar

[PATCH v3 bpf-next 12/19] selftests: enable hi32 randomization for all tests

2019-04-12 Thread Jiong Wang
The previous libbpf patch allows user to specify "prog_flags" to bpf program load APIs. To enable high 32-bit randomization for a test, we need to set BPF_F_TEST_RND_HI32 in "prog_flags". To enable such randomization for all tests, we need to make sure all places are passing BPF_F_TEST_RND_HI32. C

[PATCH v3 bpf-next 16/19] sparc: bpf: eliminate zero extension code-gen

2019-04-12 Thread Jiong Wang
Cc: David S. Miller Signed-off-by: Jiong Wang --- arch/sparc/net/bpf_jit_comp_64.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/sparc/net/bpf_jit_comp_64.c b/arch/sparc/net/bpf_jit_comp_64.c index 65428e7..e58f84e 100644 --- a/arch/sparc/net/bpf_jit_comp_64.c +

[PATCH v3 bpf-next 19/19] nfp: bpf: eliminate zero extension code-gen

2019-04-12 Thread Jiong Wang
This patch eliminate zero extension code-gen for instructions except load/store when possible. Elimination for load/store will be supported in up coming patches. Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 119 +-

[PATCH v3 bpf-next 11/19] libbpf: add "prog_flags" to bpf_program/bpf_prog_load_attr/bpf_load_program_attr

2019-04-12 Thread Jiong Wang
libbpf doesn't allow passing "prog_flags" during bpf program load in a couple of load related APIs, "bpf_load_program_xattr", "load_program" and "bpf_prog_load_xattr". It makes sense to allow passing "prog_flags" which is useful for customizing program loading. Signed-off-by: Jiong Wang --- too

[PATCH v3 bpf-next 06/19] bpf: mark lo32 writes that should be zero extended into hi32

2019-04-12 Thread Jiong Wang
eBPF ISA specification requires high 32-bit cleared when low 32-bit sub-register is written. This applies to destination register of ALU32 etc. JIT back-ends must guarantee this semantic when doing code-gen. x86-64 and arm64 ISA has the same semantic, so the corresponding JIT back-end doesn't need

[PATCH v3 bpf-next 05/19] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-12 Thread Jiong Wang
Register liveness infrastructure doesn't track register read width at the moment, while the width information will be needed for the later 32-bit safety analysis pass. This patch take the first step to split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32. Liveness propagation code are upd

[PATCH bpf-next] selftests/bpf: two scale tests

2019-04-12 Thread Alexei Starovoitov
Add two tests to check that sequence of 1024 jumps is verifiable. Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/test_verifier.c | 70 tools/testing/selftests/bpf/verifier/scale.c | 18 + 2 files changed, 88 insertions(+) create mode 100644 tools/tes

[PATCH net] ipv4: recompile ip options in ipv4_link_failure

2019-04-12 Thread Stephen Suryaputra
Recompile IP options since IPCB may not be valid anymore when ipv4_link_failure is called from arp_error_report. Refer to the commit 3da1ed7ac398 ("net: avoid use IPCB in cipso_v4_error") and the commit before that (9ef6b42ad6fd) for a similar issue. Signed-off-by: Stephen Suryaputra --- net/ip

Request for net merge into net-next

2019-04-12 Thread Felix Fietkau
Hi Dave, I have a whole bunch of pending mt76 changes for -next which depend on these two commits: commit 2b4a66980217332d91ab1785e1750857d6d52bc8 mac80211: make ieee80211_schedule_txq schedule empty TXQs commit 5b989c18dab2e82bac8a5564a174794bf84b20e6 mac80211: rework locking for txq scheduling

[PATCH v2 net-next] net: phy: switch drivers to use dynamic feature detection

2019-04-12 Thread Heiner Kallweit
Recently genphy_read_abilities() has been added that dynamically detects clause 22 PHY abilities. I *think* this detection should work with all supported PHY's, at least for the ones with basic features sets, i.e. PHY_BASIC_FEATURES and PHY_GBIT_FEATURES. So let's remove setting these features expl

Re: [PATCH net-next 0/8] net/smc: patches 2019-04-12

2019-04-12 Thread David Miller
From: Ursula Braun Date: Fri, 12 Apr 2019 12:57:22 +0200 > here are patches for SMC: > * patch 1 improves behavior of non-blocking connect > * patches 2, 3, 5, 7, and 8 improve connecting return codes > * patches 4 and 6 are a cleanups without functional change Series applied, thanks.

Re: [PATCH bpf-next] libbpf: Add xsk.h to be installed by install_headers

2019-04-12 Thread Eelco Chaudron
Sorry messed it up :( Did a pull in the wrong directory to verify the patch was not existing… //Eelco On 12 Apr 2019, at 18:31, Stanislav Fomichev wrote: On 04/12, Song Liu wrote: On Apr 12, 2019, at 7:17 AM, Eelco Chaudron wrote: The user API file xsk.h was not installed by install_he

Re: [PATCH bpf-next 0/5] tools: bpftool: fix minor issues in bpftool and its documentation

2019-04-12 Thread Song Liu
On Fri, Apr 12, 2019 at 6:30 AM Quentin Monnet wrote: > > Hi, > This series brings a number of small fixes to bpftool and the related > manual pages. > > The first two patches are on bpftool itself (remove blank lines when > dumping programs, do not set errno when showing a tree of cgroup programs

Re: [PATCH bpf-next V2 3/4] bpf: cpumap do bulk allocation of SKBs

2019-04-12 Thread Song Liu
On Fri, Apr 12, 2019 at 8:08 AM Jesper Dangaard Brouer wrote: > > As cpumap now batch consume xdp_frame's from the ptr_ring, it knows how many > SKBs it need to allocate. Thus, lets bulk allocate these SKBs via > kmem_cache_alloc_bulk() API, and use the previously introduced function > build_skb_a

Re: [PATCH bpf-next V2 2/4] net: core: introduce build_skb_around

2019-04-12 Thread Song Liu
On Fri, Apr 12, 2019 at 8:08 AM Jesper Dangaard Brouer wrote: > > The function build_skb() also have the responsibility to allocate and clear > the SKB structure. Introduce a new function build_skb_around(), that moves > the responsibility of allocation and clearing to the caller. This allows > ca

Re: [PATCH] net: dsa: fixed-link interface is reporting SPEED_UNKNOWN

2019-04-12 Thread Heiner Kallweit
On 12.04.2019 01:01, Vladimir Oltean wrote: > With Heiner's recent patch "b6163f194c69 net: phy: improve > genphy_read_status", the phydev->speed is now initialized by default to > SPEED_UNKNOWN even for fixed PHYs. This is not necessarily bad, since it > is not correct to call genphy_config_init()

[PATCH net-next] ipv6: Remove flowi6_oif compare from __ip6_route_redirect

2019-04-12 Thread David Ahern
From: David Ahern In the review of 0b34eb004347 ("ipv6: Refactor __ip6_route_redirect"), Martin noted that the flowi6_oif compare is moved to the new helper and should be removed from __ip6_route_redirect. Fix the oversight. Fixes: 0b34eb004347 ("ipv6: Refactor __ip6_route_redirect") Reported-by

Re: [PATCH 9/9] udpv6: Check address length before reading address family

2019-04-12 Thread David Miller
From: Tetsuo Handa Date: Fri, 12 Apr 2019 19:56:39 +0900 > KMSAN will complain if valid address length passed to udpv6_pre_connect() > is shorter than sizeof("struct sockaddr"->sa_family) bytes. > > (This patch is bogus if it is guaranteed that udpv6_pre_connect() is > always called after checki

Re: [PATCH 8/9] bpf: Check address length before reading address family

2019-04-12 Thread David Miller
From: Tetsuo Handa Date: Fri, 12 Apr 2019 19:55:47 +0900 > KMSAN will complain if valid address length passed to bpf_bind() is > shorter than sizeof("struct sockaddr"->sa_family) bytes. > > Signed-off-by: Tetsuo Handa Applied.

Re: [PATCH 7/9] llc: Check address length before reading address field

2019-04-12 Thread David Miller
From: Tetsuo Handa Date: Fri, 12 Apr 2019 19:55:14 +0900 > KMSAN will complain if valid address length passed to bind() is shorter > than sizeof(struct sockaddr_llc) bytes. > > Signed-off-by: Tetsuo Handa Applied.

Re: [PATCH 6/9] Bluetooth: Check address length before reading address field

2019-04-12 Thread David Miller
From: Tetsuo Handa Date: Fri, 12 Apr 2019 19:54:33 +0900 > KMSAN will complain if valid address length passed to bind() is shorter > than sizeof(struct sockaddr_sco) bytes. > > Signed-off-by: Tetsuo Handa Applied.

Re: [PATCH 4/9] net: netlink: Check address length before reading groups field

2019-04-12 Thread David Miller
From: Tetsuo Handa Date: Fri, 12 Apr 2019 19:53:38 +0900 > KMSAN will complain if valid address length passed to bind() is shorter > than sizeof(struct sockaddr_nl) bytes. > > Signed-off-by: Tetsuo Handa Applied.

Re: [PATCH 5/9] rxrpc: Check address length before reading srx_service field

2019-04-12 Thread David Miller
From: Tetsuo Handa Date: Fri, 12 Apr 2019 19:54:05 +0900 > KMSAN will complain if valid address length passed to bind() is shorter > than sizeof(struct sockaddr_rxrpc) bytes. > > Signed-off-by: Tetsuo Handa I know David said he'd take it, but I'll take it too, no harm in that.

Re: [PATCH 1/9] net/rds: Check address length before reading address family

2019-04-12 Thread David Miller
From: Tetsuo Handa Date: Fri, 12 Apr 2019 19:51:52 +0900 > syzbot is reporting uninitialized value at rds_connect() [1] and > rds_bind() [2]. This is because syzbot is passing ulen == 0 whereas > these functions expect that it is safe to access sockaddr->family field > in order to determine minim

Re: [PATCH 3/9] sctp: Check address length before reading srx_service field

2019-04-12 Thread David Miller
From: Tetsuo Handa Date: Fri, 12 Apr 2019 19:53:10 +0900 > KMSAN will complain if valid address length passed to connect() is shorter > than sizeof("struct sockaddr"->sa_family) bytes. > > Signed-off-by: Tetsuo Handa Applied with Subject fixed.

Re: [PATCH 2/9] mISDN: Check address length before reading address family

2019-04-12 Thread David Miller
From: Tetsuo Handa Date: Fri, 12 Apr 2019 19:52:36 +0900 > KMSAN will complain if valid address length passed to bind() is shorter > than sizeof("struct sockaddr_mISDN"->family) bytes. > > Signed-off-by: Tetsuo Handa Applied.

Re: cellular modem driver APIs

2019-04-12 Thread Johannes Berg
On Fri, 2019-04-12 at 16:27 +0200, Bjørn Mork wrote: > Johannes Berg writes: > > On Wed, 2019-04-10 at 21:54 -0600, Subash Abhinov Kasiviswanathan wrote: > > > > > These packets will be processed as raw IP muxed frames on the PC as > > > well, not as ethernet though. > > > > But in order to tra

Re: [PATCH bpf-next] libbpf: Add xsk.h to be installed by install_headers

2019-04-12 Thread Song Liu
> On Apr 12, 2019, at 9:31 AM, Stanislav Fomichev wrote: > > On 04/12, Song Liu wrote: >> >> >>> On Apr 12, 2019, at 7:17 AM, Eelco Chaudron wrote: >>> >>> The user API file xsk.h was not installed by install_headers, this >>> change will fix this. >>> >>> Signed-off-by: Eelco Chaudron >

Re: [PATCH 8/9] bpf: Check address length before reading address family

2019-04-12 Thread Andrey Ignatov
Alexei Starovoitov [Fri, 2019-04-12 09:20 -0700]: > On Fri, Apr 12, 2019 at 3:56 AM Tetsuo Handa > wrote: > > > > KMSAN will complain if valid address length passed to bpf_bind() is > > shorter than sizeof("struct sockaddr"->sa_family) bytes. > > > > Signed-off-by: Tetsuo Handa > > --- > > net/

Re: [PATCH 9/9] udpv6: Check address length before reading address family

2019-04-12 Thread Andrey Ignatov
Tetsuo Handa [Fri, 2019-04-12 03:57 -0700]: > KMSAN will complain if valid address length passed to udpv6_pre_connect() > is shorter than sizeof("struct sockaddr"->sa_family) bytes. > > (This patch is bogus if it is guaranteed that udpv6_pre_connect() is > always called after checking "struct soc

Re: [PATCH 3/9] sctp: Check address length before reading srx_service field

2019-04-12 Thread Neil Horman
On Fri, Apr 12, 2019 at 08:21:26PM +0900, Tetsuo Handa wrote: > On 2019/04/12 20:12, Neil Horman wrote: > > On Fri, Apr 12, 2019 at 07:53:10PM +0900, Tetsuo Handa wrote: > >> KMSAN will complain if valid address length passed to connect() is shorter > >> than sizeof("struct sockaddr"->sa_family) by

Re: [PATCH 1/9] net/rds: Check address length before reading address family

2019-04-12 Thread Santosh Shilimkar
On 4/12/2019 3:51 AM, Tetsuo Handa wrote: syzbot is reporting uninitialized value at rds_connect() [1] and rds_bind() [2]. This is because syzbot is passing ulen == 0 whereas these functions expect that it is safe to access sockaddr->family field in order to determine minimal address length for v

Re: [PATCH bpf-next] libbpf: Add xsk.h to be installed by install_headers

2019-04-12 Thread Stanislav Fomichev
On 04/12, Song Liu wrote: > > > > On Apr 12, 2019, at 7:17 AM, Eelco Chaudron wrote: > > > > The user API file xsk.h was not installed by install_headers, this > > change will fix this. > > > > Signed-off-by: Eelco Chaudron > > Cc: Magnus Karlsson > Fixes: 1cad07884239 ("libbpf: add support

Re: [PATCH 8/9] bpf: Check address length before reading address family

2019-04-12 Thread Alexei Starovoitov
On Fri, Apr 12, 2019 at 3:56 AM Tetsuo Handa wrote: > > KMSAN will complain if valid address length passed to bpf_bind() is > shorter than sizeof("struct sockaddr"->sa_family) bytes. > > Signed-off-by: Tetsuo Handa > --- > net/core/filter.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --gi

Re: [oss-drivers] Re: [PATCH/RFC v2 bpf-next 05/19] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-12 Thread Jiong Wang
On Thu, Apr 11, 2019 at 5:53 PM Jiong Wang wrote: > > > > On 11 Apr 2019, at 17:44, Jakub Kicinski > > wrote: > > > > On Thu, 11 Apr 2019 07:13:03 +0100, Jiong Wang wrote: > @@ -1150,17 +1150,17 @@ static int mark_reg_read(struct bpf_verifier_env > *env, >

Re: [PATCH bpf-next] libbpf: Add xsk.h to be installed by install_headers

2019-04-12 Thread Song Liu
> On Apr 12, 2019, at 7:17 AM, Eelco Chaudron wrote: > > The user API file xsk.h was not installed by install_headers, this > change will fix this. > > Signed-off-by: Eelco Chaudron Cc: Magnus Karlsson Fixes: 1cad07884239 ("libbpf: add support for using AF_XDP sockets") Acked-by: Song Liu

Re: [PATCH bpf-next] bpf: fix whitespace for ENCAP_L2 defines in bpf.h

2019-04-12 Thread Song Liu
> On Apr 12, 2019, at 4:27 AM, Alan Maguire wrote: > > replace tab after #define with space in line with rest of definitions > > Signed-off-by: Alan Maguire Acked-by: Song Liu > --- > include/uapi/linux/bpf.h | 6 +++--- > tools/include/uapi/linux/bpf.h | 6 +++--- > 2 files changed,

Re: [PATCH 9/9] udpv6: Check address length before reading address family

2019-04-12 Thread Song Liu
> On Apr 12, 2019, at 3:56 AM, Tetsuo Handa > wrote: > > KMSAN will complain if valid address length passed to udpv6_pre_connect() > is shorter than sizeof("struct sockaddr"->sa_family) bytes. > > (This patch is bogus if it is guaranteed that udpv6_pre_connect() is > always called after chec

Re: [RFC net-next 1/1] tdc.py: Introduce required plugins

2019-04-12 Thread Lucas Bates
On Fri, Apr 12, 2019 at 11:42 AM Nicolas Dichtel wrote: > > Le 12/04/2019 à 17:21, Lucas Bates a écrit : > > On Fri, Apr 12, 2019 at 4:31 AM Nicolas Dichtel > > wrote: > >>> in our tri-weekly tc test meeting and the general consensus to address > >>> what you brought up is leaning towards the fol

Fw: [Bug 203289] New: Kernel will drop any IGMPv3 "Group-Specific Queries" if the source IP is 0.0.0.0

2019-04-12 Thread Stephen Hemminger
Begin forwarded message: Date: Fri, 12 Apr 2019 13:53:58 + From: bugzilla-dae...@bugzilla.kernel.org To: step...@networkplumber.org Subject: [Bug 203289] New: Kernel will drop any IGMPv3 "Group-Specific Queries" if the source IP is 0.0.0.0 https://bugzilla.kernel.org/show_bug.cgi?id=2032

Re: [RFC net-next 1/1] tdc.py: Introduce required plugins

2019-04-12 Thread Nicolas Dichtel
Le 12/04/2019 à 17:21, Lucas Bates a écrit : > On Fri, Apr 12, 2019 at 4:31 AM Nicolas Dichtel > wrote: >>> in our tri-weekly tc test meeting and the general consensus to address >>> what you brought up is leaning towards the following: >>> >>> - adding a symlink to nsPlugin >> I don't understand

Re: [PATCH 5/9] rxrpc: Check address length before reading srx_service field

2019-04-12 Thread David Howells
Tetsuo Handa wrote: > > Do you want me to add this to my rxrpc-fixes branch? > > > > Yes, please. Sorry, saw your reply right after posting my patches. Will forward yours on next. David

Re: [PATCH ipsec-next] xfrm: kconfig: make xfrm depend on inet

2019-04-12 Thread Randy Dunlap
On 4/12/19 1:14 AM, Florian Westphal wrote: > when CONFIG_INET is not enabled: > net/xfrm/xfrm_output.c: In function ‘xfrm4_tunnel_encap_add’: > net/xfrm/xfrm_output.c:234:2: error: implicit declaration of function > ‘ip_select_ident’ [-Werror=implicit-function-declaration] > ip_select_ident(dev_n

[PATCH iproute2] bridge: mdb: restore valid json output

2019-04-12 Thread Nikolay Aleksandrov
Since the commit below mdb's json output has been invalid and also with changed format. Restore it to a valid json like the previous format. Also takes care of a double "Deleted" print when monitoring for changes. Example bridge -p -d -j mdb show: [ { "mdb": [ { "index": 4

Re: [RFC net-next 1/1] tdc.py: Introduce required plugins

2019-04-12 Thread Lucas Bates
On Fri, Apr 12, 2019 at 4:31 AM Nicolas Dichtel wrote: > > in our tri-weekly tc test meeting and the general consensus to address > > what you brought up is leaning towards the following: > > > > - adding a symlink to nsPlugin > I don't understand why a symlink is needed. Just load it by default a

[PATCH bpf-next V2 1/4] bpf: cpumap use ptr_ring_consume_batched

2019-04-12 Thread Jesper Dangaard Brouer
Move ptr_ring dequeue outside loop, that allocate SKBs and calls network stack, as these operations that can take some time. The ptr_ring is a communication channel between CPUs, where we want to reduce/limit any cacheline bouncing. Do a concentrated bulk dequeue via ptr_ring_consume_batched, to s

[PATCH bpf-next V2 2/4] net: core: introduce build_skb_around

2019-04-12 Thread Jesper Dangaard Brouer
The function build_skb() also have the responsibility to allocate and clear the SKB structure. Introduce a new function build_skb_around(), that moves the responsibility of allocation and clearing to the caller. This allows caller to use kmem_cache (slab/slub) bulk allocation API. Next patch use t

[PATCH bpf-next V2 4/4] bpf: cpumap memory prefetchw optimizations for struct page

2019-04-12 Thread Jesper Dangaard Brouer
A lot of the performance gain comes from this patch. While analysing performance overhead it was found that the largest CPU stalls were caused when touching the struct page area. It is first read with a READ_ONCE from build_skb_around via page_is_pfmemalloc(), and when freed written by page_frag_f

[PATCH bpf-next V2 3/4] bpf: cpumap do bulk allocation of SKBs

2019-04-12 Thread Jesper Dangaard Brouer
As cpumap now batch consume xdp_frame's from the ptr_ring, it knows how many SKBs it need to allocate. Thus, lets bulk allocate these SKBs via kmem_cache_alloc_bulk() API, and use the previously introduced function build_skb_around(). Notice that the flag __GFP_ZERO asks the slab/slub allocator to

[PATCH bpf-next V2 0/4] Bulk optimization for XDP cpumap redirect

2019-04-12 Thread Jesper Dangaard Brouer
This patchset utilize a number of different kernel bulk APIs for optimizing the performance for the XDP cpumap redirect feature. Benchmark details are available here: https://github.com/xdp-project/xdp-project/blob/master/areas/cpumap/cpumap03-optimizations.org Performance measurements can be c

Re: cellular modem driver APIs

2019-04-12 Thread Bjørn Mork
Johannes Berg writes: > On Wed, 2019-04-10 at 21:54 -0600, Subash Abhinov Kasiviswanathan wrote: > >> These packets will be processed as raw IP muxed frames on the PC as >> well, not as ethernet though. > > But in order to transport them, they're always encapsulated in ethernet? No. There is no

[PATCH bpf-next] libbpf: Add xsk.h to be installed by install_headers

2019-04-12 Thread Eelco Chaudron
The user API file xsk.h was not installed by install_headers, this change will fix this. Signed-off-by: Eelco Chaudron --- tools/lib/bpf/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 008344507700..9b0a0f53d640 100644 --- a/tool

[PATCH] qede: fix write to free'd pointer error and double free of ptp

2019-04-12 Thread Colin King
From: Colin Ian King The err2 error return path calls qede_ptp_disable that cleans up on an error and frees ptp. After this, the free'd ptp is dereferenced when ptp->clock is set to NULL and the code falls-through to error path err1 that frees ptp again. Fix this by calling qede_ptp_disable and

Re: [PATCH net] bonding: fix event handling for stacked bonds

2019-04-12 Thread Sabrina Dubroca
2019-04-12, 15:57:55 +0200, Jiri Pirko wrote: > Fri, Apr 12, 2019 at 03:04:10PM CEST, s...@queasysnail.net wrote: > >When a bond is enslaved to another bond, bond_netdev_event() only > >handles the event as if the bond is a master, and skips treating the > >bond as a slave. > > > >This leads to a r

Re: [PATCH net] bonding: fix event handling for stacked bonds

2019-04-12 Thread Jiri Pirko
Fri, Apr 12, 2019 at 03:04:10PM CEST, s...@queasysnail.net wrote: >When a bond is enslaved to another bond, bond_netdev_event() only >handles the event as if the bond is a master, and skips treating the >bond as a slave. > >This leads to a refcount leak on the slave, since we don't remove the >adja

Re: [PATCH bpf-next] selftests/bpf: reserve flags in bpf_skb_net_shrink

2019-04-12 Thread Willem de Bruijn
On Fri, Apr 12, 2019 at 9:45 AM Alan Maguire wrote: > > On Fri, 12 Apr 2019, Willem de Bruijn wrote: > > > From: Willem de Bruijn > > > > The ENCAP flags in bpf_skb_adjust_room are ignored on decap with > > bpf_skb_net_shrink. Reserve these bits for future use. > > > > Fixes: 868d523535c2d ("bpf:

Re: [PATCH bpf-next] selftests/bpf: reserve flags in bpf_skb_net_shrink

2019-04-12 Thread Alan Maguire
On Fri, 12 Apr 2019, Willem de Bruijn wrote: > From: Willem de Bruijn > > The ENCAP flags in bpf_skb_adjust_room are ignored on decap with > bpf_skb_net_shrink. Reserve these bits for future use. > > Fixes: 868d523535c2d ("bpf: add bpf_skb_adjust_room encap flags") > Signed-off-by: Willem de Br

[PATCH bpf-next] selftests/bpf: reserve flags in bpf_skb_net_shrink

2019-04-12 Thread Willem de Bruijn
From: Willem de Bruijn The ENCAP flags in bpf_skb_adjust_room are ignored on decap with bpf_skb_net_shrink. Reserve these bits for future use. Fixes: 868d523535c2d ("bpf: add bpf_skb_adjust_room encap flags") Signed-off-by: Willem de Bruijn --- net/core/filter.c | 3 +++ 1 file changed, 3 inse

[PATCH bpf-next 4/5] tools: bpftool: fix short option name for printing version in man pages

2019-04-12 Thread Quentin Monnet
Manual pages would tell that option "-v" (lower case) would print the version number for bpftool. This is wrong: the short name of the option is "-V" (upper case). Fix the documentation accordingly. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski --- tools/bpf/bpftool/Documentation/bp

  1   2   >