Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-11-01 Thread David Miller
From: Lorenzo Colitti Date: Wed, 2 Nov 2016 00:25:15 +0900 > That way, if you want to modify the packet or do something > sophisticated in netfilter, you can still use the eBPF hook on the > results of that operation, and if you don't want to run netfilter, you > can write netfilter rules to skip

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-11-01 Thread Lorenzo Colitti
On Sun, Oct 30, 2016 at 5:29 AM, Daniel Borkmann wrote: > Fwiw, not sure if swapping brings much, even after netfilter there could > be complex processing that would potentially drop, mangle, redirect, etc > from tc layer (egress or from qdisc itself). But also at even lower layers I agree lots o

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-29 Thread Daniel Borkmann
On 10/29/2016 05:34 PM, Lorenzo Colitti wrote: On Sat, Oct 29, 2016 at 3:24 PM, Alexei Starovoitov wrote: it could be solved by swapping the order of cgroup_bpf_run_filter() and NF_INET_POST_ROUTING in patch 5. It was proposed some time back, but the current patch, I think, is more symmetrical.

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-29 Thread Lorenzo Colitti
On Sat, Oct 29, 2016 at 3:24 PM, Alexei Starovoitov wrote: > it could be solved by swapping the order of cgroup_bpf_run_filter() > and NF_INET_POST_ROUTING in patch 5. It was proposed some time back, but > the current patch, I think, is more symmetrical. > cgroup+bpf runs after nf hook on rx and r

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-28 Thread Alexei Starovoitov
On Sat, Oct 29, 2016 at 01:59:23PM +0900, Lorenzo Colitti wrote: > On Sat, Oct 29, 2016 at 1:51 PM, Alexei Starovoitov > wrote: > >> What's the use case for egress? > >> > >> We (android networking) are currently looking at implementing network > >> accounting via eBPF in order to replace the out-

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-28 Thread Lorenzo Colitti
On Sat, Oct 29, 2016 at 1:51 PM, Alexei Starovoitov wrote: >> What's the use case for egress? >> >> We (android networking) are currently looking at implementing network >> accounting via eBPF in order to replace the out-of-tree xt_qtaguid >> code. A per-cgroup eBPF program run on all traffic woul

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-28 Thread Alexei Starovoitov
On Sat, Oct 29, 2016 at 12:51:37PM +0900, Lorenzo Colitti wrote: > On Thu, Oct 27, 2016 at 5:40 PM, Daniel Mack wrote: > > It's not anything new. These hooks live on the very same level as > > SO_ATTACH_FILTER. The only differences are that the BPF programs are > > stored in the cgroup, and not in

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-28 Thread Lorenzo Colitti
On Thu, Oct 27, 2016 at 5:40 PM, Daniel Mack wrote: > It's not anything new. These hooks live on the very same level as > SO_ATTACH_FILTER. The only differences are that the BPF programs are > stored in the cgroup, and not in the socket, and that they exist for > egress as well. What's the use ca

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-28 Thread Alexei Starovoitov
On Fri, Oct 28, 2016 at 01:28:39PM +0200, Pablo Neira Ayuso wrote: > Hi Alexei, > > On Wed, Oct 26, 2016 at 08:35:04PM -0700, Alexei Starovoitov wrote: > > On Wed, Oct 26, 2016 at 09:59:33PM +0200, Pablo Neira Ayuso wrote: > > > On Tue, Oct 25, 2016 at 12:14:08PM +0200, Daniel Mack wrote: > > > [.

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-28 Thread David Ahern
On 10/28/16 5:28 AM, Pablo Neira Ayuso wrote: > I saw those, I would really like to have a closer look at David > Ahern's usecase since that skb iif mangling looks kludgy to me, and > given this is exposing a new helper for general use, not only vrf, it > would be good to make sure helpers provide

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-28 Thread Daniel Mack
On 10/28/2016 01:53 PM, Pablo Neira Ayuso wrote: > On Thu, Oct 27, 2016 at 10:40:14AM +0200, Daniel Mack wrote: >> It's not anything new. These hooks live on the very same level as >> SO_ATTACH_FILTER. The only differences are that the BPF programs are >> stored in the cgroup, and not in the socke

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-28 Thread Pablo Neira Ayuso
On Thu, Oct 27, 2016 at 10:40:14AM +0200, Daniel Mack wrote: > On 10/26/2016 09:59 PM, Pablo Neira Ayuso wrote: > > On Tue, Oct 25, 2016 at 12:14:08PM +0200, Daniel Mack wrote: > > [...] > >> Dumping programs once they are installed is problematic because of > >> the internal optimizations done

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-28 Thread Pablo Neira Ayuso
Hi Alexei, On Wed, Oct 26, 2016 at 08:35:04PM -0700, Alexei Starovoitov wrote: > On Wed, Oct 26, 2016 at 09:59:33PM +0200, Pablo Neira Ayuso wrote: > > On Tue, Oct 25, 2016 at 12:14:08PM +0200, Daniel Mack wrote: > > [...] > > > Dumping programs once they are installed is problematic because of

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-27 Thread Daniel Mack
On 10/26/2016 09:59 PM, Pablo Neira Ayuso wrote: > On Tue, Oct 25, 2016 at 12:14:08PM +0200, Daniel Mack wrote: > [...] >> Dumping programs once they are installed is problematic because of >> the internal optimizations done to the eBPF program during its >> lifetime. Also, the references to

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-26 Thread Alexei Starovoitov
On Wed, Oct 26, 2016 at 09:59:33PM +0200, Pablo Neira Ayuso wrote: > On Tue, Oct 25, 2016 at 12:14:08PM +0200, Daniel Mack wrote: > [...] > > Dumping programs once they are installed is problematic because of > > the internal optimizations done to the eBPF program during its > > lifetime. Als

Re: [PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-26 Thread Pablo Neira Ayuso
On Tue, Oct 25, 2016 at 12:14:08PM +0200, Daniel Mack wrote: [...] > Dumping programs once they are installed is problematic because of > the internal optimizations done to the eBPF program during its > lifetime. Also, the references to maps etc. would need to be > restored during the dump.

[PATCH v7 0/6] Add eBPF hooks for cgroups

2016-10-25 Thread Daniel Mack
This is v7 of the patch set to allow eBPF programs for network filtering and accounting to be attached to cgroups, so that they apply to all sockets of all tasks placed in that cgroup. The logic also allows to be extendeded for other cgroup based eBPF logic. Although there are some minor updates a