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

2021-04-02 Thread Alexei Starovoitov
On Fri, Apr 2, 2021 at 10:12 PM Cong Wang wrote: > > On Wed, Mar 31, 2021 at 11:01 PM John Fastabend > wrote: > > This 'else if' is always true if above is false right? Would be > > impler and clearer IMO as, > > > >if (used <= 0) { > > if (!copied) > >

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

2021-04-02 Thread Cong Wang
On Wed, Mar 31, 2021 at 11:01 PM John Fastabend wrote: > This 'else if' is always true if above is false right? Would be > impler and clearer IMO as, > >if (used <= 0) { > if (!copied) > copied = used; >

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

2021-03-31 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(), and UDP still does not >

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

2021-03-30 Thread Cong Wang
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(), and UDP still does not support splice() due to lack of ->