From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Colitti Subject: Re: [PATCH v7 0/6] Add eBPF hooks for cgroups Date: Sat, 29 Oct 2016 13:59:23 +0900 Message-ID: References: <1477390454-12553-1-git-send-email-daniel@zonque.org> <20161026195933.GA2031@salvia> <20161029045107.GA61294@ast-mbp.thefacebook.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Daniel Mack , Pablo Neira Ayuso , htejun-b10kYP2dOMg@public.gmane.org, Daniel Borkmann , ast-b10kYP2dOMg@public.gmane.org, David Miller , kafai-b10kYP2dOMg@public.gmane.org, Florian Westphal , harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, "netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Sargun Dhillon , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Alexei Starovoitov Return-path: In-Reply-To: <20161029045107.GA61294-+o4/htvd0TDFYCXBM6kdu7fOX0fSgVTm@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org 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 would be great. But >> when we looked at this patchset we realized it would not be useful for >> accounting purposes because even if a packet is counted here, it might >> still be dropped by netfilter hooks. > > don't use out-of-tree and instead drop using this mechanism or > any other in-kernel method? ;) Getting rid of out-of-tree code is the goal, yes. We do have a requirement that things continue to work, though. Accounting for a packet in ip{,6}_output is not correct if that packet ends up being dropped by iptables later on. > We (facebook infrastructure) have been using iptables and bpf networking > together with great success. They nicely co-exist and complement each other. > There is no need to reinvent the wheel if existing solution works. > iptables are great for their purpose. That doesn't really answer my "what is the use case for egress" question though, right? Or are you saying "we use this, but we can't talk about how we use it"? > there is iptables+cBPF support. It's being used in some cases already. Adding eBPF support to the xt_bpf iptables code would be an option for what we want to do, yes. I think this requires that the eBPF map to be an fd that is available to the process that exec()s iptables, but we could do that.