Re: [PATCH RFC net-next 13/14] samples: bpf: example of stateful socket filtering

2014-06-28 Thread Alexei Starovoitov
On Fri, Jun 27, 2014 at 5:21 PM, Andy Lutomirski wrote: > On Fri, Jun 27, 2014 at 5:06 PM, Alexei Starovoitov wrote: >> this socket filter example does: >> >> - creates a hashtable in kernel with key 4 bytes and value 8 bytes >> >> - populates map[6] = 0; map[17] = 0; // 6 - tcp_proto, 17 -

Re: [PATCH RFC net-next 13/14] samples: bpf: example of stateful socket filtering

2014-06-28 Thread Alexei Starovoitov
On Fri, Jun 27, 2014 at 5:21 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 5:06 PM, Alexei Starovoitov a...@plumgrid.com wrote: this socket filter example does: - creates a hashtable in kernel with key 4 bytes and value 8 bytes - populates map[6] = 0; map[17] = 0;

Re: [PATCH RFC net-next 13/14] samples: bpf: example of stateful socket filtering

2014-06-27 Thread Andy Lutomirski
On Fri, Jun 27, 2014 at 5:06 PM, Alexei Starovoitov wrote: > this socket filter example does: > > - creates a hashtable in kernel with key 4 bytes and value 8 bytes > > - populates map[6] = 0; map[17] = 0; // 6 - tcp_proto, 17 - udp_proto > > - loads eBPF program: > r0 = skb[14 + 9]; // load

[PATCH RFC net-next 13/14] samples: bpf: example of stateful socket filtering

2014-06-27 Thread Alexei Starovoitov
this socket filter example does: - creates a hashtable in kernel with key 4 bytes and value 8 bytes - populates map[6] = 0; map[17] = 0; // 6 - tcp_proto, 17 - udp_proto - loads eBPF program: r0 = skb[14 + 9]; // load one byte of ip->proto *(u32*)(fp - 4) = r0; value =

[PATCH RFC net-next 13/14] samples: bpf: example of stateful socket filtering

2014-06-27 Thread Alexei Starovoitov
this socket filter example does: - creates a hashtable in kernel with key 4 bytes and value 8 bytes - populates map[6] = 0; map[17] = 0; // 6 - tcp_proto, 17 - udp_proto - loads eBPF program: r0 = skb[14 + 9]; // load one byte of ip-proto *(u32*)(fp - 4) = r0; value =

Re: [PATCH RFC net-next 13/14] samples: bpf: example of stateful socket filtering

2014-06-27 Thread Andy Lutomirski
On Fri, Jun 27, 2014 at 5:06 PM, Alexei Starovoitov a...@plumgrid.com wrote: this socket filter example does: - creates a hashtable in kernel with key 4 bytes and value 8 bytes - populates map[6] = 0; map[17] = 0; // 6 - tcp_proto, 17 - udp_proto - loads eBPF program: r0 = skb[14 + 9];