Re: Race condition in route lookup

2019-10-15 Thread Martin Lau
On Tue, Oct 15, 2019 at 09:44:11AM -0700, Wei Wang wrote: > On Tue, Oct 15, 2019 at 7:29 AM Jesse Hathaway wrote: > > > > On Fri, Oct 11, 2019 at 12:54 PM Wei Wang wrote: > > > Hmm... Yes... I would think a per-CPU input cache should work for the > > > case above. > > > Another idea is: instead o

Re: Race condition in route lookup

2019-10-15 Thread Martin Lau
On Tue, Oct 15, 2019 at 09:42:49AM -0700, Wei Wang wrote: > On Tue, Oct 15, 2019 at 7:45 AM David Ahern wrote: > > > > On 10/14/19 1:26 PM, Martin Lau wrote: > > > > > > AFAICT, even for the route that are affected by > > > fib6_update_sernum_upto_root(), > > > I don't see the RTF_PCPU route is r

[PATCH v4 bpf-next 7/7] selftest/bpf: remove test_libbpf.sh and test_libbpf_open

2019-10-15 Thread Andrii Nakryiko
test_progs is much more sophisticated superset of tests compared to test_libbpf.sh and test_libbpf_open. Remove test_libbpf.sh and test_libbpf_open. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/.gitignore| 1 - tools/testing/selftests/bpf/Makefile | 3 +- t

[PATCH v4 bpf-next 2/7] selftests/bpf: make CO-RE reloc test impartial to test_progs flavor

2019-10-15 Thread Andrii Nakryiko
test_core_reloc_kernel test captures its own process name and validates it as part of the test. Given extra "flavors" of test_progs, this break for anything by default test_progs binary. Fix the test to cut out flavor part of the process name. Fixes: ee2eb063d330 ("selftests/bpf: Add BPF_CORE_READ

[PATCH v4 bpf-next 3/7] selftests/bpf: switch test_maps to test_progs' test.h format

2019-10-15 Thread Andrii Nakryiko
Make test_maps use tests.h header format consistent with the one used by test_progs, to facilitate unification. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/Makefile| 8 +--- tools/testing/selftests/bpf/test_maps.c | 8 2 files changed, 5 insertions(+), 11 dele

[PATCH v4 bpf-next 6/7] selftests/bpf: move test_queue_stack_map.h into progs/ where it belongs

2019-10-15 Thread Andrii Nakryiko
test_queue_stack_map.h is used only from BPF programs. Thus it should be part of progs/ subdir. An added benefit of moving it there is that new TEST_RUNNER_DEFINE_RULES macro-rule will properly capture dependency on this header for all BPF objects and trigger re-build, if it changes. Signed-off-by

[PATCH v4 bpf-next 1/7] selftests/bpf: teach test_progs to cd into subdir

2019-10-15 Thread Andrii Nakryiko
We are building a bunch of "flavors" of test_progs, e.g., w/ alu32 flag for Clang when building BPF object. test_progs setup is relying on having all the BPF object files and extra resources to be available in current working directory, though. But we actually build all these files into a separate

[PATCH v4 bpf-next 4/7] selftests/bpf: add simple per-test targets to Makefile

2019-10-15 Thread Andrii Nakryiko
Currently it's impossible to do `make test_progs` and have only test_progs be built, because all the binary targets are defined in terms of $(OUTPUT)/, and $(OUTPUT) is absolute path to current directory (or whatever gets overridden to by user). This patch adds simple re-directing targets for all

[PATCH v4 bpf-next 5/7] selftests/bpf: replace test_progs and test_maps w/ general rule

2019-10-15 Thread Andrii Nakryiko
Define test runner generation meta-rule that codifies dependencies between test runner, its tests, and its dependent BPF programs. Use that for defining test_progs and test_maps test-runners. Also additionally define 2 flavors of test_progs: - alu32, which builds BPF programs with 32-bit registers

[PATCH v4 bpf-next 0/7] Fix, clean up, and revamp selftests/bpf Makefile

2019-10-15 Thread Andrii Nakryiko
This patch set extensively revamps selftests/bpf's Makefile to generalize test runner concept and apply it uniformly to test_maps and test_progs test runners, along with test_progs' few build "flavors", exercising various ways to build BPF programs. As we do that, we fix dependencies between vario

Re: [PATCH v3 bpf-next 7/7] selftest/bpf: remove test_libbpf.sh and test_libbpf_open

2019-10-15 Thread Andrii Nakryiko
On Tue, Oct 15, 2019 at 10:50 PM Andrii Nakryiko wrote: > > test_progs is much more sophisticated superset of tests compared to > test_libbpf.sh and test_libbpf_open. Remove test_libbpf.sh and > test_libbpf_open. > > Signed-off-by: Andrii Nakryiko > --- > tools/testing/selftests/bpf/.gitignore

[PATCH v3 bpf-next 4/7] selftests/bpf: add simple per-test targets to Makefile

2019-10-15 Thread Andrii Nakryiko
Currently it's impossible to do `make test_progs` and have only test_progs be built, because all the binary targets are defined in terms of $(OUTPUT)/, and $(OUTPUT) is absolute path to current directory (or whatever gets overridden to by user). This patch adds simple re-directing targets for all

[PATCH v3 bpf-next 5/7] selftests/bpf: replace test_progs and test_maps w/ general rule

2019-10-15 Thread Andrii Nakryiko
Define test runner generation meta-rule that codifies dependencies between test runner, its tests, and its dependent BPF programs. Use that for defining test_progs and test_maps test-runners. Also additionally define 2 flavors of test_progs: - alu32, which builds BPF programs with 32-bit registers

[PATCH v3 bpf-next 1/7] selftests/bpf: teach test_progs to cd into subdir

2019-10-15 Thread Andrii Nakryiko
We are building a bunch of "flavors" of test_progs, e.g., w/ alu32 flag for Clang when building BPF object. test_progs setup is relying on having all the BPF object files and extra resources to be available in current working directory, though. But we actually build all these files into a separate

[PATCH v3 bpf-next 6/7] selftests/bpf: move test_queue_stack_map.h into progs/ where it belongs

2019-10-15 Thread Andrii Nakryiko
test_queue_stack_map.h is used only from BPF programs. Thus it should be part of progs/ subdir. An added benefit of moving it there is that new TEST_RUNNER_DEFINE_RULES macro-rule will properly capture dependency on this header for all BPF objects and trigger re-build, if it changes. Signed-off-by

[PATCH v3 bpf-next 0/7] Fix, clean up, and revamp selftests/bpf Makefile

2019-10-15 Thread Andrii Nakryiko
This patch set extensively revamps selftests/bpf's Makefile to generalize test runner concept and apply it uniformly to test_maps and test_progs test runners, along with test_progs' few build "flavors", exercising various ways to build BPF programs. As we do that, we fix dependencies between vario

[PATCH v3 bpf-next 2/7] selftests/bpf: make CO-RE reloc test impartial to test_progs flavor

2019-10-15 Thread Andrii Nakryiko
test_core_reloc_kernel test captures its own process name and validates it as part of the test. Given extra "flavors" of test_progs, this break for anything by default test_progs binary. Fix the test to cut out flavor part of the process name. Fixes: ee2eb063d330 ("selftests/bpf: Add BPF_CORE_READ

[PATCH v3 bpf-next 3/7] selftests/bpf: switch test_maps to test_progs' test.h format

2019-10-15 Thread Andrii Nakryiko
Make test_maps use tests.h header format consistent with the one used by test_progs, to facilitate unification. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/Makefile| 8 +--- tools/testing/selftests/bpf/test_maps.c | 8 2 files changed, 5 insertions(+), 11 dele

Re: lan78xx and phy_state_machine

2019-10-15 Thread Stefan Wahren
Am 15.10.19 um 21:38 schrieb Heiner Kallweit: > On 15.10.2019 00:12, Russell King - ARM Linux admin wrote: >> On Mon, Oct 14, 2019 at 10:20:15PM +0200, Heiner Kallweit wrote: >>> On 14.10.2019 21:51, Stefan Wahren wrote: [add more recipients] Am 14.10.19 um 21:25 schrieb Daniel Wagne

Re: [PATCH v2 bpf-next 5/6] selftests/bpf: replace test_progs and test_maps w/ general rule

2019-10-15 Thread Andrii Nakryiko
On Tue, Oct 15, 2019 at 10:11 PM Alexei Starovoitov wrote: > > On 10/15/19 8:29 PM, Andrii Nakryiko wrote: > > Makefile:282: warning: overriding recipe for target > > `/data/users/andriin/linux/tools/testing/selftests/bpf/test_xdp.o' > > Makefile:277: warning: ignoring old recipe for target > > `/

Re: [PATCH net] sctp: change sctp_prot .no_autobind with true

2019-10-15 Thread Xin Long
On Wed, Oct 16, 2019 at 11:39 AM David Miller wrote: > > From: Xin Long > Date: Tue, 15 Oct 2019 15:24:38 +0800 > > > syzbot reported a memory leak: > > > > BUG: memory leak, unreferenced object 0x888120b3d380 (size 64): > > backtrace: > ... > > It was caused by when sending msgs without

Re: [PATCH v2 bpf-next 5/6] selftests/bpf: replace test_progs and test_maps w/ general rule

2019-10-15 Thread Alexei Starovoitov
On 10/15/19 8:29 PM, Andrii Nakryiko wrote: > Makefile:282: warning: overriding recipe for target > `/data/users/andriin/linux/tools/testing/selftests/bpf/test_xdp.o' > Makefile:277: warning: ignoring old recipe for target > `/data/users/andriin/linux/tools/testing/selftests/bpf/test_xdp.o' I thou

Re: [PATCH] samples/bpf: make xdp_monitor use raw_tracepoints

2019-10-15 Thread Eric Sage
I'm no longer able to build the samples with 'make M=samples/bpf'. I get errors in task_fd_query_user.c like: samples/bpf/task_fd_query_user.c:153:29: error: ‘PERF_EVENT_IOC_ENABLE’ undeclared. Am I missing a dependancy?

Re: [PATCH] samples/bpf: make xdp_monitor use raw_tracepoints

2019-10-15 Thread Andrii Nakryiko
On Mon, Oct 7, 2019 at 2:00 AM Jesper Dangaard Brouer wrote: > > > On Mon, 7 Oct 2019 04:57:26 + Eric Sage wrote: > > > raw_tracepoints are an eBPF alternative to standard tracepoints which > > attach to a tracepoint without the perf layer being executed, making > > them faster. > > > > Sinc

Re: [PATCH bpf] libbpf: fix compatibility for kernels without need_wakeup

2019-10-15 Thread Alexei Starovoitov
On Mon, Oct 14, 2019 at 10:26:10AM +0200, Magnus Karlsson wrote: > On Sat, Oct 12, 2019 at 6:55 PM Alexei Starovoitov > wrote: > > > > On Fri, Oct 11, 2019 at 1:58 PM John Fastabend > > wrote: > > > > > > Magnus Karlsson wrote: > > > > On Tue, Oct 8, 2019 at 9:29 PM John Fastabend > > > > wrot

Re: [PATCH net-next] net: phylink: use more linkmode_*

2019-10-15 Thread David Miller
From: Russell King Date: Tue, 15 Oct 2019 11:28:46 +0100 > Use more linkmode_* helpers rather than open-coding the bitmap > operations. > > Signed-off-by: Russell King Applied.

Re: [PATCH net] sctp: change sctp_prot .no_autobind with true

2019-10-15 Thread David Miller
From: Xin Long Date: Tue, 15 Oct 2019 15:24:38 +0800 > syzbot reported a memory leak: > > BUG: memory leak, unreferenced object 0x888120b3d380 (size 64): > backtrace: ... > It was caused by when sending msgs without binding a port, in the path: > inet_sendmsg() -> inet_send_prepare() ->

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

2019-10-15 Thread David Miller
From: Roman Mashak Date: Mon, 14 Oct 2019 18:18:29 -0400 > Added TDC test cases for Ethernet LAYERED_OP operations: > - set single source Ethernet MAC > - set single destination Ethernet MAC > - set single invalid destination Ethernet MAC > - set Ethernet type > - invert source/destination/type f

Re: [PATCH bpf-next 5/6] selftests/bpf: replace test_progs and test_maps w/ general rule

2019-10-15 Thread Andrii Nakryiko
On Tue, Oct 15, 2019 at 4:50 PM Andrii Nakryiko wrote: > > On Tue, Oct 15, 2019 at 4:41 PM Alexei Starovoitov wrote: > > > > On 10/15/19 3:03 PM, Andrii Nakryiko wrote: > > > Define test runner generation meta-rule that codifies dependencies > > > between test runner, its tests, and its dependent

Re: [PATCH net v1] sched: etf: Fix ordering of packets with same txtime

2019-10-15 Thread David Miller
From: Vinicius Costa Gomes Date: Mon, 14 Oct 2019 13:38:22 -0700 > When a application sends many packets with the same txtime, they may > be transmitted out of order (different from the order in which they > were enqueued). > > This happens because when inserting elements into the tree, when the

[PATCH v2 bpf-next 1/6] selftests/bpf: teach test_progs to cd into subdir

2019-10-15 Thread Andrii Nakryiko
We are building a bunch of "flavors" of test_progs, e.g., w/ alu32 flag for Clang when building BPF object. test_progs setup is relying on having all the BPF object files and extra resources to be available in current working directory, though. But we actually build all these files into a separate

[PATCH v2 bpf-next 0/6] Fix, clean up, and revamp selftests/bpf Makefile

2019-10-15 Thread Andrii Nakryiko
This patch set extensively revamps selftests/bpf's Makefile to generalize test runner concept and apply it uniformly to test_maps and test_progs test runners, along with test_progs' few build "flavors", exercising various ways to build BPF programs. As we do that, we fix dependencies between vario

[PATCH v2 bpf-next 3/6] selftests/bpf: switch test_maps to test_progs' test.h format

2019-10-15 Thread Andrii Nakryiko
Make test_maps use tests.h header format consistent with the one used by test_progs, to facilitate unification. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/Makefile| 8 +--- tools/testing/selftests/bpf/test_maps.c | 8 2 files changed, 5 insertions(+), 11 dele

[PATCH v2 bpf-next 5/6] selftests/bpf: replace test_progs and test_maps w/ general rule

2019-10-15 Thread Andrii Nakryiko
Define test runner generation meta-rule that codifies dependencies between test runner, its tests, and its dependent BPF programs. Use that for defining test_progs and test_maps test-runners. Also additionally define 2 flavors of test_progs: - alu32, which builds BPF programs with 32-bit registers

[PATCH v2 bpf-next 4/6] selftests/bpf: add simple per-test targets to Makefile

2019-10-15 Thread Andrii Nakryiko
Currently it's impossible to do `make test_progs` and have only test_progs be built, because all the binary targets are defined in terms of $(OUTPUT)/, and $(OUTPUT) is absolute path to current directory (or whatever gets overridden to by user). This patch adds simple re-directing targets for all

[PATCH v2 bpf-next 6/6] selftests/bpf: move test_queue_stack_map.h into progs/ where it belongs

2019-10-15 Thread Andrii Nakryiko
test_queue_stack_map.h is used only from BPF programs. Thus it should be part of progs/ subdir. An added benefit of moving it there is that new TEST_RUNNER_DEFINE_RULES macro-rule will properly capture dependency on this header for all BPF objects and trigger re-build, if it changes. Signed-off-by

[PATCH v2 bpf-next 2/6] selftests/bpf: make CO-RE reloc test impartial to test_progs flavor

2019-10-15 Thread Andrii Nakryiko
test_core_reloc_kernel test captures its own process name and validates it as part of the test. Given extra "flavors" of test_progs, this break for anything by default test_progs binary. Fix the test to cut out flavor part of the process name. Fixes: ee2eb063d330 ("selftests/bpf: Add BPF_CORE_READ

[PATCH v3 bpf-next 11/11] selftests/bpf: add kfree_skb raw_tp test

2019-10-15 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 v3 bpf-next 00/11] bpf: revolutionize bpf tracing

2019-10-15 Thread Alexei Starovoitov
v2->v3: - while trying to adopt btf-based tracing in production service realized that disabling bpf_probe_read() was premature. The real tracing program needs to see much more than this type safe tracking can provide. With these patches the verifier will be able to see that skb->data is a p

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

2019-10-15 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 v3 bpf-next 08/11] bpf: add support for BTF pointers to interpreter

2019-10-15 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 v3 bpf-next 01/11] bpf: add typecast to raw_tracepoints to help BTF generation

2019-10-15 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

[PATCH v3 bpf-next 03/11] bpf: process in-kernel BTF

2019-10-15 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 v3 bpf-next 05/11] libbpf: auto-detect btf_id of BTF-based raw_tracepoints

2019-10-15 Thread Alexei Starovoitov
It's a responsiblity of bpf program author to annotate the program with SEC("tp_btf/name") where "name" is a valid raw tracepoint. The libbpf will try to find "name" in vmlinux BTF and error out in case vmlinux BTF is not available or "name" is not found. If "name" is indeed a valid raw tracepoint

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

2019-10-15 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 v3 bpf-next 07/11] bpf: attach raw_tp program with BTF via type name

2019-10-15 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. Add missing CHECK_ATTR() condition. Signed-off-by: Alexei Starovoitov --- There is a tiny chance that CHECK_ATTR() may break some user s

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

2019-10-15 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

[PATCH v3 bpf-next 04/11] bpf: add attach_btf_id attribute to program load

2019-10-15 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 v3 bpf-next 10/11] bpf: check types of arguments passed into helpers

2019-10-15 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

Re: [PATCH net] net: avoid potential infinite loop in tc_ctl_action()

2019-10-15 Thread David Miller
From: Eric Dumazet Date: Mon, 14 Oct 2019 11:22:30 -0700 > tc_ctl_action() has the ability to loop forever if tcf_action_add() > returns -EAGAIN. > > This special case has been done in case a module needed to be loaded, > but it turns out that tcf_add_notify() could also return -EAGAIN > if the

Re: [PATCH net-next] net_sched: sch_fq: remove one obsolete check in fq_dequeue()

2019-10-15 Thread David Miller
From: Eric Dumazet Date: Mon, 14 Oct 2019 10:40:32 -0700 > After commit eeb84aa0d0aff ("net_sched: sch_fq: do not assume EDT > packets are ordered"), all skbs get a non zero time_to_send > in flow_queue_add() > > This means @time_next_packet variable in fq_dequeue() > can no longer be zero. > >

Re: [PATCH net] rxrpc: use rcu protection while reading sk->sk_user_data

2019-10-15 Thread David Miller
From: Eric Dumazet Date: Mon, 14 Oct 2019 06:04:38 -0700 > We need to extend the rcu_read_lock() section in rxrpc_error_report() > and use rcu_dereference_sk_user_data() instead of plain access > to sk->sk_user_data to make sure all rules are respected. > > The compiler wont reload sk->sk_user_d

Re: [PATCH net] tcp: fix a possible lockdep splat in tcp_done()

2019-10-15 Thread David Miller
From: Eric Dumazet Date: Mon, 14 Oct 2019 06:47:57 -0700 > syzbot found that if __inet_inherit_port() returns an error, > we call tcp_done() after inet_csk_prepare_forced_close(), > meaning the socket lock is no longer held. > > We might fix this in a different way in net-next, but > for 5.4 it

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

2019-10-15 Thread Martin Varghese
On Tue, Oct 15, 2019 at 12:03:35AM -0700, Pravin Shelar wrote: > On Mon, Oct 14, 2019 at 9:06 AM Martin Varghese > wrote: > > > > On Sat, Oct 12, 2019 at 01:08:26PM -0700, Pravin Shelar wrote: > > > On Wed, Oct 9, 2019 at 9:31 PM Martin Varghese > > > wrote: > > > > > > > > On Wed, Oct 09, 2019 a

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

2019-10-15 Thread Alexei Starovoitov
On Mon, Oct 14, 2019 at 02:35:45PM +0200, Toke Høiland-Jørgensen wrote: > Alexei Starovoitov writes: > > > 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

Re: [PATCHv3 net-next 0/5] sctp: update from rfc7829

2019-10-15 Thread David Miller
From: Xin Long Date: Mon, 14 Oct 2019 14:14:43 +0800 > SCTP-PF was implemented based on a Internet-Draft in 2012: > > https://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05 > > It's been updated quite a few by rfc7829 in 2016. > > This patchset adds the following features: > > 1

Re: [PATCH net V4 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs

2019-10-15 Thread David Miller
From: Marek Vasut Date: Sun, 13 Oct 2019 23:24:03 +0200 > Signed-off-by: Marek Vasut > Fixes: 9d162ed69f51 ("net: phy: micrel: add support for KSZ8795") I'm sorry to be strict, but as Heiner said the Fixes: tag needs to be the first tag. I'm pushing this back to you so that you can learn how t

Re: [PATCH V2 2/2] net: dsa: microchip: Add shared regmap mutex

2019-10-15 Thread David Miller
From: Marek Vasut Date: Sun, 13 Oct 2019 21:32:38 +0200 > diff --git a/drivers/net/dsa/microchip/ksz8795_spi.c > b/drivers/net/dsa/microchip/ksz8795_spi.c > index d0f8153e86b7..614404c40cba 100644 > --- a/drivers/net/dsa/microchip/ksz8795_spi.c > +++ b/drivers/net/dsa/microchip/ksz8795_spi.c > @

Crash in in __skb_unlink during net_rx_action

2019-10-15 Thread Rajendra Dendukuri
Observed below kernel oops on "Linux version 4.9.0-9-2-amd64" from Debian 9. This was observed when bridge vlan netdevs were getting deleted while packets were being received. I observed this only once, but wanted to put it out there for the record. Below is the decoded call path. It appears to be

Re: [PATCH net v2 0/2] net/sched: fix wrong behavior of MPLS push/pop action

2019-10-15 Thread David Miller
From: Davide Caratti Date: Sat, 12 Oct 2019 13:55:05 +0200 > this series contains two fixes for TC 'act_mpls', that try to address > two problems that can be observed configuring simple 'push' / 'pop' > operations: > - patch 1/2 avoids dropping non-MPLS packets that pass through the MPLS > 'pop

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

2019-10-15 Thread Jakub Kicinski
On Mon, 14 Oct 2019 12:49:55 +0200, Lorenzo Bianconi wrote: > Implement XDP_TX verdict and ndo_xdp_xmit net_device_ops function > pointer > > Signed-off-by: Lorenzo Bianconi > @@ -1972,6 +1975,109 @@ int mvneta_rx_refill_queue(struct mvneta_port *pp, > struct mvneta_rx_queue *rxq) > retur

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

2019-10-15 Thread Jakub Kicinski
On Mon, 14 Oct 2019 12:49:54 +0200, Lorenzo Bianconi wrote: > 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 +-

Re: [PATCH bpf-next 5/6] selftests/bpf: replace test_progs and test_maps w/ general rule

2019-10-15 Thread Andrii Nakryiko
On Tue, Oct 15, 2019 at 4:41 PM Alexei Starovoitov wrote: > > On 10/15/19 3:03 PM, Andrii Nakryiko wrote: > > Define test runner generation meta-rule that codifies dependencies > > between test runner, its tests, and its dependent BPF programs. Use that > > for defining test_progs and test_maps te

Re: [PATCH bpf-next 1/2] bpf: allow __sk_buff tstamp in BPF_PROG_TEST_RUN

2019-10-15 Thread Stanislav Fomichev
On 10/15, Alexei Starovoitov wrote: > On Tue, Oct 15, 2019 at 4:15 PM Andrii Nakryiko > wrote: > > > > On Tue, Oct 15, 2019 at 2:26 PM Stanislav Fomichev wrote: > > > > > > It's useful for implementing EDT related tests (set tstamp, run the > > > test, see how the tstamp is changed or observe som

Re: [PATCH bpf-next 5/6] selftests/bpf: replace test_progs and test_maps w/ general rule

2019-10-15 Thread Alexei Starovoitov
On 10/15/19 3:03 PM, Andrii Nakryiko wrote: > Define test runner generation meta-rule that codifies dependencies > between test runner, its tests, and its dependent BPF programs. Use that > for defining test_progs and test_maps test-runners. Also additionally define > 3 flavors of test_progs: > - a

Re: [patch net-next] selftests: bpf: don't try to read files without read permission

2019-10-15 Thread Alexei Starovoitov
On Tue, Oct 15, 2019 at 8:35 AM Jakub Kicinski wrote: > > On Tue, 15 Oct 2019 12:00:56 +0200, Jiri Pirko wrote: > > From: Jiri Pirko > > > > Recently couple of files that are write only were added to netdevsim > > debugfs. Don't read these files and avoid error. > > > > Reported-by: kernel test r

Re: linux-next: manual merge of the bpf-next tree with the bpf tree

2019-10-15 Thread Stephen Rothwell
Hi all, This is now a conflict between the net and net-next trees. On Tue, 8 Oct 2019 09:48:40 +1100 Stephen Rothwell wrote: > > Today's linux-next merge of the bpf-next tree got a conflict in: > > tools/lib/bpf/Makefile > > between commit: > > 1bd63524593b ("libbpf: handle symbol versio

Re: [PATCH bpf-next 1/2] bpf: allow __sk_buff tstamp in BPF_PROG_TEST_RUN

2019-10-15 Thread Alexei Starovoitov
On Tue, Oct 15, 2019 at 4:15 PM Andrii Nakryiko wrote: > > On Tue, Oct 15, 2019 at 2:26 PM Stanislav Fomichev wrote: > > > > It's useful for implementing EDT related tests (set tstamp, run the > > test, see how the tstamp is changed or observe some other parameter). > > > > Note that bpf_ktime_ge

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

2019-10-15 Thread Jakub Kicinski
On Mon, 14 Oct 2019 12:49:52 +0200, Lorenzo Bianconi wrote: > @@ -3983,6 +4071,46 @@ static int mvneta_ioctl(struct net_device *dev, struct > ifreq *ifr, int cmd) > return phylink_mii_ioctl(pp->phylink, ifr, cmd); > } > > +static int mvneta_xdp_setup(struct net_device *dev, struct bpf_pro

Re: [PATCH bpf-next 1/2] bpf: allow __sk_buff tstamp in BPF_PROG_TEST_RUN

2019-10-15 Thread Andrii Nakryiko
On Tue, Oct 15, 2019 at 2:26 PM Stanislav Fomichev wrote: > > It's useful for implementing EDT related tests (set tstamp, run the > test, see how the tstamp is changed or observe some other parameter). > > Note that bpf_ktime_get_ns() helper is using monotonic clock, so for > the BPF programs that

Re: [PATCH v2 bpf-next 0/5] Add CO-RE support for field existence relos

2019-10-15 Thread Alexei Starovoitov
On Tue, Oct 15, 2019 at 2:26 PM Andrii Nakryiko wrote: > > This patch set generalizes libbpf's CO-RE relocation support. In addition to > existing field's byte offset relocation, libbpf now supports field existence > relocations, which are emitted by Clang when using > __builtin_preserve_field_inf

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

2019-10-15 Thread Jakub Kicinski
On Mon, 14 Oct 2019 12:49:51 +0200, Lorenzo Bianconi wrote: > 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 corruptions. Running perf analysis we can > see a performance cost associated with

Re: debug annotations for bpf progs. Was: [PATCH bpf-next 1/3] bpf: preserve command of the process that loaded the program

2019-10-15 Thread Alexei Starovoitov
On Tue, Oct 15, 2019 at 3:34 PM Andrii Nakryiko wrote: > > On Tue, Oct 15, 2019 at 3:24 PM Alexei Starovoitov > wrote: > > > > On Tue, Oct 15, 2019 at 3:14 PM Andrii Nakryiko > > wrote: > > > > > > On Tue, Oct 15, 2019 at 2:22 PM Alexei Starovoitov > > > wrote: > > > > > > > > On Fri, Oct 11, 2

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

2019-10-15 Thread Jakub Kicinski
On Mon, 14 Oct 2019 12:49:49 +0200, Lorenzo Bianconi wrote: > +static int mvneta_create_page_pool(struct mvneta_port *pp, > +struct mvneta_rx_queue *rxq, int size) > +{ > + struct page_pool_params pp_params = { > + .order = 0, > + .flags =

Re: debug annotations for bpf progs. Was: [PATCH bpf-next 1/3] bpf: preserve command of the process that loaded the program

2019-10-15 Thread Andrii Nakryiko
On Tue, Oct 15, 2019 at 3:24 PM Alexei Starovoitov wrote: > > On Tue, Oct 15, 2019 at 3:14 PM Andrii Nakryiko > wrote: > > > > On Tue, Oct 15, 2019 at 2:22 PM Alexei Starovoitov > > wrote: > > > > > > On Fri, Oct 11, 2019 at 5:38 PM Stanislav Fomichev > > > wrote: > > > > > > > > On 10/11, Ale

Re: debug annotations for bpf progs. Was: [PATCH bpf-next 1/3] bpf: preserve command of the process that loaded the program

2019-10-15 Thread Stanislav Fomichev
On 10/15, Alexei Starovoitov wrote: > On Fri, Oct 11, 2019 at 5:38 PM Stanislav Fomichev wrote: > > > > On 10/11, Alexei Starovoitov wrote: > > > On Fri, Oct 11, 2019 at 9:21 AM Stanislav Fomichev > > > wrote: > > > > > > > > Even though we have the pointer to user_struct and can recover > > > >

Re: debug annotations for bpf progs. Was: [PATCH bpf-next 1/3] bpf: preserve command of the process that loaded the program

2019-10-15 Thread Alexei Starovoitov
On Tue, Oct 15, 2019 at 3:14 PM Andrii Nakryiko wrote: > > On Tue, Oct 15, 2019 at 2:22 PM Alexei Starovoitov > wrote: > > > > On Fri, Oct 11, 2019 at 5:38 PM Stanislav Fomichev wrote: > > > > > > On 10/11, Alexei Starovoitov wrote: > > > > On Fri, Oct 11, 2019 at 9:21 AM Stanislav Fomichev >

Re: debug annotations for bpf progs. Was: [PATCH bpf-next 1/3] bpf: preserve command of the process that loaded the program

2019-10-15 Thread Andrii Nakryiko
On Tue, Oct 15, 2019 at 2:22 PM Alexei Starovoitov wrote: > > On Fri, Oct 11, 2019 at 5:38 PM Stanislav Fomichev wrote: > > > > On 10/11, Alexei Starovoitov wrote: > > > On Fri, Oct 11, 2019 at 9:21 AM Stanislav Fomichev > > > wrote: > > > > > > > > Even though we have the pointer to user_struc

Re: lan78xx and phy_state_machine

2019-10-15 Thread Russell King - ARM Linux admin
On Tue, Oct 15, 2019 at 09:38:22PM +0200, Heiner Kallweit wrote: > On 15.10.2019 00:12, Russell King - ARM Linux admin wrote: > > On Mon, Oct 14, 2019 at 10:20:15PM +0200, Heiner Kallweit wrote: > >> On 14.10.2019 21:51, Stefan Wahren wrote: > >>> [add more recipients] > >>> > >>> Am 14.10.19 um 21

[PATCH bpf-next 3/6] selftests/bpf: switch test_maps to test_progs' test.h format

2019-10-15 Thread Andrii Nakryiko
Make test_maps use tests.h header format consistent with the one used by test_progs, to facilitate unification. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/Makefile| 8 +--- tools/testing/selftests/bpf/test_maps.c | 8 2 files changed, 5 insertions(+), 11 dele

[PATCH bpf-next 0/6] Fix, clean up, and revamp selftests/bpf Makefile

2019-10-15 Thread Andrii Nakryiko
This patch set extensively revamps selftests/bpf's Makefile to generalize test runner concept and apply it uniformly to test_maps and test_progs test runners, along with test_progs' few build "flavors", exercising various ways to build BPF programs. As we do that, we fix dependencies between vario

[PATCH bpf-next 2/6] selftests/bpf: make CO-RE reloc test impartial to test_progs flavor

2019-10-15 Thread Andrii Nakryiko
test_core_reloc_kernel test captures its own process name and validates it as part of the test. Given extra "flavors" of test_progs, this break for anything by default test_progs binary. Fix the test to cut out flavor part of the process name. Fixes: ee2eb063d330 ("selftests/bpf: Add BPF_CORE_READ

[PATCH bpf-next 5/6] selftests/bpf: replace test_progs and test_maps w/ general rule

2019-10-15 Thread Andrii Nakryiko
Define test runner generation meta-rule that codifies dependencies between test runner, its tests, and its dependent BPF programs. Use that for defining test_progs and test_maps test-runners. Also additionally define 3 flavors of test_progs: - alu32, which builds BPF programs with 32-bit registers

[PATCH bpf-next 1/6] selftest/bpf: teach test_progs to cd into subdir

2019-10-15 Thread Andrii Nakryiko
We are building a bunch of "flavors" of test_progs, e.g., w/ alu32 flag for Clang when building BPF object. test_progs setup is relying on having all the BPF object files and extra resources to be available in current working directory, though. But we actually build all these files into a separate

[PATCH bpf-next 6/6] selftests/bpf: move test_queue_stack_map.h into progs/ where it belongs

2019-10-15 Thread Andrii Nakryiko
test_queue_stack_map.h is used only from BPF programs. Thus it should be part of progs/ subdir. An added benefit of moving it there is that new TEST_RUNNER_DEFINE_RULES macro-rule will properly capture dependency on this header for all BPF objects and trigger re-build, if it changes. Signed-off-by

[PATCH bpf-next 4/6] selftests/bpf: add simple per-test targets to Makefile

2019-10-15 Thread Andrii Nakryiko
Currently it's impossible to do `make test_progs` and have only test_progs be built, because all the binary targets are defined in terms of $(OUTPUT)/, and $(OUTPUT) is absolute path to current directory (or whatever gets overridden to by user). This patch adds simple re-directing targets for all

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

2019-10-15 Thread David Miller
From: Jiri Pirko Date: Sat, 12 Oct 2019 18:27:56 +0200 > From: Jiri Pirko > > Add 400Gbps bits to ethtool and introduce support in mlxsw. These modes > are supported by the Spectrum-2 switch ASIC. Series applied, thanks.

debug annotations for bpf progs. Was: [PATCH bpf-next 1/3] bpf: preserve command of the process that loaded the program

2019-10-15 Thread Alexei Starovoitov
On Fri, Oct 11, 2019 at 5:38 PM Stanislav Fomichev wrote: > > On 10/11, Alexei Starovoitov wrote: > > On Fri, Oct 11, 2019 at 9:21 AM Stanislav Fomichev wrote: > > > > > > Even though we have the pointer to user_struct and can recover > > > uid of the user who has created the program, it usually

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

2019-10-15 Thread Jakub Kicinski
On Tue, 15 Oct 2019 22:14:16 +0200, Jiri Pirko wrote: > Tue, Oct 15, 2019 at 09:07:57PM CEST, jakub.kicin...@netronome.com wrote: > >On Sat, 12 Oct 2019 18:27:56 +0200, Jiri Pirko wrote: > >> From: Jiri Pirko > >> > >> Add 400Gbps bits to ethtool and introduce support in mlxsw. These modes > >>

Re: [RFC] libbpf: Allow to emit all dependent definitions

2019-10-15 Thread Jiri Olsa
On Tue, Oct 15, 2019 at 09:22:35AM -0700, Andrii Nakryiko wrote: > On Tue, Oct 15, 2019 at 6:03 AM Jiri Olsa wrote: > > > > Currently the bpf dumper does not emit definitions > > of pointers to structs. It only emits forward type > > declarations. > > > > Having 2 structs like: > > > >struct B

Re: [PATCH bpf-next 1/2] bpf: allow __sk_buff tstamp in BPF_PROG_TEST_RUN

2019-10-15 Thread Stanislav Fomichev
On 10/15, Martin Lau wrote: > On Tue, Oct 15, 2019 at 11:31:24AM -0700, Stanislav Fomichev wrote: > > It's useful for implementing EDT related tests (set tstamp, run the > > test, see how the tstamp is changed or observe some other parameter). > > > > Note that bpf_ktime_get_ns() helper is using m

Re: [PATCH bpf-next 2/2] selftests: bpf: add selftest for __sk_buff tstamp

2019-10-15 Thread Martin Lau
On Tue, Oct 15, 2019 at 11:31:25AM -0700, Stanislav Fomichev wrote: > Make sure BPF_PROG_TEST_RUN accepts tstamp and exports any > modifications that BPF program does. Acked-by: Martin KaFai Lau

Re: [PATCH] net/mlx5: prevent memory leak in mlx5_fpga_conn_create_cq

2019-10-15 Thread Saeed Mahameed
On Fri, 2019-09-27 at 10:33 +0200, David Miller wrote: > From: Navid Emamdoost > Date: Tue, 24 Sep 2019 22:20:34 -0500 > > > In mlx5_fpga_conn_create_cq if mlx5_vector2eqn fails the allocated > > memory should be released. > > > > Signed-off-by: Navid Emamdoost > > Saeed, please queue this up.

Re: [PATCH bpf-next 1/2] bpf: allow __sk_buff tstamp in BPF_PROG_TEST_RUN

2019-10-15 Thread Martin Lau
On Tue, Oct 15, 2019 at 11:31:24AM -0700, Stanislav Fomichev wrote: > It's useful for implementing EDT related tests (set tstamp, run the > test, see how the tstamp is changed or observe some other parameter). > > Note that bpf_ktime_get_ns() helper is using monotonic clock, so for > the BPF progr

Re: [PATCH] net/mlx5: Fixed a typo in a comment in esw_del_uc_addr()

2019-10-15 Thread Saeed Mahameed
On Tue, 2019-10-08 at 08:47 +0300, Leon Romanovsky wrote: > On Mon, Oct 07, 2019 at 05:38:55PM -0700, Qing Huang wrote: > > I know this is not critical. Maybe someone can merge this or fix it > > with > > other commits? Thanks. > > It is not "linux-rdma", but netdev. Your chances will be much high

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

2019-10-15 Thread Jiri Pirko
Tue, Oct 15, 2019 at 09:07:57PM CEST, jakub.kicin...@netronome.com wrote: >On Sat, 12 Oct 2019 18:27:56 +0200, Jiri Pirko wrote: >> From: Jiri Pirko >> >> Add 400Gbps bits to ethtool and introduce support in mlxsw. These modes >> are supported by the Spectrum-2 switch ASIC. > >Thanks for the upda

Re: [PATCH v2 net 2/2] dpaa2-eth: Fix TX FQID values

2019-10-15 Thread Ioana Ciornei
On 10/15/19 10:47 PM, Andrew Lunn wrote: > On Tue, Oct 15, 2019 at 12:40:17PM -0700, Jakub Kicinski wrote: >> On Tue, 15 Oct 2019 21:29:23 +0200, Andrew Lunn wrote: diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index

Re: [PATCH net-next v3 00/10] optimize openvswitch flow looking up

2019-10-15 Thread Gregory Rose
On 10/11/2019 7:00 AM, xiangxia.m@gmail.com wrote: From: Tonghao Zhang This series patch optimize openvswitch for performance or simplify codes. Patch 1, 2, 4: Port Pravin B Shelar patches to linux upstream with little changes. Patch 5, 6, 7: Optimize the flow looking up and simplify th

Re: [PATCH v2 net 2/2] dpaa2-eth: Fix TX FQID values

2019-10-15 Thread Ioana Ciornei
On 10/15/19 10:36 PM, Jakub Kicinski wrote: > On Mon, 14 Oct 2019 12:25:17 +0300, Ioana Ciornei wrote: >> From: Ioana Radulescu >> >> Depending on when MC connects the DPNI to a MAC, Tx FQIDs may >> not be available during probe time. >> >> Read the FQIDs each time the link goes up to avoid using

Re: [PATCH v2 net 2/2] dpaa2-eth: Fix TX FQID values

2019-10-15 Thread Andrew Lunn
On Tue, Oct 15, 2019 at 12:40:17PM -0700, Jakub Kicinski wrote: > On Tue, 15 Oct 2019 21:29:23 +0200, Andrew Lunn wrote: > > > diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c > > > b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c > > > index 5acd734a216b..c3c2c06195ae 100644 > > >

  1   2   >