RE: [syzbot] WARNING: refcount bug in sk_psock_get

2021-04-09 Thread John Fastabend
syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:9c54130c Add linux-next specific files for 20210406 > git tree: linux-next > console output: https://syzkaller.appspot.com/x/log.txt?x=17d8d7aad0 > kernel config: https://syzkaller.appspot.com/x/.config

Re: [Patch bpf-next] sock_map: fix a potential use-after-free in sock_map_close()

2021-04-09 Thread John Fastabend
Cong Wang wrote: > On Thu, Apr 8, 2021 at 5:26 PM John Fastabend > wrote: > > > > Cong Wang wrote: > > > From: Cong Wang > > > > > > The last refcnt of the psock can be gone right after > > > sock_map_remove_links(), so sk_psock_sto

RE: [PATCH v8 bpf-next 00/14] mvneta: introduce XDP multi-buffer support

2021-04-08 Thread John Fastabend
Lorenzo Bianconi wrote: > This series introduce XDP multi-buffer support. The mvneta driver is > the first to support these new "non-linear" xdp_{buff,frame}. Reviewers > please focus on how these new types of xdp_{buff,frame} packets > traverse the different layers and the layout design. It is on

RE: [Patch bpf-next] sock_map: fix a potential use-after-free in sock_map_close()

2021-04-08 Thread John Fastabend
eported-by: syzbot+7b6548ae483d6f4c6...@syzkaller.appspotmail.com > Fixes: 799aa7f98d53 ("skmsg: Avoid lock_sock() in sk_psock_backlog()") > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- > net/core/sock_map

RE: [Patch bpf-next] skmsg: pass psock pointer to ->psock_update_sk_prot()

2021-04-08 Thread John Fastabend
> Reported-and-tested-by: syzbot+320a3bc8d80f478c3...@syzkaller.appspotmail.com > Fixes: 8a59f9d1e3d4 ("sock: Introduce sk->sk_prot->psock_update_sk_prot()") > Cc: John Fastabend > Cc: Eric Dumazet > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Baue

Re: [PATCHv4 bpf-next 2/4] xdp: extend xdp_redirect_map with broadcast support

2021-04-08 Thread John Fastabend
Toke Høiland-Jørgensen wrote: > John Fastabend writes: > > > Toke Høiland-Jørgensen wrote: > >> John Fastabend writes: > >> > >> > Toke Høiland-Jørgensen wrote: > >> >> Hangbin Liu writes: > >> >> > >> >&g

Re: [PATCHv4 bpf-next 2/4] xdp: extend xdp_redirect_map with broadcast support

2021-04-06 Thread John Fastabend
Toke Høiland-Jørgensen wrote: > John Fastabend writes: > > > Toke Høiland-Jørgensen wrote: > >> Hangbin Liu writes: > >> > >> > On Mon, Apr 05, 2021 at 05:24:48PM -0700, John Fastabend wrote: > >> >> Hangbin Liu wrot

Re: [PATCHv4 bpf-next 2/4] xdp: extend xdp_redirect_map with broadcast support

2021-04-06 Thread John Fastabend
Toke Høiland-Jørgensen wrote: > Hangbin Liu writes: > > > On Mon, Apr 05, 2021 at 05:24:48PM -0700, John Fastabend wrote: > >> Hangbin Liu wrote: > >> > This patch add two flags BPF_F_BROADCAST and BPF_F_EXCLUDE_INGRESS to > >> > extend

Re: [Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-04-06 Thread John Fastabend
Cong Wang wrote: > On Mon, Apr 5, 2021 at 1:25 AM Eric Dumazet wrote: > > > > > > > > On 3/31/21 4:32 AM, Cong Wang wrote: > > > From: Cong Wang > > > > > > Currently sockmap calls into each protocol to update the struct > > > proto and replace it. This certainly won't work when the protocol > >

RE: [syzbot] WARNING: suspicious RCU usage in tcp_bpf_update_proto

2021-04-06 Thread John Fastabend
/linux/skmsg.h:446 [inline] > tcp_bpf_recvmsg+0x42d/0x480 net/ipv4/tcp_bpf.c:208 The bisection is bogus, but we will get a fix for this ASAP. The real commit is, commit 8a59f9d1e3d4340659fdfee8879dc09a6f2546e1 Author: Cong Wang Date: Tue Mar 30 19:32:31 2021 -0700 sock: Introduce sk->sk_prot->psock_update_sk_prot() Thanks, John

Re: [Patch bpf-next v8 10/16] sock: introduce sk->sk_prot->psock_update_sk_prot()

2021-04-06 Thread John Fastabend
we revert the patch or we can fix it to pass the psock through. Passing the psock works because we have a reference on it and it wont go away. I don't have any other good ideas off-hand. Thanks Eric! I'm a bit surprised we didn't get an RCU splat from the tests though. .John

RE: [PATCH bpf-next 2/3] libbpf: selftests: refactor 'BPF_PERCPU_TYPE()' and 'bpf_percpu()' macros

2021-04-05 Thread John Fastabend
Pedro Tammela wrote: > This macro was refactored out of the bpf selftests. > > Since percpu values are rounded up to '8' in the kernel, a careless > user in userspace might encounter unexpected values when parsing the > output of the batched operations. > > Now that both array and hash maps have

RE: [PATCH bpf-next 1/3] bpf: add batched ops support for percpu array

2021-04-05 Thread John Fastabend
Pedro Tammela wrote: > Suggested-by: Jamal Hadi Salim > Signed-off-by: Pedro Tammela > --- A commit message describing some of the change details and a note it uses the for-each cpu copies (same as normal syscall on percpu map) and not the per-cpu ones would be nice. I at least had to go and che

RE: [PATCHv4 bpf-next 2/4] xdp: extend xdp_redirect_map with broadcast support

2021-04-05 Thread John Fastabend
_obj(xdp, map, &key, &next_key, > ex_ifindex); > + if (!next_obj) { > + bq_enqueue(obj->dev, xdpf, dev_rx, obj->xdp_prog); > + return 0; > + } > + > + nxdpf = xdpf_clone(xdpf); > + if (unlikely(!nxdpf)) { > + xdp_return_frame_rx_napi(xdpf); > + return -ENOMEM; > + } > + > + bq_enqueue(obj->dev, nxdpf, dev_rx, obj->xdp_prog); > + > + /* Deal with next obj */ > + obj = next_obj; > + key = next_key; > + } > +} > + Thanks, John

RE: [Patch bpf-next] udp_bpf: remove some pointless comments

2021-04-05 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > These comments in udp_bpf_update_proto() are copied from the > original TCP code and apparently do not apply to UDP. Just > remove them. > > Reported-by: Jakub Sitnicki > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Loren

[PATCH bpf v2 2/2] bpf, sockmap: fix incorrect fwd_alloc accounting

2021-04-01 Thread John Fastabend
s memory will be claimed on psock_other. Reported-by: Andrii Nakryiko Fixes: 6fa9201a89898 ("bpf, sockmap: Avoid returning unneeded EAGAIN when redirecting to self") Signed-off-by: John Fastabend --- net/core/skmsg.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-)

[PATCH bpf v2 1/2] bpf, sockmap: fix sk->prot unhash op reset

2021-04-01 Thread John Fastabend
to the saved unhash() handler. Fixes: 4da6a196f93b1 ("bpf: Sockmap/tls, during free we may call tcp_bpf_unhash() in loop") Reported-by: Cong Wang Reported-by: Lorenz Bauer Suggested-by: Cong Wang Signed-off-by: John Fastabend --- include/linux/skmsg.h |7 ++- 1 file changed, 6 insertion

[PATCH bpf v2 0/2] bpf, sockmap fixes

2021-04-01 Thread John Fastabend
with usual suspects: test_sockmap, test_maps, test_progs and test_progs-no_alu32. v2: drop skb_orphan its not necessary and use sk directly instead of using psock->sk both suggested by Cong --- John Fastabend (2): bpf, sockmap: fix sk->prot unhash op reset bpf, sockma

RE: [Patch bpf-next v8 12/16] skmsg: extract __tcp_bpf_recvmsg() and tcp_bpf_wait_data()

2021-04-01 Thread John Fastabend
> skmsg.c and export them to modules. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang Acked-by: John Fastabend

RE: [Patch bpf-next v8 00/16] sockmap: introduce BPF_SK_SKB_VERDICT and support UDP

2021-04-01 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > We have thousands of services connected to a daemon on every host > via AF_UNIX dgram sockets, after they are moved into VM, we have to > add a proxy to forward these communications from VM to host, because > rewriting thousands of them is not practical. Thi

RE: [Patch bpf-next v8 13/16] udp: implement udp_bpf_recvmsg() for sockmap

2021-04-01 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > We have to implement udp_bpf_recvmsg() to replace the ->recvmsg() > to retrieve skmsg from ingress_msg. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang Acked-by: John Fastabend

RE: [Patch bpf-next v8 14/16] sock_map: update sock type checks for UDP

2021-03-31 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > Now UDP supports sockmap and redirection, we can safely update > the sock type checks for it accordingly. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang &g

RE: [Patch bpf-next v8 11/16] udp: implement ->read_sock() for sockmap

2021-03-31 Thread John Fastabend
y(), and UDP still does not > support splice() due to lack of ->splice_read(), so users > can not reach udp_read_sock() directly. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- Thanks t

RE: [Patch bpf-next v8 09/16] sock_map: introduce BPF_SK_SKB_VERDICT

2021-03-31 Thread John Fastabend
skb_verdict. Users are not > allowed to attach stream_verdict and skb_verdict programs to the > same map. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- Looks good. Acked-by: John Fastabend

RE: [Patch bpf-next v8 07/16] sock_map: simplify sock_map_link() a bit

2021-03-31 Thread John Fastabend
ock_map_link_no_progs() too. > > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Cc: John Fastabend > Signed-off-by: Cong Wang > --- Acked-by: John Fastabend

RE: [Patch bpf-next v8 01/16] skmsg: lock ingress_skb when purging

2021-03-31 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > Currently we purge the ingress_skb queue only when psock > refcnt goes down to 0, so locking the queue is not necessary, > but in order to be called during ->close, we have to lock it > here. > > Cc: John Fastabend > Cc:

Re: [Patch bpf-next v7 09/13] udp: implement ->read_sock() for sockmap

2021-03-29 Thread John Fastabend
Cong Wang wrote: > On Mon, Mar 29, 2021 at 11:23 PM John Fastabend > wrote: > > > > Cong Wang wrote: > > > On Mon, Mar 29, 2021 at 1:54 PM John Fastabend > > > wrote: > > > > > > > > Cong Wang wrote: > > > > > From: Cong

Re: [Patch bpf-next v7 09/13] udp: implement ->read_sock() for sockmap

2021-03-29 Thread John Fastabend
Cong Wang wrote: > On Mon, Mar 29, 2021 at 1:54 PM John Fastabend > wrote: > > > > Cong Wang wrote: > > > From: Cong Wang > > > > > > This is similar to tcp_read_sock(), except we do not need > > > to worry about connections, we

RE: [Patch bpf-next v7 12/13] sock_map: update sock type checks for UDP

2021-03-29 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > Now UDP supports sockmap and redirection, we can safely update > the sock type checks for it accordingly. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang &g

RE: [Patch bpf-next v7 09/13] udp: implement ->read_sock() for sockmap

2021-03-29 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > This is similar to tcp_read_sock(), except we do not need > to worry about connections, we just need to retrieve skb > from UDP receive queue. > > Note, the return value of ->read_sock() is unused in > sk_psock_verdict_data_ready

RE: [Patch bpf-next v7 07/13] sock_map: introduce BPF_SK_SKB_VERDICT

2021-03-29 Thread John Fastabend
skb_verdict. Users are not > allowed to set stream_verdict and skb_verdict at the same time. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- [...] > diff --git a/net/core/skmsg.c b/net/core/skms

RE: [Patch bpf-next v7 06/13] skmsg: use GFP_KERNEL in sk_psock_create_ingress_msg()

2021-03-29 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > This function is only called in process context. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- > net/core/skmsg.c | 2 +- > 1 file

RE: [Patch bpf-next v7 05/13] skmsg: use rcu work for destroying psock

2021-03-29 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > The RCU callback sk_psock_destroy() only queues work psock->gc, > so we can just switch to rcu work to simplify the code. > > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Acked-by: John Fastabend > Sign

RE: [Patch bpf-next v7 04/13] skmsg: avoid lock_sock() in sk_psock_backlog()

2021-03-29 Thread John Fastabend
queues when psock refcnt reaches zero but > here we want to purge them explicitly in sock_map_close(). > There are also some nasty race conditions on testing bit > SK_PSOCK_TX_ENABLED and queuing/canceling the psock work, > we can expand psock->ingress_lock a bit to protect them too. > &

RE: [Patch bpf-next v7 02/13] skmsg: introduce a spinlock to protect ingress_msg

2021-03-29 Thread John Fastabend
> it still has to use lock_sock. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Lorenz Bauer > Acked-by: Jakub Sitnicki > Signed-off-by: Cong Wang > --- Acked-by: John Fastabend

Re: [Patch bpf-next v7 00/13] sockmap: introduce BPF_SK_SKB_VERDICT and support UDP

2021-03-29 Thread John Fastabend
work > > return err in udp_read_sock() > > add patch 6/13 > > clean up test case > > The feature looks great to me. > I think the selftest is a bit light in terms of coverage, but it's acceptable. +1 > I'd like to see the final Acks from John/Daniel and Jakub/Lorenz before > merging. > Folks, > please prioritize the review of these patches. This is getting really close I'll take another pass over it today. Thanks

Re: [PATCH] tools: Remove duplicate definition of ia64_mf() on ia64

2021-03-28 Thread John Paul Adrian Glaubitz
Hello! On 3/23/21 7:25 PM, John Paul Adrian Glaubitz wrote: > The ia64_mf() macro defined in tools/arch/ia64/include/asm/barrier.h > is already defined in on ia64 which causes libbpf > failing to build: > > CC /usr/src/linux/tools/bpf/bpftool//libbpf/staticobjs/lib

Re: [PATCH, v2] tools: Remove inclusion of ia64-specific version of errno.h header

2021-03-28 Thread John Paul Adrian Glaubitz
Hello! On 3/23/21 7:04 PM, John Paul Adrian Glaubitz wrote: > There is no longer an ia64-specific version of the errno.h header > below arch/ia64/include/uapi/asm/, so trying to build tools/bpf > fails with: > > CC /usr/src/linux/tools/bpf/bpftool/btf_dumper.o > In

RE: [Patch bpf-next v6 05/12] skmsg: use rcu work for destroying psock

2021-03-25 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > The RCU callback sk_psock_destroy() only queues work psock->gc, > so we can just switch to rcu work to simplify the code. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-o

RE: [Patch bpf-next v6 04/12] skmsg: avoid lock_sock() in sk_psock_backlog()

2021-03-25 Thread John Fastabend
queues when psock refcnt reaches zero but > here we want to purge them explicitly in sock_map_close(). > There are also some nasty race conditions on testing bit > SK_PSOCK_TX_ENABLED and queuing/canceling the psock work, > we can expand psock->ingress_lock a bit to protect them too. > &

Re: [bpf PATCH 2/2] bpf, sockmap: fix incorrect fwd_alloc accounting

2021-03-25 Thread John Fastabend
Cong Wang wrote: > On Wed, Mar 24, 2021 at 7:46 PM John Fastabend > wrote: > > > > Cong Wang wrote: > > > On Wed, Mar 24, 2021 at 2:00 PM John Fastabend > > > wrote: > > > > > > > > Incorrect accounting fwd_alloc

Re: [bpf PATCH 1/2] bpf, sockmap: fix sk->prot unhash op reset

2021-03-25 Thread John Fastabend
Cong Wang wrote: > On Wed, Mar 24, 2021 at 7:28 PM John Fastabend > wrote: > > > > Cong Wang wrote: > > > On Wed, Mar 24, 2021 at 1:59 PM John Fastabend > > > wrote: > > > > diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c > > > &g

Re: [bpf PATCH] bpf, selftests: test_maps generating unrecognized data section

2021-03-25 Thread John Fastabend
Daniel Borkmann wrote: > On 3/24/21 10:07 PM, John Fastabend wrote: > > With a relatively recent clang master branch test_map skips a section, > > > > libbpf: elf: skipping unrecognized data section(5) .rodata.str1.1 > > > > the cause is some pointless st

Re: [bpf PATCH 2/2] bpf, sockmap: fix incorrect fwd_alloc accounting

2021-03-24 Thread John Fastabend
Cong Wang wrote: > On Wed, Mar 24, 2021 at 2:00 PM John Fastabend > wrote: > > > > Incorrect accounting fwd_alloc can result in a warning when the socket > > is torn down, > > [...] > > To resolve lets only account for sockets on the ingress queue that are &

Re: [bpf PATCH 1/2] bpf, sockmap: fix sk->prot unhash op reset

2021-03-24 Thread John Fastabend
Cong Wang wrote: > On Wed, Mar 24, 2021 at 1:59 PM John Fastabend > wrote: > > diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c > > index 47b7c5334c34..ecb5634b4c4a 100644 > > --- a/net/tls/tls_main.c > > +++ b/net/tls/tls_main.c > > @@ -754,6 +754,12 @

[bpf PATCH] bpf, selftests: test_maps generating unrecognized data section

2021-03-24 Thread John Fastabend
: John Fastabend --- .../selftests/bpf/progs/sockmap_tcp_msg_prog.c |3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/sockmap_tcp_msg_prog.c b/tools/testing/selftests/bpf/progs/sockmap_tcp_msg_prog.c index fdb4bf4408fa..0f603253f4ed 100644 --- a/tools

[bpf PATCH] small test_maps fix

2021-03-24 Thread John Fastabend
Small fix to silence a warning running ./test_maps on my local test boxes. Pushed to 'bpf' but can also apply against 'bpf-next' if folks would prefer. Thanks. --- John Fastabend (1): bpf, selftests: test_maps generating unrecognized data section ...

[bpf PATCH 2/2] bpf, sockmap: fix incorrect fwd_alloc accounting

2021-03-24 Thread John Fastabend
s memory will be claimed on psock_other. Reported-by: Andrii Nakryiko Fixes: 6fa9201a89898 ("bpf, sockmap: Avoid returning unneeded EAGAIN when redirecting to self") Signed-off-by: John Fastabend --- net/core/skmsg.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-)

[bpf PATCH 1/2] bpf, sockmap: fix sk->prot unhash op reset

2021-03-24 Thread John Fastabend
l point to the saved unhash() handler. Fixes: 4da6a196f93b1 ("bpf: Sockmap/tls, during free we may call tcp_bpf_unhash() in loop") Reported-by: Cong Wang Reported-by: Lorenz Bauer Signed-off-by: John Fastabend --- include/linux/skmsg.h |1 - net/tls/tls_main.c|6 +

[bpf PATCH 0/2] bpf, sockmap fixes

2021-03-24 Thread John Fastabend
test_progs and test_progs-no_alu32. --- John Fastabend (2): bpf, sockmap: fix sk->prot unhash op reset bpf, sockmap: fix incorrect fwd_alloc accounting include/linux/skmsg.h |1 - net/core/skmsg.c | 13 ++--- net/tls/tls_main.c|6 ++ 3 file

[PATCH] tools: Remove duplicate definition of ia64_mf() on ia64

2021-03-23 Thread John Paul Adrian Glaubitz
"mf" ::: "memory") | cc1: all warnings being treated as errors Thus, remove the definition from tools/arch/ia64/include/asm/barrier.h. Signed-off-by: John Paul Adrian Glaubitz --- tools/arch/ia64/include/asm/barrier.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/t

[PATCH, v2] tools: Remove inclusion of ia64-specific version of errno.h header

2021-03-23 Thread John Paul Adrian Glaubitz
eneric wrappers") Signed-off-by: John Paul Adrian Glaubitz --- tools/include/uapi/asm/errno.h | 2 -- 1 file changed, 2 deletions(-) v2: - Rephrase summary diff --git a/tools/include/uapi/asm/errno.h b/tools/include/uapi/asm/errno.h index 637189ec1ab9..d30439b4b8ab 100644 --- a/tools/incl

[PATCH] tools: Remove ia64-specific errno.h inclusion from errno.h header

2021-03-23 Thread John Paul Adrian Glaubitz
eneric wrappers") Signed-off-by: John Paul Adrian Glaubitz --- tools/include/uapi/asm/errno.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/include/uapi/asm/errno.h b/tools/include/uapi/asm/errno.h index 637189ec1ab9..d30439b4b8ab 100644 --- a/tools/include/uapi/asm/errno.h +++ b/to

[PATCH] tools: Remove ia64-specific errno.h inclusion from errno.h header

2021-03-23 Thread John Paul Adrian Glaubitz
eneric wrappers") Signed-off-by: John Paul Adrian Glaubitz --- tools/include/uapi/asm/errno.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/include/uapi/asm/errno.h b/tools/include/uapi/asm/errno.h index 637189ec1ab9..d30439b4b8ab 100644 --- a/tools/include/uapi/asm/errno.h +++ b/to

RE: [Patch bpf-next v5 04/11] skmsg: avoid lock_sock() in sk_psock_backlog()

2021-03-19 Thread John Fastabend
queues when psock refcnt reaches zero but > here we want to purge them explicitly in sock_map_close(). > There are also some nasty race conditions on testing bit > SK_PSOCK_TX_ENABLED and queuing/canceling the psock work, > we can expand psock->ingress_lock a bit to protect them too. > &

Re: [Patch bpf-next v2 2/9] sock: introduce sk_prot->update_proto()

2021-03-09 Thread John Fastabend
Cong Wang wrote: > On Fri, Mar 5, 2021 at 5:55 PM John Fastabend > wrote: > > [...] > > > // tcp_bpf_prots->unhash == sock_map_unhash > > > sk_psock_restore_proto(); > > > // Now tcp_bpf_prots->unhash is inet_unhash > > > ... >

Re: [Patch bpf-next v3 3/9] udp: implement ->sendmsg_locked()

2021-03-08 Thread John Fastabend
Cong Wang wrote: > On Fri, Mar 5, 2021 at 5:21 PM John Fastabend > wrote: > > > > Cong Wang wrote: > > > From: Cong Wang > > > > > > UDP already has udp_sendmsg() which takes lock_sock() inside. > > > We have to build ->sendmsg_locked()

Re: [Patch bpf-next v2 2/9] sock: introduce sk_prot->update_proto()

2021-03-05 Thread John Fastabend
Cong Wang wrote: > On Fri, Mar 5, 2021 at 4:27 PM John Fastabend > wrote: > > > > Cong Wang wrote: > > > On Tue, Mar 2, 2021 at 10:23 AM Cong Wang > > > wrote: > > > > > > > > On Tue, Mar 2, 2021 at 8:22 AM Lorenz Bauer wrote

RE: [Patch bpf-next v3 3/9] udp: implement ->sendmsg_locked()

2021-03-05 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > UDP already has udp_sendmsg() which takes lock_sock() inside. > We have to build ->sendmsg_locked() on top of it, by adding > a new parameter for whether the sock has been locked. > > Cc: John Fastabend > Cc: Daniel Borkmann

Re: [Patch bpf-next v2 2/9] sock: introduce sk_prot->update_proto()

2021-03-05 Thread John Fastabend
, it is completely unrelated to my patch, as the current code has > > the same problem. > > Looking at this again. I noticed > > commit 4da6a196f93b1af7612340e8c1ad8ce71e18f955 > Author: John Fastabend > Date: Sat Jan 11 06:11:59 2020 + > > bpf: Sockmap/tls, duri

RE: [Patch bpf-next] skmsg: add function doc for skb->_sk_redir

2021-03-01 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > This should fix the following warning: > > include/linux/skbuff.h:932: warning: Function parameter or member > '_sk_redir' not described in 'sk_buff' > > Reported-by: Lorenz Bauer > Cc: Daniel Borkm

Re: [PATCH net] net: Fix gro aggregation for udp encaps with zero csum

2021-02-27 Thread John Fastabend
|| > > Basically matches > > - CHECKSUM_NONE > - CHECKSUM_UNNECESSARY which has already used up its valid state on a > prior header > - CHECKSUM_COMPLETE with bad checksum. > > This change just refines to not drop for in the first two cases on a > zero checksum field. +1 > > Making this explicit in case anyone sees holes in the logic. Else, > > Acked-by: Willem de Bruijn LGTM, Acked-by: John Fastabend

RE: [PATCH v7 bpf-next 0/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-17 Thread John Fastabend
47 1775988 1600203 1440054 > page1974058 1953655 1945463 1904478 > percent 3.0%10.0% 21.58% 32.3% > For the series, but might be good to get Dave or Jakub to check 2/6 to be sure they agree. Acked-by: John Fastabend

Re: RE: [PATCH v7 bpf-next 6/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-17 Thread John Fastabend
Xuan Zhuo wrote: > On Wed, 17 Feb 2021 16:46:04 -0800, John Fastabend > wrote: > > Alexander Lobakin wrote: > > > From: Xuan Zhuo > > > > > > This patch is used to construct skb based on page to save memory copy > > > overhead. &

RE: [PATCH v7 bpf-next 6/6] xsk: build skb by page (aka generic zerocopy xmit)

2021-02-17 Thread John Fastabend
f pgs[] if len is larger than the number of pgs? Do we need to guard against a misconfigured socket causing a panic here? AFAIU len here is read from the user space descriptor so is under user control. Or maybe I missed a check somewhere. Thanks, John > + get

RE: [Patch bpf-next] bpf: clear per_cpu pointers in bpf_prog_clone_create()

2021-02-17 Thread John Fastabend
6ef59 ("bpf: Optimize program stats") > Fixes: ca06f55b9002 ("bpf: Add per-program recursion prevention mechanism") > Cc: Alexei Starovoitov > Signed-off-by: Cong Wang > --- Acked-by: John Fastabend

RE: [PATCH bpf-next V1 2/2] selftests/bpf: Tests using bpf_check_mtu BPF-helper input mtu_len param

2021-02-17 Thread John Fastabend
esper Dangaard Brouer > --- LGTM. Acked-by: John Fastabend

RE: [PATCH bpf-next V1 1/2] bpf: BPF-helper for MTU checking add length input

2021-02-17 Thread John Fastabend
specify the L3 length that the MTU check > + * is done against. Remeber XDP and TC length operate at L2, but ^^^ typo, Remember Acked-by: John Fastabend

Re: [Patch bpf-next v4 4/5] skmsg: move sk_redir from TCP_SKB_CB to skb

2021-02-17 Thread John Fastabend
Cong Wang wrote: > On Wed, Feb 17, 2021 at 10:40 AM John Fastabend > wrote: > > > @@ -802,9 +809,10 @@ int sk_psock_tls_strp_read(struct sk_psock *psock, > > > struct sk_buff *skb) > > >* TLS context. > > >

RE: [PATCH bpf-next 0/8] PROG_TEST_RUN support for sk_lookup programs

2021-02-17 Thread John Fastabend
2) > > Please let me know what your preference is. Seems reasonable to me. For the series, Acked-by: John Fastabend

Re: [Patch bpf-next v3 4/5] skmsg: use skb ext instead of TCP_SKB_CB

2021-02-17 Thread John Fastabend
Lorenz Bauer wrote: > On Mon, 15 Feb 2021 at 19:20, John Fastabend wrote: > > > > Cong Wang wrote: > > > From: Cong Wang > > > > > > Currently TCP_SKB_CB() is hard-coded in skmsg code, it certainly > > > does not work for any other non-TCP prot

RE: [Patch bpf-next v4 4/5] skmsg: move sk_redir from TCP_SKB_CB to skb

2021-02-17 Thread John Fastabend
o longer needed after ->sk_data_ready() so we can just drop it. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- Great, its likely we have more space in sk_buff we can use if needed as well. queue_m

Re: [PATCH bpf-next 1/3] libbpf: xsk: use bpf_link

2021-02-16 Thread John Fastabend
Maciej Fijalkowski wrote: > On Tue, Feb 16, 2021 at 11:15:41AM -0800, John Fastabend wrote: > > Toke Høiland-Jørgensen wrote: > > > Björn Töpel writes: > > > > > > > On 2021-02-15 21:49, John Fastabend wrote: > > > >> Maciej Fijalkowski wro

Re: [PATCH bpf-next 1/3] libbpf: xsk: use bpf_link

2021-02-16 Thread John Fastabend
Toke Høiland-Jørgensen wrote: > Björn Töpel writes: > > > On 2021-02-15 21:49, John Fastabend wrote: > >> Maciej Fijalkowski wrote: > >>> Currently, if there are multiple xdpsock instances running on a single > >>> interface and in case one of the in

Re: [PATCH bpf-next 1/3] libbpf: xsk: use bpf_link

2021-02-16 Thread John Fastabend
Maciej Fijalkowski wrote: > On Mon, Feb 15, 2021 at 12:49:27PM -0800, John Fastabend wrote: > > Maciej Fijalkowski wrote: > > > Currently, if there are multiple xdpsock instances running on a single > > > interface and in case one of the instances is terminated, the res

Re: [Patch bpf-next v3 4/5] skmsg: use skb ext instead of TCP_SKB_CB

2021-02-15 Thread John Fastabend
Cong Wang wrote: > On Mon, Feb 15, 2021 at 4:54 PM John Fastabend > wrote: > > > > Cong Wang wrote: > > > On Mon, Feb 15, 2021 at 3:57 PM John Fastabend > > > wrote: > > > > > > > > For TCP case we can continue to use CB and not pa

Re: [Patch bpf-next v3 4/5] skmsg: use skb ext instead of TCP_SKB_CB

2021-02-15 Thread John Fastabend
Cong Wang wrote: > On Mon, Feb 15, 2021 at 3:57 PM John Fastabend > wrote: > > > > For TCP case we can continue to use CB and not pay the price. For UDP > > and AF_UNIX we can do the extra alloc. > > I see your point, but specializing TCP case does not give much

Re: [PATCH bpf-next 1/3] libbpf: xsk: use bpf_link

2021-02-15 Thread John Fastabend
Toke Høiland-Jørgensen wrote: > John Fastabend writes: > > >> > However, in libxdp we can solve the original problem in a different way, > >> > and in fact I already suggested to Magnus that we should do this (see > >> > [1]); so one way forward

Re: [Patch bpf-next v3 4/5] skmsg: use skb ext instead of TCP_SKB_CB

2021-02-15 Thread John Fastabend
Cong Wang wrote: > On Mon, Feb 15, 2021 at 11:20 AM John Fastabend > wrote: > > > > Cong Wang wrote: > > > From: Cong Wang > > > > > > Currently TCP_SKB_CB() is hard-coded in skmsg code, it certainly > > > does not work for any other non-TC

RE: [PATCH bpf-next 1/3] libbpf: xsk: use bpf_link

2021-02-15 Thread John Fastabend
Maciej Fijalkowski wrote: > Currently, if there are multiple xdpsock instances running on a single > interface and in case one of the instances is terminated, the rest of > them are left in an inoperable state due to the fact of unloaded XDP > prog from interface. > > To address that, step away fr

RE: [PATCH bpf-next 2/3] libbpf: clear map_info before each bpf_obj_get_info_by_fd

2021-02-15 Thread John Fastabend
Maciej Fijalkowski wrote: > xsk_lookup_bpf_maps, based on prog_fd, looks whether current prog has a > reference to XSKMAP. BPF prog can include insns that work on various BPF > maps and this is covered by iterating through map_ids. > > The bpf_map_info that is passed to bpf_obj_get_info_by_fd for

RE: [PATCH bpf-next 3/3] samples: bpf: do not unload prog within xdpsock

2021-02-15 Thread John Fastabend
Maciej Fijalkowski wrote: > With the introduction of bpf_link in xsk's libbpf part, there's no > further need for explicit unload of prog on xdpsock's termination. When > process dies, the bpf_link's refcount will be decremented and resources > will be unloaded/freed under the hood in case when the

Re: [PATCH bpf-next 1/3] libbpf: xsk: use bpf_link

2021-02-15 Thread John Fastabend
Björn Töpel wrote: > On 2021-02-15 18:07, Toke Høiland-Jørgensen wrote: > > Maciej Fijalkowski writes: > > > >> Currently, if there are multiple xdpsock instances running on a single > >> interface and in case one of the instances is terminated, the rest of > >> them are left in an inoperable sta

RE: [Patch bpf-next v3 4/5] skmsg: use skb ext instead of TCP_SKB_CB

2021-02-15 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > Currently TCP_SKB_CB() is hard-coded in skmsg code, it certainly > does not work for any other non-TCP protocols. We can move them to > skb ext instead of playing with skb cb, which is harder to make > correct. > > Cc: John Fastaben

RE: [Patch bpf-next v3 5/5] sock_map: rename skb_parser and skb_verdict

2021-02-15 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > These two eBPF programs are tied to BPF_SK_SKB_STREAM_PARSER > and BPF_SK_SKB_STREAM_VERDICT, rename them to reflect the fact > they are only used for TCP. And save the name 'skb_verdict' for > general use later. > >

RE: [Patch bpf-next v3 3/5] bpf: compute data_end dynamically with JIT code

2021-02-15 Thread John Fastabend
imilar to skb_shinfo(skb) computation > in bpf_convert_shinfo_access(). > > Suggested-by: Jakub Sitnicki > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- Acked-by: John Fastabend

RE: [Patch bpf-next v3 2/5] skmsg: get rid of struct sk_psock_parser

2021-02-15 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > struct sk_psock_parser is embedded in sk_psock, it is > unnecessary as skb verdict also uses ->saved_data_ready. > We can simply fold these fields into sk_psock, and get rid > of ->enabled. > > Cc: John Fastabend >

RE: [Patch bpf-next v3 1/5] bpf: clean up sockmap related Kconfigs

2021-02-15 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > As suggested by John, clean up sockmap related Kconfigs: > > Reduce the scope of CONFIG_BPF_STREAM_PARSER down to TCP stream > parser, to reflect its name. > > Make the rest sockmap code simply depend on CONFIG_BPF_SYSCALL. > An

RE: [PATCH net-next 1/9] lan78xx: add NAPI interface support

2021-02-10 Thread John Efstathiades
tainly look at how to split this patch into smaller chunks but that might be quite hard to do. If that turns out not to possible, do you have any suggestions on how I can make the patch easier for reviewers to understand and review? John

RE: [PATCH net-next 7/9] lan78xx: set maximum MTU

2021-02-10 Thread John Efstathiades
> -Original Message- > From: Andrew Lunn > Sent: 04 February 2021 13:48 > > > > > This was missed in the work to add the NAPI support. > > git rebase? Please squash it into the correct place. Yes, will do. John

RE: [PATCH net-next 4/9] lan78xx: disable MAC address filter before updating entry

2021-02-10 Thread John Efstathiades
> -Original Message- > From: Andrew Lunn > Sent: 04 February 2021 13:46 > > On Thu, Feb 04, 2021 at 11:31:16AM +, John Efstathiades wrote: > > Disable the station MAC address entry in the perfect address filter > > table before updating the table e

RE: [PATCH net-next 2/9] lan78xx: disable U1/U2 power state transitions

2021-02-10 Thread John Efstathiades
erformance numbers would be nice here. And maybe current draw? I'll do this in the next revision of the patch. John

RE: [PATCH net-next 1/9] lan78xx: add NAPI interface support

2021-02-10 Thread John Efstathiades
0/X patch some performance > data. Yes, I can do that. Thanks for the other comments. I'll sort out the issues before preparing an update but it will take a few weeks to re-test the driver and prepare a new patch. John

Re: [Patch bpf-next 01/19] bpf: rename BPF_STREAM_PARSER to BPF_SOCK_MAP

2021-02-08 Thread John Fastabend
Cong Wang wrote: > On Mon, Feb 8, 2021 at 12:21 AM John Fastabend > wrote: > > > > Cong Wang wrote: > > > From: Cong Wang > > > > > > Before we add non-TCP support, it is necessary to rename > > > BPF_STREAM_PARSER as it will be no long

Re: [Patch bpf-next 02/19] skmsg: get rid of struct sk_psock_parser

2021-02-08 Thread John Fastabend
Jakub Sitnicki wrote: > On Wed, Feb 03, 2021 at 05:16 AM CET, Cong Wang wrote: > > From: Cong Wang > > > > struct sk_psock_parser is embedded in sk_psock, it is > > unnecessary as skb verdict also uses ->saved_data_ready. > > We can simply fold these fi

RE: [Patch bpf-next 05/19] sock_map: introduce BPF_SK_SKB_VERDICT

2021-02-08 Thread John Fastabend
a new type of eBPF program, skb_verdict. > Users are not allowed to set stream_verdict and skb_verdict at the > same time. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang I think it will be better if we

RE: [Patch bpf-next 04/19] sock_map: rename skb_parser and skb_verdict

2021-02-08 Thread John Fastabend
Cong Wang wrote: > From: Cong Wang > > These two ebpf programs are tied to BPF_SK_SKB_STREAM_PARSER > and BPF_SK_SKB_STREAM_VERDICT, rename them to reflect the fact > they are currently used for TCP. And save the generic name > skb_verdict for general use. > > Cc: John

RE: [Patch bpf-next 01/19] bpf: rename BPF_STREAM_PARSER to BPF_SOCK_MAP

2021-02-08 Thread John Fastabend
hat sock_map.c hopefully would be protocol-independent. > > Also, improve its Kconfig description to avoid confusion. > > Cc: John Fastabend > Cc: Daniel Borkmann > Cc: Jakub Sitnicki > Cc: Lorenz Bauer > Signed-off-by: Cong Wang > --- The BPF_STREAM_PARSER config was

[PATCH net-next 7/9] lan78xx: set maximum MTU

2021-02-04 Thread John Efstathiades
Fix setting of maximum MTU to support jumbo frames. This was missed in the work to add the NAPI support. Signed-off-by: John Efstathiades --- drivers/net/usb/lan78xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index

[PATCH net-next 9/9] lan78xx: remove set but unused 'ret' variable

2021-02-04 Thread John Efstathiades
Incorporate changes from commit 06cd7c46b3ab ("net: usb: lan78xx: Remove lots of set but unused 'ret' variables") that fixes kernel build warnings. Signed-off-by: John Efstathiades --- drivers/net/usb/lan78xx.c | 107 +++--- 1 file changed,

  1   2   3   4   5   6   7   8   9   10   >