Re: [PATCH bpf-next 5/6] bpf: sockmap: allow update from BPF

2020-08-20 Thread Yonghong Song
On 8/20/20 4:33 AM, Lorenz Bauer wrote: On Wed, 19 Aug 2020 at 23:41, John Fastabend wrote: John Fastabend wrote: Lorenz Bauer wrote: Allow calling bpf_map_update_elem on sockmap and sockhash from a BPF context. The synchronization required for this is a bit fiddly: we need to prevent the

Re: [PATCH bpf-next 5/6] bpf: sockmap: allow update from BPF

2020-08-20 Thread Lorenz Bauer
On Wed, 19 Aug 2020 at 23:41, John Fastabend wrote: > > John Fastabend wrote: > > Lorenz Bauer wrote: > > > Allow calling bpf_map_update_elem on sockmap and sockhash from a BPF > > > context. The synchronization required for this is a bit fiddly: we > > > need to prevent the socket from changing i

RE: [PATCH bpf-next 5/6] bpf: sockmap: allow update from BPF

2020-08-19 Thread John Fastabend
John Fastabend wrote: > Lorenz Bauer wrote: > > Allow calling bpf_map_update_elem on sockmap and sockhash from a BPF > > context. The synchronization required for this is a bit fiddly: we > > need to prevent the socket from changing it's state while we add it > > to the sockmap, since we rely on ge

RE: [PATCH bpf-next 5/6] bpf: sockmap: allow update from BPF

2020-08-19 Thread John Fastabend
Lorenz Bauer wrote: > Allow calling bpf_map_update_elem on sockmap and sockhash from a BPF > context. The synchronization required for this is a bit fiddly: we > need to prevent the socket from changing it's state while we add it > to the sockmap, since we rely on getting a callback via > sk_prot->

Re: [PATCH bpf-next 5/6] bpf: sockmap: allow update from BPF

2020-08-19 Thread Yonghong Song
On 8/19/20 2:24 AM, Lorenz Bauer wrote: Allow calling bpf_map_update_elem on sockmap and sockhash from a BPF context. The synchronization required for this is a bit fiddly: we need to prevent the socket from changing it's state while we add it to the sockmap, since we rely on getting a callbac

[PATCH bpf-next 5/6] bpf: sockmap: allow update from BPF

2020-08-19 Thread Lorenz Bauer
Allow calling bpf_map_update_elem on sockmap and sockhash from a BPF context. The synchronization required for this is a bit fiddly: we need to prevent the socket from changing it's state while we add it to the sockmap, since we rely on getting a callback via sk_prot->unhash. However, we can't just