Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-24 Thread Daniel Borkmann
On 06/23/2014 11:57 PM, Alexei Starovoitov wrote: On Fri, Jun 20, 2014 at 9:44 AM, Chema Gonzalez wrote: ... - nop: I'd like to have a nop. Do I know why? Nope. nope. Let's not add unnecessary instructions. A valid nop is a useful instruction: padding, filling up arrays of

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-24 Thread Daniel Borkmann
On 06/23/2014 11:57 PM, Alexei Starovoitov wrote: On Fri, Jun 20, 2014 at 9:44 AM, Chema Gonzalez ch...@google.com wrote: ... - nop: I'd like to have a nop. Do I know why? Nope. nope. Let's not add unnecessary instructions. A valid nop is a useful instruction: padding, filling up arrays

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-23 Thread Alexei Starovoitov
On Fri, Jun 20, 2014 at 9:44 AM, Chema Gonzalez wrote: >> >> Model eBPF based on MIPS ISA? Ouch. >> That would be one ugly ISA that is not JITable on x64. > > Definitely I wasn't making my point clear: IMO if we're redesigning > the BPF ISA, we should get a clean one (clean=something that is

RE: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-23 Thread David Laight
From: Chema Gonzalez ... > 4.5. BPF_ST|BPF_MEM > Operation: *(size *) (dst_reg + off16) = imm32 > > This insn encodes 2 immediate values (the offset and the imm32 value) > in the insn, and actually forces the sock_filter_int 64-bit struct to > have both a 16-bit offset field and a 32-bit

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-23 Thread Alexei Starovoitov
On Fri, Jun 20, 2014 at 9:44 AM, Chema Gonzalez ch...@google.com wrote: Model eBPF based on MIPS ISA? Ouch. That would be one ugly ISA that is not JITable on x64. Definitely I wasn't making my point clear: IMO if we're redesigning the BPF ISA, we should get a clean one (clean=something that

RE: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-23 Thread David Laight
From: Chema Gonzalez ... 4.5. BPF_ST|BPF_MEM Operation: *(size *) (dst_reg + off16) = imm32 This insn encodes 2 immediate values (the offset and the imm32 value) in the insn, and actually forces the sock_filter_int 64-bit struct to have both a 16-bit offset field and a 32-bit immediate

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-20 Thread Chema Gonzalez
[Sorry for the delay in the answer. Been mired somewhere else.] On Tue, Jun 3, 2014 at 5:38 PM, Alexei Starovoitov wrote: > On Tue, Jun 3, 2014 at 2:40 PM, Chema Gonzalez wrote: >> First of all, and just to join the crowd, kernel/bpf/ FTW. >> >> Now, I have some suggestions about eBPF. IMO

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-20 Thread Chema Gonzalez
[Sorry for the delay in the answer. Been mired somewhere else.] On Tue, Jun 3, 2014 at 5:38 PM, Alexei Starovoitov a...@plumgrid.com wrote: On Tue, Jun 3, 2014 at 2:40 PM, Chema Gonzalez ch...@google.com wrote: First of all, and just to join the crowd, kernel/bpf/ FTW. Now, I have some

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 2:40 PM, Chema Gonzalez wrote: > First of all, and just to join the crowd, kernel/bpf/ FTW. > > Now, I have some suggestions about eBPF. IMO classic BPF is an ISA > oriented to filter (meaning returning a single integer that states how > many bytes of the packet must be

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Chema Gonzalez
First of all, and just to join the crowd, kernel/bpf/ FTW. Now, I have some suggestions about eBPF. IMO classic BPF is an ISA oriented to filter (meaning returning a single integer that states how many bytes of the packet must be captured) packets (e.g. consider the 6 load modes, where 3 provide

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 1:35 PM, Daniel Borkmann wrote: > On 06/03/2014 05:44 PM, Alexei Starovoitov wrote: > ... >> >> All of your points are valid. They are right questions to ask. I just >> >> don't see why you're still arguing about first step of filter.c split, >> whereas your concerns are

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Daniel Borkmann
On 06/03/2014 05:44 PM, Alexei Starovoitov wrote: ... All of your points are valid. They are right questions to ask. I just don't see why you're still arguing about first step of filter.c split, whereas your concerns are about steps 2, 3, 4. Fair enough, lets keep them in mind though for

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Ingo Molnar
* Alexei Starovoitov wrote: > On Mon, Jun 2, 2014 at 7:16 AM, Arnaldo Carvalho de Melo > wrote: > > Em Mon, Jun 02, 2014 at 09:24:56AM -0400, Steven Rostedt escreveu: > >> On Mon, 2 Jun 2014 08:15:45 -0500 > >> Jonathan Corbet wrote: > > > >> > On Mon, 2 Jun 2014 00:01:44 -0700 > >> > Alexei

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 1:56 AM, Daniel Borkmann wrote: > On 06/02/2014 09:02 PM, Alexei Starovoitov wrote: > ... >> >> Classic has all sorts of hard coded assumptions. The whole >> >> concept of 'load from magic constant' to mean different things >> is flawed. We all got used to it and now think

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Daniel Borkmann
On 06/02/2014 09:02 PM, Alexei Starovoitov wrote: ... Classic has all sorts of hard coded assumptions. The whole concept of 'load from magic constant' to mean different things is flawed. We all got used to it and now think that it's normal for "ld_abs -4056" to mean "a ^= x" I think everyone

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Daniel Borkmann
On 06/02/2014 09:02 PM, Alexei Starovoitov wrote: ... Classic has all sorts of hard coded assumptions. The whole concept of 'load from magic constant' to mean different things is flawed. We all got used to it and now think that it's normal for ld_abs -4056 to mean a ^= x I think everyone knows

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 1:56 AM, Daniel Borkmann dbork...@redhat.com wrote: On 06/02/2014 09:02 PM, Alexei Starovoitov wrote: ... Classic has all sorts of hard coded assumptions. The whole concept of 'load from magic constant' to mean different things is flawed. We all got used to it and now

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Ingo Molnar
* Alexei Starovoitov a...@plumgrid.com wrote: On Mon, Jun 2, 2014 at 7:16 AM, Arnaldo Carvalho de Melo a...@kernel.org wrote: Em Mon, Jun 02, 2014 at 09:24:56AM -0400, Steven Rostedt escreveu: On Mon, 2 Jun 2014 08:15:45 -0500 Jonathan Corbet cor...@lwn.net wrote: On Mon, 2 Jun

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Daniel Borkmann
On 06/03/2014 05:44 PM, Alexei Starovoitov wrote: ... All of your points are valid. They are right questions to ask. I just don't see why you're still arguing about first step of filter.c split, whereas your concerns are about steps 2, 3, 4. Fair enough, lets keep them in mind though for

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 1:35 PM, Daniel Borkmann dbork...@redhat.com wrote: On 06/03/2014 05:44 PM, Alexei Starovoitov wrote: ... All of your points are valid. They are right questions to ask. I just don't see why you're still arguing about first step of filter.c split, whereas your concerns

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Chema Gonzalez
First of all, and just to join the crowd, kernel/bpf/ FTW. Now, I have some suggestions about eBPF. IMO classic BPF is an ISA oriented to filter (meaning returning a single integer that states how many bytes of the packet must be captured) packets (e.g. consider the 6 load modes, where 3 provide

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 2:40 PM, Chema Gonzalez ch...@google.com wrote: First of all, and just to join the crowd, kernel/bpf/ FTW. Now, I have some suggestions about eBPF. IMO classic BPF is an ISA oriented to filter (meaning returning a single integer that states how many bytes of the packet

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
On Mon, Jun 2, 2014 at 10:04 AM, Daniel Borkmann wrote: > On 06/02/2014 05:41 PM, Alexei Starovoitov wrote: > ... > >> Glad you brought up this point :) >> 100% agree that current double verification done by seccomp is far from >> being generic and quite hard to maintain, since any change done to

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Daniel Borkmann
On 06/02/2014 05:41 PM, Alexei Starovoitov wrote: ... Glad you brought up this point :) 100% agree that current double verification done by seccomp is far from being generic and quite hard to maintain, since any change done to classic BPF verifier needs to be thought through from

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
On Mon, Jun 2, 2014 at 1:57 AM, Daniel Borkmann wrote: > On 06/02/2014 09:01 AM, Alexei Starovoitov wrote: >> >> This patch set splits BPF out of core networking into generic component >> >> patch #1 splits filter.c into two logical pieces: generic BPF core and >> socket >> filters. It only moves

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
On Mon, Jun 2, 2014 at 7:16 AM, Arnaldo Carvalho de Melo wrote: > Em Mon, Jun 02, 2014 at 09:24:56AM -0400, Steven Rostedt escreveu: >> On Mon, 2 Jun 2014 08:15:45 -0500 >> Jonathan Corbet wrote: > >> > On Mon, 2 Jun 2014 00:01:44 -0700 >> > Alexei Starovoitov wrote: > >> > > This patch set

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Arnaldo Carvalho de Melo
Em Mon, Jun 02, 2014 at 09:24:56AM -0400, Steven Rostedt escreveu: > On Mon, 2 Jun 2014 08:15:45 -0500 > Jonathan Corbet wrote: > > On Mon, 2 Jun 2014 00:01:44 -0700 > > Alexei Starovoitov wrote: > > > This patch set splits BPF out of core networking into generic component > > Quick,

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Steven Rostedt
On Mon, 2 Jun 2014 08:15:45 -0500 Jonathan Corbet wrote: > On Mon, 2 Jun 2014 00:01:44 -0700 > Alexei Starovoitov wrote: > > > This patch set splits BPF out of core networking into generic component > > Quick, probably dumb question: if you're going to split it out, why not > split it out

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Jonathan Corbet
On Mon, 2 Jun 2014 00:01:44 -0700 Alexei Starovoitov wrote: > This patch set splits BPF out of core networking into generic component Quick, probably dumb question: if you're going to split it out, why not split it out entirely, into kernel/ or (perhaps better) lib/? The whole point seems to

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Daniel Borkmann
On 06/02/2014 09:01 AM, Alexei Starovoitov wrote: This patch set splits BPF out of core networking into generic component patch #1 splits filter.c into two logical pieces: generic BPF core and socket filters. It only moves functions around. No real changes. patch #2 adds hidden CONFIG_BPF that

[PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
This patch set splits BPF out of core networking into generic component patch #1 splits filter.c into two logical pieces: generic BPF core and socket filters. It only moves functions around. No real changes. patch #2 adds hidden CONFIG_BPF that seccomp/tracing can select The main value of the

[PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
This patch set splits BPF out of core networking into generic component patch #1 splits filter.c into two logical pieces: generic BPF core and socket filters. It only moves functions around. No real changes. patch #2 adds hidden CONFIG_BPF that seccomp/tracing can select The main value of the

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Daniel Borkmann
On 06/02/2014 09:01 AM, Alexei Starovoitov wrote: This patch set splits BPF out of core networking into generic component patch #1 splits filter.c into two logical pieces: generic BPF core and socket filters. It only moves functions around. No real changes. patch #2 adds hidden CONFIG_BPF that

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Jonathan Corbet
On Mon, 2 Jun 2014 00:01:44 -0700 Alexei Starovoitov a...@plumgrid.com wrote: This patch set splits BPF out of core networking into generic component Quick, probably dumb question: if you're going to split it out, why not split it out entirely, into kernel/ or (perhaps better) lib/? The whole

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Steven Rostedt
On Mon, 2 Jun 2014 08:15:45 -0500 Jonathan Corbet cor...@lwn.net wrote: On Mon, 2 Jun 2014 00:01:44 -0700 Alexei Starovoitov a...@plumgrid.com wrote: This patch set splits BPF out of core networking into generic component Quick, probably dumb question: if you're going to split it out,

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Arnaldo Carvalho de Melo
Em Mon, Jun 02, 2014 at 09:24:56AM -0400, Steven Rostedt escreveu: On Mon, 2 Jun 2014 08:15:45 -0500 Jonathan Corbet cor...@lwn.net wrote: On Mon, 2 Jun 2014 00:01:44 -0700 Alexei Starovoitov a...@plumgrid.com wrote: This patch set splits BPF out of core networking into generic

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
On Mon, Jun 2, 2014 at 7:16 AM, Arnaldo Carvalho de Melo a...@kernel.org wrote: Em Mon, Jun 02, 2014 at 09:24:56AM -0400, Steven Rostedt escreveu: On Mon, 2 Jun 2014 08:15:45 -0500 Jonathan Corbet cor...@lwn.net wrote: On Mon, 2 Jun 2014 00:01:44 -0700 Alexei Starovoitov a...@plumgrid.com

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
On Mon, Jun 2, 2014 at 1:57 AM, Daniel Borkmann dbork...@redhat.com wrote: On 06/02/2014 09:01 AM, Alexei Starovoitov wrote: This patch set splits BPF out of core networking into generic component patch #1 splits filter.c into two logical pieces: generic BPF core and socket filters. It only

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Daniel Borkmann
On 06/02/2014 05:41 PM, Alexei Starovoitov wrote: ... Glad you brought up this point :) 100% agree that current double verification done by seccomp is far from being generic and quite hard to maintain, since any change done to classic BPF verifier needs to be thought through from

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
On Mon, Jun 2, 2014 at 10:04 AM, Daniel Borkmann dbork...@redhat.com wrote: On 06/02/2014 05:41 PM, Alexei Starovoitov wrote: ... Glad you brought up this point :) 100% agree that current double verification done by seccomp is far from being generic and quite hard to maintain, since any