Re: [PATCH bpf-next v4 4/9] tools: bpftool: add probes for eBPF program types

2019-01-17 Thread Quentin Monnet
2019-01-16 16:42 UTC-0800 ~ Jakub Kicinski > On Wed, 16 Jan 2019 14:21:14 +, Quentin Monnet wrote: >> +bool bpf_probe_prog_type(enum bpf_prog_type prog_type, __u32 ifindex) >> +{ >> +struct bpf_insn insns[2] = { >> +BPF_MOV64_IMM(BPF_REG_0, 0), >> +BPF_EXIT_INSN()

Re: [PATCH bpf-next v4 4/9] tools: bpftool: add probes for eBPF program types

2019-01-17 Thread Quentin Monnet
2019-01-17 10:27 UTC+0100 ~ Daniel Borkmann On 01/17/2019 01:42 AM, Jakub Kicinski wrote: On Wed, 16 Jan 2019 14:21:14 +, Quentin Monnet wrote: diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index cd02cd4e2cc3..6355e4c80a86 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tool

Re: [PATCH bpf-next v4 4/9] tools: bpftool: add probes for eBPF program types

2019-01-17 Thread Daniel Borkmann
On 01/17/2019 01:42 AM, Jakub Kicinski wrote: > On Wed, 16 Jan 2019 14:21:14 +, Quentin Monnet wrote: >> diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map >> index cd02cd4e2cc3..6355e4c80a86 100644 >> --- a/tools/lib/bpf/libbpf.map >> +++ b/tools/lib/bpf/libbpf.map >> @@ -56,6 +5

Re: [PATCH bpf-next v4 4/9] tools: bpftool: add probes for eBPF program types

2019-01-16 Thread Jakub Kicinski
On Wed, 16 Jan 2019 14:21:14 +, Quentin Monnet wrote: > diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map > index cd02cd4e2cc3..6355e4c80a86 100644 > --- a/tools/lib/bpf/libbpf.map > +++ b/tools/lib/bpf/libbpf.map > @@ -56,6 +56,7 @@ LIBBPF_0.0.1 { > bpf_object__unp

[PATCH bpf-next v4 4/9] tools: bpftool: add probes for eBPF program types

2019-01-16 Thread Quentin Monnet
Introduce probes for supported BPF program types in libbpf, and call it from bpftool to test what types are available on the system. The probe simply consists in loading a very basic program of that type and see if the verifier complains or not. Sample output: # bpftool feature probe kernel