Re: [PATCH bpf] bpf: Support sk lookup in netns with id 0

2018-11-28 Thread Joe Stringer
On Tue, 27 Nov 2018 at 13:12, Alexei Starovoitov wrote: > > On Tue, Nov 27, 2018 at 10:01:40AM -0800, Joe Stringer wrote: > > On Tue, 27 Nov 2018 at 06:49, Nicolas Dichtel > > wrote: > > > > > > Le 26/11/2018 ą 23:08, David Ahern a écrit : > > > > On 11/26/18 2:27 PM, Joe Stringer wrote: > > > >

Re: [PATCH bpf] bpf: Support sk lookup in netns with id 0

2018-11-27 Thread Alexei Starovoitov
On Tue, Nov 27, 2018 at 10:01:40AM -0800, Joe Stringer wrote: > On Tue, 27 Nov 2018 at 06:49, Nicolas Dichtel > wrote: > > > > Le 26/11/2018 à 23:08, David Ahern a écrit : > > > On 11/26/18 2:27 PM, Joe Stringer wrote: > > >> @@ -2405,6 +2407,9 @@ enum bpf_func_id { > > >> /* BPF_FUNC_perf_event

Re: [PATCH bpf] bpf: Support sk lookup in netns with id 0

2018-11-27 Thread Joe Stringer
On Tue, 27 Nov 2018 at 06:49, Nicolas Dichtel wrote: > > Le 26/11/2018 à 23:08, David Ahern a écrit : > > On 11/26/18 2:27 PM, Joe Stringer wrote: > >> @@ -2405,6 +2407,9 @@ enum bpf_func_id { > >> /* BPF_FUNC_perf_event_output for sk_buff input context. */ > >> #define BPF_F_CTXLEN_MASK

Re: [PATCH bpf] bpf: Support sk lookup in netns with id 0

2018-11-27 Thread Nicolas Dichtel
Le 26/11/2018 à 23:08, David Ahern a écrit : > On 11/26/18 2:27 PM, Joe Stringer wrote: >> @@ -2405,6 +2407,9 @@ enum bpf_func_id { >> /* BPF_FUNC_perf_event_output for sk_buff input context. */ >> #define BPF_F_CTXLEN_MASK (0xfULL << 32) >> >> +/* BPF_FUNC_sk_lookup_tcp and BPF_F

Re: [PATCH bpf] bpf: Support sk lookup in netns with id 0

2018-11-26 Thread David Ahern
On 11/26/18 2:27 PM, Joe Stringer wrote: > @@ -2405,6 +2407,9 @@ enum bpf_func_id { > /* BPF_FUNC_perf_event_output for sk_buff input context. */ > #define BPF_F_CTXLEN_MASK(0xfULL << 32) > > +/* BPF_FUNC_sk_lookup_tcp and BPF_FUNC_sk_lookup_udp flags. */ > +#define BPF_F_SK_CUR

[PATCH bpf] bpf: Support sk lookup in netns with id 0

2018-11-26 Thread Joe Stringer
David Ahern and Nicolas Dichtel report that the handling of the netns id 0 is incorrect for the BPF socket lookup helpers: rather than finding the netns with id 0, it is resolving to the current netns. This renders the netns_id 0 inaccessible. To fix this, adjust the API for the netns to treat all