[PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-06 Thread Alexei Starovoitov
in cases where bpf programs are looking at sockets and packets that belong to different netns, it could be useful to get an id that uniquely identify a netns within the whole system. Therefore introduce 'u64 bpf_sk_netns_id(sk);' helper. It returns unique value that identifies netns of given socke

Re: [PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-07 Thread Daniel Borkmann
On 02/07/2017 03:02 AM, Alexei Starovoitov wrote: in cases where bpf programs are looking at sockets and packets that belong to different netns, it could be useful to get an id that uniquely identify a netns within the whole system. Therefore introduce 'u64 bpf_sk_netns_id(sk);' helper. It retur

Re: [PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-08 Thread David Miller
From: Alexei Starovoitov Date: Mon, 6 Feb 2017 18:02:48 -0800 > Eric, I'v added proc_get_ns_devid_inum() to nsfs.c > right next to __ns_get_path(), so when it is time in the future > to make nsfs more namespace aware, it will be easy to adjust > both new_inode_pseudo(mnt->mnt_sb) line and proc_ge

Re: [PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-13 Thread Eric W. Biederman
Alexei Starovoitov writes: > in cases where bpf programs are looking at sockets and packets > that belong to different netns, it could be useful to get an id > that uniquely identify a netns within the whole system. It could be useful but there is no unique namespace id. > Therefore introduce '

Re: [PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-15 Thread David Ahern
On 2/14/17 12:21 AM, Eric W. Biederman wrote: >> in cases where bpf programs are looking at sockets and packets >> that belong to different netns, it could be useful to get an id >> that uniquely identify a netns within the whole system. > It could be useful but there is no unique namespace id. >

Re: [PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-15 Thread Eric W. Biederman
David Ahern writes: > On 2/14/17 12:21 AM, Eric W. Biederman wrote: >>> in cases where bpf programs are looking at sockets and packets >>> that belong to different netns, it could be useful to get an id >>> that uniquely identify a netns within the whole system. >> It could be useful but there is

Re: [PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-15 Thread David Ahern
On 2/15/17 8:08 PM, Eric W. Biederman wrote: > David Ahern writes: > >> On 2/14/17 12:21 AM, Eric W. Biederman wrote: in cases where bpf programs are looking at sockets and packets that belong to different netns, it could be useful to get an id that uniquely identify a netns within

Re: [PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-15 Thread Andy Lutomirski
On Wed, Feb 15, 2017 at 7:18 PM, David Ahern wrote: > On 2/15/17 8:08 PM, Eric W. Biederman wrote: >> David Ahern writes: >> >>> On 2/14/17 12:21 AM, Eric W. Biederman wrote: > in cases where bpf programs are looking at sockets and packets > that belong to different netns, it could be use

Re: [PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-15 Thread David Ahern
On 2/15/17 8:25 PM, Andy Lutomirski wrote: > On Wed, Feb 15, 2017 at 7:18 PM, David Ahern wrote: >> On 2/15/17 8:08 PM, Eric W. Biederman wrote: >>> David Ahern writes: >>> On 2/14/17 12:21 AM, Eric W. Biederman wrote: >> in cases where bpf programs are looking at sockets and packets >>>

Re: [PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-15 Thread Eric W. Biederman
David Ahern writes: > On 2/15/17 8:25 PM, Andy Lutomirski wrote: >> On Wed, Feb 15, 2017 at 7:18 PM, David Ahern >> wrote: >>> On 2/15/17 8:08 PM, Eric W. Biederman wrote: David Ahern writes: > On 2/14/17 12:21 AM, Eric W. Biederman wrote: >>> in cases where bpf programs are