Re: prog ID and next steps. Was: [RFC net-next 0/2] Introduce bpf_prog ID and iteration

2017-04-29 Thread Hannes Frederic Sowa
Hi, just quickly, because I am on a run: On Sun, Apr 30, 2017, at 04:06, Alexei Starovoitov wrote: > On 4/28/17 2:13 PM, Hannes Frederic Sowa wrote: > > > > Let's assume the following program with a constant key lookup and > > different tables: > > > > action = bpf_map_lookup_elem(, 0); > > if

Re: prog ID and next steps. Was: [RFC net-next 0/2] Introduce bpf_prog ID and iteration

2017-04-29 Thread Alexei Starovoitov
On 4/28/17 2:13 PM, Hannes Frederic Sowa wrote: Let's assume the following program with a constant key lookup and different tables: action = bpf_map_lookup_elem(, 0); if (!*action) return XDP_DROP; else return bpf_redirect(skb->ifindex, 0); It does something completely

Re: prog ID and next steps. Was: [RFC net-next 0/2] Introduce bpf_prog ID and iteration

2017-04-28 Thread Hannes Frederic Sowa
Hello, On 28.04.2017 21:31, Alexei Starovoitov wrote: >> jit on: >> >> perf record -e bpf_redirect -agR >> >> The unwinder walks the stack, extracts address of upper function and >> sends it to user space (perf) or handles it inside the kernel/kallsyms >> (ftrace). >> >> User takes tag of bpf

Re: prog ID and next steps. Was: [RFC net-next 0/2] Introduce bpf_prog ID and iteration

2017-04-28 Thread Alexei Starovoitov
On 4/28/17 4:50 AM, Hannes Frederic Sowa wrote: Hello Alexei, On 28.04.2017 03:11, Alexei Starovoitov wrote: On 4/27/17 6:36 AM, Hannes Frederic Sowa wrote: On 27.04.2017 08:24, Martin KaFai Lau wrote: This patchset introduces the bpf_prog ID and a new bpf cmd to iterate all bpf_prog in the

Re: prog ID and next steps. Was: [RFC net-next 0/2] Introduce bpf_prog ID and iteration

2017-04-28 Thread Hannes Frederic Sowa
On 28.04.2017 20:51, Hannes Frederic Sowa wrote: > Doesn't this break if I have 2 mlx4 cards in the system with different > XDP programs attached? I would have to add an additional parameter to > one of the mlx4 functions to extract the net_device pointer to make the > correlation then. Probably

Re: prog ID and next steps. Was: [RFC net-next 0/2] Introduce bpf_prog ID and iteration

2017-04-28 Thread Hannes Frederic Sowa
Hello, On 28.04.2017 20:24, Daniel Borkmann wrote: > On 04/28/2017 01:50 PM, Hannes Frederic Sowa wrote: >> On 28.04.2017 03:11, Alexei Starovoitov wrote: > [...] >>> i disagree re: kallsyms. The goal of prog_tag is to let program writers >>> understand which program is running in a stable way.

Re: prog ID and next steps. Was: [RFC net-next 0/2] Introduce bpf_prog ID and iteration

2017-04-28 Thread Daniel Borkmann
On 04/28/2017 01:50 PM, Hannes Frederic Sowa wrote: On 28.04.2017 03:11, Alexei Starovoitov wrote: [...] i disagree re: kallsyms. The goal of prog_tag is to let program writers understand which program is running in a stable way. But exactly it doesn't let program writers do that, it just

Re: prog ID and next steps. Was: [RFC net-next 0/2] Introduce bpf_prog ID and iteration

2017-04-28 Thread Hannes Frederic Sowa
Hello Alexei, On 28.04.2017 03:11, Alexei Starovoitov wrote: > On 4/27/17 6:36 AM, Hannes Frederic Sowa wrote: >> On 27.04.2017 08:24, Martin KaFai Lau wrote: >>> This patchset introduces the bpf_prog ID and a new bpf cmd to >>> iterate all bpf_prog in the system. >>> >>> It is still incomplete.

prog ID and next steps. Was: [RFC net-next 0/2] Introduce bpf_prog ID and iteration

2017-04-27 Thread Alexei Starovoitov
On 4/27/17 6:36 AM, Hannes Frederic Sowa wrote: On 27.04.2017 08:24, Martin KaFai Lau wrote: This patchset introduces the bpf_prog ID and a new bpf cmd to iterate all bpf_prog in the system. It is still incomplete. The idea can be extended to bpf_map. Martin KaFai Lau (2): bpf: Introduce