Re: [bpf PATCH v2 3/6] bpf: sockhash fix omitted bucket lock in sock_close

2018-06-15 Thread Martin KaFai Lau
On Fri, Jun 15, 2018 at 08:23:14AM -0700, John Fastabend wrote: > On 06/14/2018 10:41 PM, Martin KaFai Lau wrote: > > On Thu, Jun 14, 2018 at 09:44:57AM -0700, John Fastabend wrote: > >> First in tcp_close, reduce scope of sk_callback_lock() the lock is > >> only needed for protecting smap_release_

Re: [bpf PATCH v2 3/6] bpf: sockhash fix omitted bucket lock in sock_close

2018-06-15 Thread John Fastabend
On 06/14/2018 10:41 PM, Martin KaFai Lau wrote: > On Thu, Jun 14, 2018 at 09:44:57AM -0700, John Fastabend wrote: >> First in tcp_close, reduce scope of sk_callback_lock() the lock is >> only needed for protecting smap_release_sock() the ingress and cork >> lists are protected by sock lock. Having

Re: [bpf PATCH v2 3/6] bpf: sockhash fix omitted bucket lock in sock_close

2018-06-14 Thread Martin KaFai Lau
On Thu, Jun 14, 2018 at 09:44:57AM -0700, John Fastabend wrote: > First in tcp_close, reduce scope of sk_callback_lock() the lock is > only needed for protecting smap_release_sock() the ingress and cork > lists are protected by sock lock. Having the lock in wider scope is > harmless but may confuse

[bpf PATCH v2 3/6] bpf: sockhash fix omitted bucket lock in sock_close

2018-06-14 Thread John Fastabend
First in tcp_close, reduce scope of sk_callback_lock() the lock is only needed for protecting smap_release_sock() the ingress and cork lists are protected by sock lock. Having the lock in wider scope is harmless but may confuse the reader who may infer it is in fact needed. Next, in sock_hash_dele