From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754274AbaH2Rjb (ORCPT ); Fri, 29 Aug 2014 13:39:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11610 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753482AbaH2Rj3 (ORCPT ); Fri, 29 Aug 2014 13:39:29 -0400 Message-ID: <5400BAB7.80001@redhat.com> Date: Fri, 29 Aug 2014 19:39:03 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alexei Starovoitov CC: "David S. Miller" , Ingo Molnar , Linus Torvalds , Andy Lutomirski , Steven Rostedt , Chema Gonzalez , Eric Dumazet , Peter Zijlstra , Brendan Gregg , Namhyung Kim , "H. Peter Anvin" , Andrew Morton , Kees Cook , linux-api@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 net-next 2/2] net: filter: split filter.h and expose eBPF to user space References: <1409171833-6979-1-git-send-email-ast@plumgrid.com> <1409171833-6979-3-git-send-email-ast@plumgrid.com> In-Reply-To: <1409171833-6979-3-git-send-email-ast@plumgrid.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/27/2014 10:37 PM, Alexei Starovoitov wrote: > allow user space to generate eBPF programs > > uapi/linux/bpf.h: eBPF instruction set definition > > linux/filter.h: the rest Very sorry for being late, but just a thought since we're touching user space headers anyway ... Wouldn't it be more consistent to have it organized as follows ... - uapi/linux/bpf.h : classic BPF instruction set parts only - uapi/linux/ebpf.h : eBPF instruction set definition (which also includes uapi/linux/bpf.h though) ... and have ... - uapi/linux/filter.h : just include uapi/linux/bpf.h but rest is empty That way, it would be more consistent ... Old legacy application can stay with linux/filter.h; new applications based on their needs can choose between linux/{e,}bpf.h and in the kernel, we can just include linux/ebpf.h. Right now, it seems, an eBPF user space program would need to include 2 header files in user space (linux/filter.h, linux/bpf.h) which I find a bit confusing. If you want, I could also take care of that later, but just thinking out loudly ... > This patch only moves macro definitions, but practically it freezes existing > eBPF instruction set, though new instructions can still be added in the future. > > These eBPF definitions cannot go into uapi/linux/filter.h, since the names > may conflict with existing applications. > > Full eBPF ISA description is in Documentation/networking/filter.txt > > Signed-off-by: Alexei Starovoitov