[PATCH] net: dsa: sja1105: Fix missing unlock on error in sk_buff()

2019-07-16 Thread Wei Yongjun
Add the missing unlock before return from function sk_buff() in the error handling case. Fixes: f3097be21bf1 ("net: dsa: sja1105: Add a state machine for RX timestamping") Signed-off-by: Wei Yongjun --- net/dsa/tag_sja1105.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/dsa/tag_sja110

Re: [PATCH bpf] bpf: fix narrower loads on s390

2019-07-16 Thread Y Song
[sorry, resend again as previous one has come text messed out due to networking issues] On Tue, Jul 16, 2019 at 10:08 PM Y Song wrote: > > On Tue, Jul 16, 2019 at 4:59 AM Ilya Leoshkevich wrote: > > > > test_pkt_md_access is failing on s390, since the associated eBPF prog > > returns TC_ACT_SHOT

Re: [PATCH bpf] bpf: fix narrower loads on s390

2019-07-16 Thread Y Song
On Tue, Jul 16, 2019 at 4:59 AM Ilya Leoshkevich wrote: > > test_pkt_md_access is failing on s390, since the associated eBPF prog > returns TC_ACT_SHOT, which in turn happens because loading a part of a > struct __sk_buff field produces an incorrect result. > > The problem is that when verifier em

Re: [PATCH net] be2net: Signal that the device cannot transmit during reconfiguration

2019-07-16 Thread Firo Yang
I think there is a problem if dev_watchdog() is triggered before netif_carrier_off(). dev_watchdog() might call ->ndo_tx_timeout(), i.e. be_tx_timeout(), if txq timeout happens. Thus be_tx_timeout() could still be able to access the memory which is being freed by be_update_queues(). Thanks, Fi

Re: [bpf PATCH v3 0/8] sockmap/tls fixes

2019-07-16 Thread Jakub Kicinski
On Mon, 15 Jul 2019 13:49:01 -0700, John Fastabend wrote: > Resolve a series of splats discovered by syzbot and an unhash > TLS issue noted by Eric Dumazet. I spent most of today poking at this set, and I'll continue tomorrow. I'm not capitulating yet, but if I can't get it to work for tls_device

Re: [bpf-next RFC 3/6] bpf: add bpf_tcp_gen_syncookie helper

2019-07-16 Thread Petar Penkov
Thank you for your feedback! On Tue, Jul 16, 2019 at 7:26 PM Alexei Starovoitov wrote: > > On Tue, Jul 16, 2019 at 09:59:26AM +0200, Eric Dumazet wrote: > > > > > > On 7/16/19 2:26 AM, Petar Penkov wrote: > > > From: Petar Penkov > > > > > > This helper function allows BPF programs to try to gen

Re: [bpf-next RFC 3/6] bpf: add bpf_tcp_gen_syncookie helper

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 09:59:26AM +0200, Eric Dumazet wrote: > > > On 7/16/19 2:26 AM, Petar Penkov wrote: > > From: Petar Penkov > > > > This helper function allows BPF programs to try to generate SYN > > cookies, given a reference to a listener socket. The function works > > from XDP and wit

Re: [PATCH bpf] selftests/bpf: fix perf_buffer on s390

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 10:42 AM Andrii Nakryiko wrote: > > On Tue, Jul 16, 2019 at 5:59 AM Ilya Leoshkevich wrote: > > > > perf_buffer test fails for exactly the same reason test_attach_probe > > used to fail: different nanosleep syscall kprobe name. > > > > Reuse the test_attach_probe fix. > >

Re: [PATCH bpf 1/2] selftests/bpf: fix test_verifier/test_maps make dependencies

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 5:22 PM Andrii Nakryiko wrote: > > Makefile becomes hairier by the day, thx for cleaning it up a bit :-) > > > > > But I also don't think we need to worry about creating them, because > > > there is always at least one test (otherwise those tests are useless > > > anyways)

Re: [RFC bpf-next 0/8] bpf: accelerate insn patching speed

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 3:12 PM Jakub Kicinski wrote: > > On Tue, 16 Jul 2019 09:17:03 -0700, Alexei Starovoitov wrote: > > I don't think we have a test for such 'dead prog only due to verifier walk' > > situation. I wonder what happens :) > > FWIW we do have verifier and BTF self tests for dead c

Re: [PATCH net v3 6/7] net/rds: Keep track of and wait for FRWR segments in use upon shutdown

2019-07-16 Thread santosh . shilimkar
On 7/16/19 3:29 PM, Gerd Rausch wrote: Since "rds_ib_free_frmr" and "rds_ib_free_frmr_list" simply put the FRMR memory segments on the "drop_list" or "free_list", and it is the job of "rds_ib_flush_mr_pool" to reap those entries by ultimately issuing a "IB_WR_LOCAL_INV" work-request, we need to t

Re: [PATCH net v3 7/7] net/rds: Initialize ic->i_fastreg_wrs upon allocation

2019-07-16 Thread santosh . shilimkar
On 7/16/19 3:29 PM, Gerd Rausch wrote: Otherwise, if an IB connection is torn down before "rds_ib_setup_qp" is called, the value of "ic->i_fastreg_wrs" is still at zero (as it wasn't initialized by "rds_ib_setup_qp"). Consequently "rds_ib_conn_path_shutdown" will spin forever, waiting for it t

Re: [PATCH net v3 5/7] net/rds: Set fr_state only to FRMR_IS_FREE if IB_WR_LOCAL_INV had been successful

2019-07-16 Thread santosh . shilimkar
On 7/16/19 3:29 PM, Gerd Rausch wrote: Fix a bug where fr_state first goes to FRMR_IS_STALE, because of a failure of operation IB_WR_LOCAL_INV, but then gets set back to "FRMR_IS_FREE" uncoditionally, even though the operation failed. Signed-off-by: Gerd Rausch --- Acked-by: Santosh Shilimk

Re: [PATCH net v3 3/7] net/rds: Wait for the FRMR_IS_FREE (or FRMR_IS_STALE) transition after posting IB_WR_LOCAL_INV

2019-07-16 Thread santosh . shilimkar
On 7/16/19 3:29 PM, Gerd Rausch wrote: In order to: 1) avoid a silly bouncing between "clean_list" and "drop_list" triggered by function "rds_ib_reg_frmr" as it is releases frmr regions whose state is not "FRMR_IS_FREE" right away. 2) prevent an invalid access error in a race from a pend

Re: [PATCH net v3 4/7] net/rds: Fix NULL/ERR_PTR inconsistency

2019-07-16 Thread santosh . shilimkar
On 7/16/19 3:29 PM, Gerd Rausch wrote: Make function "rds_ib_try_reuse_ibmr" return NULL in case memory region could not be allocated, since callers simply check if the return value is not NULL. Signed-off-by: Gerd Rausch --- Acked-by: Santosh Shilimkar

Re: [bpf-next RFC 3/6] bpf: add bpf_tcp_gen_syncookie helper

2019-07-16 Thread Petar Penkov
Thank you for the reviews! On Tue, Jul 16, 2019 at 4:56 AM Lorenz Bauer wrote: > > On Tue, 16 Jul 2019 at 08:59, Eric Dumazet wrote: > > > + return -EINVAL; > > > + > > > + if (sk->sk_protocol != IPPROTO_TCP || sk->sk_state != TCP_LISTEN) > > > + return -EINVAL; > > >

Re: [PATCH net v3 2/7] net/rds: Get rid of "wait_clean_list_grace" and add locking

2019-07-16 Thread santosh . shilimkar
On 7/16/19 3:28 PM, Gerd Rausch wrote: Waiting for activity on the "clean_list" to quiesce is no substitute for proper locking. We can have multiple threads competing for "llist_del_first" via "rds_ib_reuse_mr", and a single thread competing for "llist_del_all" and "llist_del_first" via "rds_ib_

Re: [PATCH net v3 1/7] net/rds: Give fr_state a chance to transition to FRMR_IS_FREE

2019-07-16 Thread santosh . shilimkar
On 7/16/19 3:28 PM, Gerd Rausch wrote: In the context of FRMR (ib_frmr.c): Memory regions make it onto the "clean_list" via "rds_ib_flush_mr_pool", after the memory region has been posted for invalidation via "rds_ib_post_inv". At that point in time, "fr_state" may still be in state "FRMR_IS_IN

Re: [bpf-next RFC 2/6] tcp: add skb-less helpers to retrieve SYN cookie

2019-07-16 Thread Petar Penkov
On Tue, Jul 16, 2019 at 4:35 AM Lorenz Bauer wrote: > > On Tue, 16 Jul 2019 at 01:27, Petar Penkov wrote: > > > > From: Petar Penkov > > > > This patch allows generation of a SYN cookie before an SKB has been > > allocated, as is the case at XDP. > > > > Signed-off-by: Petar Penkov > > --- > >

Re: [PATCH bpf 1/2] selftests/bpf: fix test_verifier/test_maps make dependencies

2019-07-16 Thread Andrii Nakryiko
On Tue, Jul 16, 2019 at 5:15 PM Stanislav Fomichev wrote: > > On 07/16, Andrii Nakryiko wrote: > > On Tue, Jul 16, 2019 at 3:57 PM Stanislav Fomichev wrote: > > > > > > On 07/16, Andrii Nakryiko wrote: > > > > On Tue, Jul 16, 2019 at 12:55 PM Stanislav Fomichev > > > > wrote: > > > > > > > > >

Re: [PATCH bpf 1/2] selftests/bpf: fix test_verifier/test_maps make dependencies

2019-07-16 Thread Stanislav Fomichev
On 07/16, Andrii Nakryiko wrote: > On Tue, Jul 16, 2019 at 3:57 PM Stanislav Fomichev wrote: > > > > On 07/16, Andrii Nakryiko wrote: > > > On Tue, Jul 16, 2019 at 12:55 PM Stanislav Fomichev > > > wrote: > > > > > > > > On 07/16, Andrii Nakryiko wrote: > > > > > e46fc22e60a4 ("selftests/bpf: ma

Re: OOM triggered by SCTP

2019-07-16 Thread malc
On Tue, Jul 16, 2019 at 10:49 PM Marek Majkowski wrote: > > Morning, > > My poor man's fuzzer found something interesting in SCTP. It seems > like creating large number of SCTP sockets + some magic dance, upsets > a memory subsystem related to SCTP. The sequence: > > - create SCTP socket > - cal

Re: [PATCH bpf 1/2] selftests/bpf: fix test_verifier/test_maps make dependencies

2019-07-16 Thread Andrii Nakryiko
On Tue, Jul 16, 2019 at 3:57 PM Stanislav Fomichev wrote: > > On 07/16, Andrii Nakryiko wrote: > > On Tue, Jul 16, 2019 at 12:55 PM Stanislav Fomichev > > wrote: > > > > > > On 07/16, Andrii Nakryiko wrote: > > > > e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only") > > > > e

Re: OOM triggered by SCTP

2019-07-16 Thread Neil Horman
On Tue, Jul 16, 2019 at 11:47:40PM +0200, Marek Majkowski wrote: > Morning, > > My poor man's fuzzer found something interesting in SCTP. It seems > like creating large number of SCTP sockets + some magic dance, upsets > a memory subsystem related to SCTP. The sequence: > > - create SCTP socket

Re: [PATCH bpf 1/2] selftests/bpf: fix test_verifier/test_maps make dependencies

2019-07-16 Thread Stanislav Fomichev
On 07/16, Andrii Nakryiko wrote: > On Tue, Jul 16, 2019 at 12:55 PM Stanislav Fomichev wrote: > > > > On 07/16, Andrii Nakryiko wrote: > > > e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only") > > > exposed existing problem in Makefile for test_verifier and test_maps > > > tes

[PATCH net v3 5/7] net/rds: Set fr_state only to FRMR_IS_FREE if IB_WR_LOCAL_INV had been successful

2019-07-16 Thread Gerd Rausch
Fix a bug where fr_state first goes to FRMR_IS_STALE, because of a failure of operation IB_WR_LOCAL_INV, but then gets set back to "FRMR_IS_FREE" uncoditionally, even though the operation failed. Signed-off-by: Gerd Rausch --- net/rds/ib_frmr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletio

[PATCH net v3 6/7] net/rds: Keep track of and wait for FRWR segments in use upon shutdown

2019-07-16 Thread Gerd Rausch
Since "rds_ib_free_frmr" and "rds_ib_free_frmr_list" simply put the FRMR memory segments on the "drop_list" or "free_list", and it is the job of "rds_ib_flush_mr_pool" to reap those entries by ultimately issuing a "IB_WR_LOCAL_INV" work-request, we need to trigger and then wait for all those memory

[PATCH net v3 7/7] net/rds: Initialize ic->i_fastreg_wrs upon allocation

2019-07-16 Thread Gerd Rausch
Otherwise, if an IB connection is torn down before "rds_ib_setup_qp" is called, the value of "ic->i_fastreg_wrs" is still at zero (as it wasn't initialized by "rds_ib_setup_qp"). Consequently "rds_ib_conn_path_shutdown" will spin forever, waiting for it to go back to "RDS_IB_DEFAULT_FR_WR", which o

[PATCH net v3 1/7] net/rds: Give fr_state a chance to transition to FRMR_IS_FREE

2019-07-16 Thread Gerd Rausch
In the context of FRMR (ib_frmr.c): Memory regions make it onto the "clean_list" via "rds_ib_flush_mr_pool", after the memory region has been posted for invalidation via "rds_ib_post_inv". At that point in time, "fr_state" may still be in state "FRMR_IS_INUSE", since the only place where "fr_stat

[PATCH net v3 4/7] net/rds: Fix NULL/ERR_PTR inconsistency

2019-07-16 Thread Gerd Rausch
Make function "rds_ib_try_reuse_ibmr" return NULL in case memory region could not be allocated, since callers simply check if the return value is not NULL. Signed-off-by: Gerd Rausch --- net/rds/ib_rdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rds/ib_rdma.c b

[PATCH net v3 3/7] net/rds: Wait for the FRMR_IS_FREE (or FRMR_IS_STALE) transition after posting IB_WR_LOCAL_INV

2019-07-16 Thread Gerd Rausch
In order to: 1) avoid a silly bouncing between "clean_list" and "drop_list" triggered by function "rds_ib_reg_frmr" as it is releases frmr regions whose state is not "FRMR_IS_FREE" right away. 2) prevent an invalid access error in a race from a pending "IB_WR_LOCAL_INV" operation with a t

[PATCH net v3 0/7] net/rds: RDMA fixes

2019-07-16 Thread Gerd Rausch
A number of net/rds fixes necessary to make "rds_rdma.ko" pass some basic Oracle internal tests. Gerd Rausch (7): net/rds: Give fr_state a chance to transition to FRMR_IS_FREE net/rds: Get rid of "wait_clean_list_grace" and add locking net/rds: Wait for the FRMR_IS_FREE (or FRMR_IS_STALE) tr

[PATCH net v3 2/7] net/rds: Get rid of "wait_clean_list_grace" and add locking

2019-07-16 Thread Gerd Rausch
Waiting for activity on the "clean_list" to quiesce is no substitute for proper locking. We can have multiple threads competing for "llist_del_first" via "rds_ib_reuse_mr", and a single thread competing for "llist_del_all" and "llist_del_first" via "rds_ib_flush_mr_pool". Since "llist_del_first"

[PATCH net] bonding: Force slave speed check after link state recovery for 802.3ad

2019-07-16 Thread Thomas Falcon
The following scenario was encountered during testing of logical partition mobility on pseries partitions with bonded ibmvnic adapters in LACP mode. 1. Driver receives a signal that the device has been swapped, and it needs to reset to initialize the new device. 2. Driver reports loss of ca

Re: [RFC bpf-next 0/8] bpf: accelerate insn patching speed

2019-07-16 Thread Jakub Kicinski
On Tue, 16 Jul 2019 09:17:03 -0700, Alexei Starovoitov wrote: > I don't think we have a test for such 'dead prog only due to verifier walk' > situation. I wonder what happens :) FWIW we do have verifier and BTF self tests for dead code removal of entire subprogs! :)

OOM triggered by SCTP

2019-07-16 Thread Marek Majkowski
Morning, My poor man's fuzzer found something interesting in SCTP. It seems like creating large number of SCTP sockets + some magic dance, upsets a memory subsystem related to SCTP. The sequence: - create SCTP socket - call setsockopts (SCTP_EVENTS) - call bind(::1, port) - call sendmsg(long

Re: [Patch net v2 2/2] selftests: add a test case for rp filter

2019-07-16 Thread Cong Wang
On Tue, Jul 16, 2019 at 1:58 PM Cong Wang wrote: > > Add a test case to simulate the loopback packet case fixed > in the previous patch. Well, I actually have to create a dummy1 to simulate it, as dummy0 is the gateway interface assigned to an IP address. I will send v3. Thanks.

Re: [PATCH bpf 1/2] selftests/bpf: fix test_verifier/test_maps make dependencies

2019-07-16 Thread Andrii Nakryiko
On Tue, Jul 16, 2019 at 12:55 PM Stanislav Fomichev wrote: > > On 07/16, Andrii Nakryiko wrote: > > e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only") > > exposed existing problem in Makefile for test_verifier and test_maps tests: > > their dependency on auto-generated header

Re: [PATCH net-next v1] fix: taprio: Change type of txtime-delay parameter to u32

2019-07-16 Thread David Miller
From: Vedang Patel Date: Tue, 16 Jul 2019 12:52:18 -0700 > During the review of the iproute2 patches for txtime-assist mode, it was > pointed out that it does not make sense for the txtime-delay parameter to > be negative. So, change the type of the parameter from s32 to u32. > > Fixes: 4cfd5779

[Patch net v2 2/2] selftests: add a test case for rp filter

2019-07-16 Thread Cong Wang
Add a test case to simulate the loopback packet case fixed in the previous patch. This test gets passed after the fix: IPv4 rp_filter tests TEST: rp_filter passes local packets[ OK ] TEST: rp_filter passes loopback packets [ OK ]

[Patch net v2 1/2] fib: relax source validation check for loopback packets

2019-07-16 Thread Cong Wang
In a rare case where we redirect local packets from veth to lo, these packets fail to pass the source validation when rp_filter is turned on, as the tracing shows: <...>-311708 [040] ..s1 7951180.957825: fib_table_lookup: table 254 oif 0 iif 1 src 10.53.180.130 dst 10.53.180.130 tos 0 scope 0 f

[Patch net v2] net_sched: unset TCQ_F_CAN_BYPASS when adding filters

2019-07-16 Thread Cong Wang
For qdisc's that support TC filters and set TCQ_F_CAN_BYPASS, notably fq_codel, it makes no sense to let packets bypass the TC filters we setup in any scenario, otherwise our packets steering policy could not be enforced. This can be reproduced easily with the following script: ip li add dev dum

Re: [PATCH net-next v1] fix: taprio: Change type of txtime-delay parameter to u32

2019-07-16 Thread Patel, Vedang
I request that this patch should also be considered for the net tree since it fixes the data type of of the txtime_delay parameter and should go in with the iproute2 patches which implement support for txtime-assist mode. Thanks, Vedang Patel > On Jul 16, 2019, at 12:52 PM, Patel, Vedang wrot

Re: [PATCH bpf 1/2] selftests/bpf: fix test_verifier/test_maps make dependencies

2019-07-16 Thread Stanislav Fomichev
On 07/16, Andrii Nakryiko wrote: > e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only") > exposed existing problem in Makefile for test_verifier and test_maps tests: > their dependency on auto-generated header file with a list of all tests wasn't > recorded explicitly. This patch

[PATCH iproute2 net-next v4 3/6] taprio: Add support for setting flags

2019-07-16 Thread Vedang Patel
From: Vinicius Costa Gomes This allows a new parameter, flags, to be passed to taprio. Currently, it only supports enabling the txtime-assist mode. But, we plan to add different modes for taprio (e.g. hardware offloading) and this parameter will be useful in enabling those modes. Signed-off-by:

[PATCH iproute2 net-next v4 6/6] tc: taprio: Update documentation

2019-07-16 Thread Vedang Patel
Add documentation for the latest options, flags and txtime-delay, to the taprio manpage. This also adds an example to run tc in txtime offload mode. Signed-off-by: Vedang Patel --- man/man8/tc-taprio.8 | 40 1 file changed, 40 insertions(+) diff --git a

[PATCH iproute2 net-next v4 2/6] etf: Add skip_sock_check

2019-07-16 Thread Vedang Patel
ETF Qdisc currently checks for a socket with SO_TXTIME socket option. If either is not present, the packet is dropped. In the future commits, we want other Qdiscs to add packet with launchtime to the ETF Qdisc. Also, there are some packets (e.g. ICMP packets) which may not have a socket associated

[PATCH iproute2 net-next v4 1/6] Update kernel headers

2019-07-16 Thread Vedang Patel
The type for txtime-delay parameter will change from s32 to u32. So, make the corresponding change in the ABI file as well. Signed-off-by: Vedang Patel --- include/uapi/linux/pkt_sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/pkt_sched.h b/include/

[PATCH iproute2 net-next v4 5/6] tc: etf: Add documentation for skip-skb-check.

2019-07-16 Thread Vedang Patel
Document the newly added option (skip-skb-check) on the etf man-page. Signed-off-by: Vedang Patel --- man/man8/tc-etf.8 | 10 ++ 1 file changed, 10 insertions(+) diff --git a/man/man8/tc-etf.8 b/man/man8/tc-etf.8 index 30a12de7d2c7..2e01a591dbaa 100644 --- a/man/man8/tc-etf.8 +++ b/man/

[PATCH net-next v1] fix: taprio: Change type of txtime-delay parameter to u32

2019-07-16 Thread Vedang Patel
During the review of the iproute2 patches for txtime-assist mode, it was pointed out that it does not make sense for the txtime-delay parameter to be negative. So, change the type of the parameter from s32 to u32. Fixes: 4cfd5779bd6e ("taprio: Add support for txtime-assist mode") Reported-by: Step

[PATCH iproute2 net-next v4 4/6] taprio: add support for setting txtime_delay.

2019-07-16 Thread Vedang Patel
This adds support for setting the txtime_delay parameter which is useful for the txtime offload mode of taprio. Signed-off-by: Vedang Patel --- tc/q_taprio.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tc/q_taprio.c b/tc/q_taprio.c index 1db2aba6e

Re: [PATCH net] be2net: Signal that the device cannot transmit during reconfiguration

2019-07-16 Thread David Miller
From: Benjamin Poirier Date: Tue, 16 Jul 2019 17:16:55 +0900 > While changing the number of interrupt channels, be2net stops adapter > operation (including netif_tx_disable()) but it doesn't signal that it > cannot transmit. This may lead dev_watchdog() to falsely trigger during > that time. > >

Re: [PATCH bpf] selftests/bpf: make directory prerequisites order-only

2019-07-16 Thread Andrii Nakryiko
On Tue, Jul 16, 2019 at 10:49 AM Alexei Starovoitov wrote: > > On Mon, Jul 15, 2019 at 3:22 PM Daniel Borkmann wrote: > > > > On 7/12/19 3:56 PM, Ilya Leoshkevich wrote: > > > When directories are used as prerequisites in Makefiles, they can cause > > > a lot of unnecessary rebuilds, because a di

Re: [RFC bpf-next 0/8] bpf: accelerate insn patching speed

2019-07-16 Thread Jiong Wang
Alexei Starovoitov writes: > On Tue, Jul 16, 2019 at 09:50:25AM +0100, Jiong Wang wrote: >> >> Let me digest a little bit and do some coding, then I will come back. Some >> issues can only shown up during in-depth coding. I kind of feel handling >> aux reference in verifier layer is the part th

[PATCH bpf 2/2] selftests/bpf: structure test_{progs,maps,verifier} test runners uniformly

2019-07-16 Thread Andrii Nakryiko
It's easier to follow the logic if it's structured the same. There is just slight difference between test_progs/test_maps and test_verifier. test_verifier's verifier/*.c files are not really compilable C files (they are more of include headers), so they can't be specified as explicit dependencies o

[PATCH bpf 1/2] selftests/bpf: fix test_verifier/test_maps make dependencies

2019-07-16 Thread Andrii Nakryiko
e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only") exposed existing problem in Makefile for test_verifier and test_maps tests: their dependency on auto-generated header file with a list of all tests wasn't recorded explicitly. This patch fixes these issues. Fixes: 51a0e301a563

Re: [PATCH ghak90 V6 02/10] audit: add container id

2019-07-16 Thread Richard Guy Briggs
On 2019-07-15 16:38, Paul Moore wrote: > On Mon, Jul 8, 2019 at 1:51 PM Richard Guy Briggs wrote: > > On 2019-05-29 11:29, Paul Moore wrote: > > ... > > > > The idea is that only container orchestrators should be able to > > > set/modify the audit container ID, and since setting the audit > > >

Re: [PATCH] net: ethernet: ti: cpsw: Add of_node_put() before return and break

2019-07-16 Thread David Miller
From: Nishka Dasgupta Date: Tue, 16 Jul 2019 11:18:43 +0530 > Each iteration of for_each_available_child_of_node puts the previous > node, but in the case of a return or break from the middle of the loop, > there is no put, thus causing a memory leak. What an incredible terribly designed loop ma

Re: [PATCH iproute2 0/2] Fix IPv6 tunnel add when dev param is used

2019-07-16 Thread Stephen Hemminger
On Tue, 9 Jul 2019 15:16:49 +0200 Andrea Claudi wrote: > Commit ba126dcad20e6 ("ip6tunnel: fix 'ip -6 {show|change} dev > ' cmds") breaks IPv6 tunnel creation when dev parameter > is used. > > This series revert the original commit, which mistakenly use > dev for tunnel name, while addressing a

Re: [PATCH net v2] skbuff: fix compilation warnings in skb_dump()

2019-07-16 Thread Willem de Bruijn
On Tue, Jul 16, 2019 at 6:53 PM Nathan Chancellor wrote: > > On Tue, Jul 16, 2019 at 11:43:05AM -0400, Qian Cai wrote: > > The commit 6413139dfc64 ("skbuff: increase verbosity when dumping skb > > data") introduced a few compilation warnings. > > > > net/core/skbuff.c:766:32: warning: format speci

Re: [PATCH iproute2-rc 2/8] rdma: Add "stat qp show" support

2019-07-16 Thread Stephen Hemminger
On Wed, 10 Jul 2019 10:24:49 +0300 Leon Romanovsky wrote: > From: Mark Zhang > > This patch presents link, id, task name, lqpn, as well as all sub > counters of a QP counter. > A QP counter is a dynamically allocated statistic counter that is > bound with one or more QPs. It has several sub-cou

Re: [PATCH 2/2] net: apply proc_net_mkdir() harder

2019-07-16 Thread Pablo Neira Ayuso
On Sat, Jul 06, 2019 at 07:55:21PM +0300, Alexey Dobriyan wrote: > From: "Hallsmark, Per" > > proc_net_mkdir() should be used to create stuff under /proc/net, > so that dentry revalidation kicks in. > > See > > commit 1fde6f21d90f8ba5da3cb9c54ca991ed72696c43 > proc: fix /proc/net/*

Re: [RFC bpf-next 0/8] bpf: accelerate insn patching speed

2019-07-16 Thread Andrii Nakryiko
On Tue, Jul 16, 2019 at 1:50 AM Jiong Wang wrote: > > > Andrii Nakryiko writes: > > > On Mon, Jul 15, 2019 at 2:21 AM Jiong Wang wrote: > >> > >> > >> Andrii Nakryiko writes: > >> > >> > On Thu, Jul 11, 2019 at 4:22 AM Jiong Wang > >> > wrote: > >> >> > >> >> > >> >> Andrii Nakryiko writes: > >

Re: [PATCH bpf] selftests/bpf: make directory prerequisites order-only

2019-07-16 Thread Alexei Starovoitov
On Mon, Jul 15, 2019 at 3:22 PM Daniel Borkmann wrote: > > On 7/12/19 3:56 PM, Ilya Leoshkevich wrote: > > When directories are used as prerequisites in Makefiles, they can cause > > a lot of unnecessary rebuilds, because a directory is considered changed > > whenever a file in this directory is a

Re: [PATCH bpf] selftests/bpf: fix perf_buffer on s390

2019-07-16 Thread Andrii Nakryiko
On Tue, Jul 16, 2019 at 5:59 AM Ilya Leoshkevich wrote: > > perf_buffer test fails for exactly the same reason test_attach_probe > used to fail: different nanosleep syscall kprobe name. > > Reuse the test_attach_probe fix. > > Fixes: ee5cf82ce04a ("selftests/bpf: test perf buffer API") > Signed-of

Re: [PATCH bpf] libbpf: fix another GCC8 warning for strncpy

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 10:31 AM Magnus Karlsson wrote: > > On Tue, Jul 16, 2019 at 5:59 AM Andrii Nakryiko wrote: > > > > Similar issue was fixed in cdfc7f888c2a ("libbpf: fix GCC8 warning for > > strncpy") already. This one was missed. Fixing now. > > Thanks Andrii. > > Acked-by: Magnus Karlsso

Re: [PATCH bpf] bpf: net: Set sk_bpf_storage back to NULL for cloned sk

2019-07-16 Thread Stanislav Fomichev
On 07/16, Martin Lau wrote: > On Tue, Jul 09, 2019 at 09:33:21AM -0700, Stanislav Fomichev wrote: > > On 06/11, Martin KaFai Lau wrote: > > > The cloned sk should not carry its parent-listener's sk_bpf_storage. > > > This patch fixes it by setting it back to NULL. > > Have you thought about some ki

Re: [PATCH bpf] libbpf: fix another GCC8 warning for strncpy

2019-07-16 Thread Magnus Karlsson
On Tue, Jul 16, 2019 at 5:59 AM Andrii Nakryiko wrote: > > Similar issue was fixed in cdfc7f888c2a ("libbpf: fix GCC8 warning for > strncpy") already. This one was missed. Fixing now. Thanks Andrii. Acked-by: Magnus Karlsson > Cc: Magnus Karlsson > Signed-off-by: Andrii Nakryiko > --- > too

Re: IPv6 L2TP issues related to 93531c67

2019-07-16 Thread David Ahern
On 7/16/19 7:56 AM, Paul Donohue wrote: > After establishing an IPsec tunnel to carry the L2TP traffic, the first L2TP > packet through the IPsec tunnel permanently breaks the associated L2TP > tunnel. Tearing down the IPsec tunnel does not restore functionality of the > L2TP tunnel - I have to

Re: [PATCH bpf v2] selftests/bpf: skip nmi test when perf hw events are disabled

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 07:57:04AM -0700, Andrii Nakryiko wrote: > On Tue, Jul 16, 2019 at 3:56 AM Ilya Leoshkevich wrote: > > > > Some setups (e.g. virtual machines) might run with hardware perf events > > disabled. If this is the case, skip the test_send_signal_nmi test. > > > > Add a separate t

Re: [PATCH bpf v3] selftests/bpf: fix "alu with different scalars 1" on s390

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 12:53:53PM +0200, Ilya Leoshkevich wrote: > BPF_LDX_MEM is used to load the least significant byte of the retrieved > test_val.index, however, on big-endian machines it ends up retrieving > the most significant byte. > > Change the test to load the whole int in order to mak

Re: [RFC bpf-next 0/8] bpf: accelerate insn patching speed

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 09:50:25AM +0100, Jiong Wang wrote: > > Let me digest a little bit and do some coding, then I will come back. Some > issues can only shown up during in-depth coding. I kind of feel handling > aux reference in verifier layer is the part that will still introduce some > un-cl

Re: [PATCH net] net: fix use-after-free in __netif_receive_skb_core

2019-07-16 Thread Sabrina Dubroca
2019-07-12, 16:29:48 +0100, Edward Cree wrote: > On 10/07/2019 23:47, Sabrina Dubroca wrote: > > 2019-07-10, 16:07:43 +0100, Edward Cree wrote: > >> On 10/07/2019 14:52, Sabrina Dubroca wrote: > >>> -static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc, > >>> +static int __netif

RE: [PATCH net 2/4] tcp: tcp_fragment() should apply sane memory limits

2019-07-16 Thread Prout, Andrew - LLSC - MITLL
On 7/11/2019 11:15 PM, Prout, Andrew - LLSC - MITLL wrote: > I in no way intended to imply that I had confirmed the small SO_SNDBUF was a > prerequisite to our problem. With my synthetic test, I was looking for a > concise reproducer and trying things to > stress the system. I've looked into th

Re: [PATCH bpf v2] selftests/bpf: skip nmi test when perf hw events are disabled

2019-07-16 Thread Andrii Nakryiko
On Tue, Jul 16, 2019 at 3:56 AM Ilya Leoshkevich wrote: > > Some setups (e.g. virtual machines) might run with hardware perf events > disabled. If this is the case, skip the test_send_signal_nmi test. > > Add a separate test involving a software perf event. This allows testing > the perf event pat

Re: IPv6 L2TP issues related to 93531c67

2019-07-16 Thread Paul Donohue
On Mon, Jul 15, 2019 at 12:55:48PM -0600, David Ahern wrote: > As an FYI, gmail thinks your emails are spam. Ugh. Thanks for letting me know. I'll look into it. > On 7/15/19 10:18 AM, Paul Donohue wrote: > > Reverting commit 93531c6743157d7e8c5792f8ed1a57641149d62c (identified by > > bisection)

[PATCH bpf] selftests/bpf: fix perf_buffer on s390

2019-07-16 Thread Ilya Leoshkevich
perf_buffer test fails for exactly the same reason test_attach_probe used to fail: different nanosleep syscall kprobe name. Reuse the test_attach_probe fix. Fixes: ee5cf82ce04a ("selftests/bpf: test perf buffer API") Signed-off-by: Ilya Leoshkevich --- .../testing/selftests/bpf/prog_tests/attac

Re: [PATCH net-next] net: openvswitch: do not update max_headroom if new headroom is equal to old headroom

2019-07-16 Thread Taehee Yoo
On Tue, 16 Jul 2019 at 03:15, Pravin Shelar wrote: > Hi Pravin, > On Fri, Jul 5, 2019 at 9:08 AM Taehee Yoo wrote: > > > > When a vport is deleted, the maximum headroom size would be changed. > > If the vport which has the largest headroom is deleted, > > the new max_headroom would be set. > >

Re: [PATCH iproute2-rc 8/8] rdma: Document counter statistic

2019-07-16 Thread Leon Romanovsky
On Tue, Jul 16, 2019 at 11:19:26AM +0300, Gal Pressman wrote: > On 10/07/2019 10:24, Leon Romanovsky wrote: > > +.SH "EXAMPLES" > > +.PP > > +rdma statistic show > > +.RS 4 > > +Shows the state of the default counter of all RDMA devices on the system. > > +.RE > > +.PP > > +rdma statistic show link

[PATCH bpf] bpf: fix narrower loads on s390

2019-07-16 Thread Ilya Leoshkevich
test_pkt_md_access is failing on s390, since the associated eBPF prog returns TC_ACT_SHOT, which in turn happens because loading a part of a struct __sk_buff field produces an incorrect result. The problem is that when verifier emits the code to replace partial load of a field with a full load, a

Re: [bpf-next RFC 3/6] bpf: add bpf_tcp_gen_syncookie helper

2019-07-16 Thread Lorenz Bauer
On Tue, 16 Jul 2019 at 08:59, Eric Dumazet wrote: > > + return -EINVAL; > > + > > + if (sk->sk_protocol != IPPROTO_TCP || sk->sk_state != TCP_LISTEN) > > + return -EINVAL; > > + > > + if (!sock_net(sk)->ipv4.sysctl_tcp_syncookies) > > + return -EINVAL; >

Re: [bpf-next RFC 3/6] bpf: add bpf_tcp_gen_syncookie helper

2019-07-16 Thread Lorenz Bauer
On Tue, 16 Jul 2019 at 01:27, Petar Penkov wrote: > > From: Petar Penkov > > This helper function allows BPF programs to try to generate SYN > cookies, given a reference to a listener socket. The function works > from XDP and with an skb context since bpf_skc_lookup_tcp can lookup a > socket in b

Re: [bpf-next RFC 2/6] tcp: add skb-less helpers to retrieve SYN cookie

2019-07-16 Thread Lorenz Bauer
On Tue, 16 Jul 2019 at 01:27, Petar Penkov wrote: > > From: Petar Penkov > > This patch allows generation of a SYN cookie before an SKB has been > allocated, as is the case at XDP. > > Signed-off-by: Petar Penkov > --- > include/net/tcp.h| 11 ++ > net/ipv4/tcp_input.c | 79

[PATCH v2 06/10] libbpf: add flags to umem config

2019-07-16 Thread Kevin Laatz
This patch adds a 'flags' field to the umem_config and umem_reg structs. This will allow for more options to be added for configuring umems. The first use for the flags field is to add a flag for unaligned chunks mode. These flags can either be user-provided or filled with a default. Signed-off-b

[PATCH v2 07/10] samples/bpf: add unaligned chunks mode support to xdpsock

2019-07-16 Thread Kevin Laatz
This patch adds support for the unaligned chunks mode. The addition of the unaligned chunks option will allow users to run the application with more relaxed chunk placement in the XDP umem. Unaligned chunks mode can be used with the '-u' or '--unaligned' command line options. Signed-off-by: Kevin

[PATCH v2 05/10] ixgbe: modify driver for handling offsets

2019-07-16 Thread Kevin Laatz
With the addition of the unaligned chunks option, we need to make sure we handle the offsets accordingly based on the mode we are currently running in. This patch modifies the driver to appropriately mask the address for each case. Signed-off-by: Kevin Laatz --- drivers/net/ethernet/intel/ixgbe/

[PATCH v2 08/10] samples/bpf: add buffer recycling for unaligned chunks to xdpsock

2019-07-16 Thread Kevin Laatz
This patch adds buffer recycling support for unaligned buffers. Since we don't mask the addr to 2k at umem_reg in unaligned mode, we need to make sure we give back the correct (original) addr to the fill queue. We achieve this using the new descriptor format and associated masks. The new format use

[PATCH v2 10/10] doc/af_xdp: include unaligned chunk case

2019-07-16 Thread Kevin Laatz
The addition of unaligned chunks mode, the documentation needs to be updated to indicate that the incoming addr to the fill ring will only be masked if the user application is run in the aligned chunk mode. This patch also adds a line to explicitly indicate that the incoming addr will not be masked

[PATCH v2 09/10] samples/bpf: use hugepages in xdpsock app

2019-07-16 Thread Kevin Laatz
This patch modifies xdpsock to use mmap instead of posix_memalign. With this change, we can use hugepages when running the application in unaligned chunks mode. Using hugepages makes it more likely that we have physically contiguous memory, which supports the unaligned chunk mode better. Signed-of

[PATCH v2 03/10] xsk: add support to allow unaligned chunk placement

2019-07-16 Thread Kevin Laatz
Currently, addresses are chunk size aligned. This means, we are very restricted in terms of where we can place chunk within the umem. For example, if we have a chunk size of 2k, then our chunks can only be placed at 0,2k,4k,6k,8k... and so on (ie. every 2k starting from 0). This patch introduces t

[PATCH v2 04/10] i40e: modify driver for handling offsets

2019-07-16 Thread Kevin Laatz
With the addition of the unaligned chunks option, we need to make sure we handle the offsets accordingly based on the mode we are currently running in. This patch modifies the driver to appropriately mask the address for each case. Signed-off-by: Bruce Richardson Signed-off-by: Kevin Laatz ---

[PATCH v2 01/10] i40e: simplify Rx buffer recycle

2019-07-16 Thread Kevin Laatz
Currently, the dma, addr and handle are modified when we reuse Rx buffers in zero-copy mode. However, this is not required as the inputs to the function are copies, not the original values themselves. As we use the copies within the function, we can use the original 'old_bi' values directly without

[PATCH v2 02/10] ixgbe: simplify Rx buffer recycle

2019-07-16 Thread Kevin Laatz
Currently, the dma, addr and handle are modified when we reuse Rx buffers in zero-copy mode. However, this is not required as the inputs to the function are copies, not the original values themselves. As we use the copies within the function, we can use the original 'obi' values directly without ha

[PATCH v2 00/10] XDP unaligned chunk placement support

2019-07-16 Thread Kevin Laatz
This patch set adds the ability to use unaligned chunks in the XDP umem. Currently, all chunk addresses passed to the umem are masked to be chunk size aligned (default is 2k, max is PAGE_SIZE). This limits where we can place chunks within the umem as well as limiting the packet sizes that are supp

[PATCH bpf v2] selftests/bpf: skip nmi test when perf hw events are disabled

2019-07-16 Thread Ilya Leoshkevich
Some setups (e.g. virtual machines) might run with hardware perf events disabled. If this is the case, skip the test_send_signal_nmi test. Add a separate test involving a software perf event. This allows testing the perf event path regardless of hardware perf event support. Signed-off-by: Ilya Le

[PATCH bpf v3] selftests/bpf: fix "alu with different scalars 1" on s390

2019-07-16 Thread Ilya Leoshkevich
BPF_LDX_MEM is used to load the least significant byte of the retrieved test_val.index, however, on big-endian machines it ends up retrieving the most significant byte. Change the test to load the whole int in order to make it endianness-independent. Signed-off-by: Ilya Leoshkevich --- v1->v2:

Re: [RFC] virtio-net: share receive_*() and add_recvbuf_*() with virtio-vsock

2019-07-16 Thread Stefano Garzarella
On Tue, Jul 16, 2019 at 06:01:33AM -0400, Michael S. Tsirkin wrote: > On Tue, Jul 16, 2019 at 11:40:24AM +0200, Stefano Garzarella wrote: > > On Mon, Jul 15, 2019 at 01:50:28PM -0400, Michael S. Tsirkin wrote: > > > On Mon, Jul 15, 2019 at 09:44:16AM +0200, Stefano Garzarella wrote: > > > > On Fri,

Re: [RFC] virtio-net: share receive_*() and add_recvbuf_*() with virtio-vsock

2019-07-16 Thread Michael S. Tsirkin
On Tue, Jul 16, 2019 at 11:40:24AM +0200, Stefano Garzarella wrote: > On Mon, Jul 15, 2019 at 01:50:28PM -0400, Michael S. Tsirkin wrote: > > On Mon, Jul 15, 2019 at 09:44:16AM +0200, Stefano Garzarella wrote: > > > On Fri, Jul 12, 2019 at 06:14:39PM +0800, Jason Wang wrote: > > [...] > > > > >

Re: [RFC] virtio-net: share receive_*() and add_recvbuf_*() with virtio-vsock

2019-07-16 Thread Stefano Garzarella
On Mon, Jul 15, 2019 at 01:50:28PM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 15, 2019 at 09:44:16AM +0200, Stefano Garzarella wrote: > > On Fri, Jul 12, 2019 at 06:14:39PM +0800, Jason Wang wrote: [...] > > > > > > > > > I think it's just a branch, for ethernet, go for networking stack. >

Re: [RFC bpf-next 0/8] bpf: accelerate insn patching speed

2019-07-16 Thread Jiong Wang
Andrii Nakryiko writes: > On Mon, Jul 15, 2019 at 2:21 AM Jiong Wang wrote: >> >> >> Andrii Nakryiko writes: >> >> > On Thu, Jul 11, 2019 at 4:22 AM Jiong Wang >> > wrote: >> >> >> >> >> >> Andrii Nakryiko writes: >> >> >> >> > On Thu, Jul 4, 2019 at 2:31 PM Jiong Wang >> >> > wrote: >> >>

  1   2   >