Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread Daniel Mack
On 09/05/2016 08:32 PM, Alexei Starovoitov wrote: > On 9/5/16 10:09 AM, Daniel Borkmann wrote: >> On 09/05/2016 04:09 PM, Daniel Mack wrote: >>> I really don't think it's worth sparing 8 bytes here and then do the >>> binary compat dance after flags are added, for no real gain. >> >> Sure, but the

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread Alexei Starovoitov
On 9/5/16 10:09 AM, Daniel Borkmann wrote: On 09/05/2016 04:09 PM, Daniel Mack wrote: On 09/05/2016 03:56 PM, Daniel Borkmann wrote: On 09/05/2016 02:54 PM, Daniel Mack wrote: On 08/30/2016 01:00 AM, Daniel Borkmann wrote: On 08/26/2016 09:58 PM, Daniel Mack wrote: enum bpf_map_type {

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread Joe Perches
On Mon, 2016-09-05 at 14:56 +0200, Daniel Mack wrote: > On 08/27/2016 02:08 AM, Alexei Starovoitov wrote: [] > > + switch (attr->attach_type) { > > + case BPF_ATTACH_TYPE_CGROUP_INET_INGRESS: > > + case BPF_ATTACH_TYPE_CGROUP_INET_EGRESS: { > > + struct cgroup *cgrp; > > + > > +

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread Daniel Borkmann
On 09/05/2016 04:09 PM, Daniel Mack wrote: On 09/05/2016 03:56 PM, Daniel Borkmann wrote: On 09/05/2016 02:54 PM, Daniel Mack wrote: On 08/30/2016 01:00 AM, Daniel Borkmann wrote: On 08/26/2016 09:58 PM, Daniel Mack wrote: enum bpf_map_type { @@ -147,6 +149,13 @@ union bpf_attr {

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread Daniel Mack
On 09/05/2016 05:30 PM, David Laight wrote: > From: Daniel Mack + + struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */ + __u32 target_fd; /* container object to attach to */ + __u32 attach_bpf_fd; /* eBPF pr

RE: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread David Laight
From: Daniel Mack > >> + > >> + struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */ > >> + __u32 target_fd; /* container object to attach > >> to */ > >> + __u32 attach_bpf_fd; /* eBPF program to attach */ > >> + __u32

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread Daniel Mack
On 09/05/2016 03:56 PM, Daniel Borkmann wrote: > On 09/05/2016 02:54 PM, Daniel Mack wrote: >> On 08/30/2016 01:00 AM, Daniel Borkmann wrote: >>> On 08/26/2016 09:58 PM, Daniel Mack wrote: >> enum bpf_map_type { @@ -147,6 +149,13 @@ union bpf_attr { __aligned_u6

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread Daniel Borkmann
On 09/05/2016 02:54 PM, Daniel Mack wrote: On 08/30/2016 01:00 AM, Daniel Borkmann wrote: On 08/26/2016 09:58 PM, Daniel Mack wrote: enum bpf_map_type { @@ -147,6 +149,13 @@ union bpf_attr { __aligned_u64 pathname; __u32 bpf_fd; }; + +

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread Daniel Mack
On 08/27/2016 02:08 AM, Alexei Starovoitov wrote: > On Fri, Aug 26, 2016 at 09:58:49PM +0200, Daniel Mack wrote: >> + >> +struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */ >> +__u32 target_fd; /* container object to attach >> to */ >> +

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread Daniel Mack
On 08/30/2016 01:00 AM, Daniel Borkmann wrote: > On 08/26/2016 09:58 PM, Daniel Mack wrote: >> enum bpf_map_type { >> @@ -147,6 +149,13 @@ union bpf_attr { >> __aligned_u64 pathname; >> __u32 bpf_fd; >> }; >> + >> +struct { /* anonymous struct used

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-08-29 Thread Daniel Borkmann
On 08/26/2016 09:58 PM, Daniel Mack wrote: Extend the bpf(2) syscall by two new commands, BPF_PROG_ATTACH and BPF_PROG_DETACH which allow attaching and detaching eBPF programs to a target. On the API level, the target could be anything that has an fd in userspace, hence the name of the field in

Re: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-08-26 Thread Alexei Starovoitov
On Fri, Aug 26, 2016 at 09:58:49PM +0200, Daniel Mack wrote: > Extend the bpf(2) syscall by two new commands, BPF_PROG_ATTACH and > BPF_PROG_DETACH which allow attaching and detaching eBPF programs > to a target. > > On the API level, the target could be anything that has an fd in > userspace, hen