Re: [PATCH net-next] ebpf: add skb->hash to offset map for usage in {cls,act}_bpf or filters

2015-08-03 Thread Daniel Borkmann
On 08/03/2015 08:16 AM, Alexei Starovoitov wrote: On 8/2/15 6:09 PM, Tom Herbert wrote: I was thinking whether to add skb_get_hash(), but then concluded the >raw skb->hash seems fine in this case: we can directly access the hash >w/o extra eBPF helper function call, it's filled out by many NICs

Re: [PATCH net-next] ebpf: add skb->hash to offset map for usage in {cls,act}_bpf or filters

2015-08-02 Thread Alexei Starovoitov
On 8/2/15 6:09 PM, Tom Herbert wrote: I was thinking whether to add skb_get_hash(), but then concluded the >raw skb->hash seems fine in this case: we can directly access the hash >w/o extra eBPF helper function call, it's filled out by many NICs on >ingress, and in case the entropy level would no

Re: [PATCH net-next] ebpf: add skb->hash to offset map for usage in {cls,act}_bpf or filters

2015-08-02 Thread Tom Herbert
On Fri, Jul 31, 2015 at 3:46 PM, Daniel Borkmann wrote: > Add skb->hash to the __sk_buff offset map, so it can be accessed from > an eBPF program. We currently already do this for classic BPF filters, > but not yet on eBPF, it might be useful as a demuxer in combination with > helpers like bpf_clo

Re: [PATCH net-next] ebpf: add skb->hash to offset map for usage in {cls,act}_bpf or filters

2015-08-02 Thread David Miller
From: Daniel Borkmann Date: Sat, 1 Aug 2015 00:46:29 +0200 > Add skb->hash to the __sk_buff offset map, so it can be accessed from > an eBPF program. We currently already do this for classic BPF filters, > but not yet on eBPF, it might be useful as a demuxer in combination with > helpers like bp

[PATCH net-next] ebpf: add skb->hash to offset map for usage in {cls,act}_bpf or filters

2015-07-31 Thread Daniel Borkmann
Add skb->hash to the __sk_buff offset map, so it can be accessed from an eBPF program. We currently already do this for classic BPF filters, but not yet on eBPF, it might be useful as a demuxer in combination with helpers like bpf_clone_redirect(), toy example: __section("cls-lb") int ingress_ma