Re: libbpf backward compatibility (was: [PATCH bpf-next v5 09/10] bpf: btf: Add BTF support to libbpf)

2018-05-09 Thread Jakub Kicinski
On Wed, 9 May 2018 15:17:12 -0700, Jakub Kicinski wrote: > On Wed, 18 Apr 2018 15:56:05 -0700, Martin KaFai Lau wrote: > > diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h > > index 39f6a0d64a3b..01bda076310f 100644 > > --- a/tools/lib/bpf/bpf.h > > +++ b/tools/lib/bpf/bpf.h > > @@ -26,6

libbpf backward compatibility (was: [PATCH bpf-next v5 09/10] bpf: btf: Add BTF support to libbpf)

2018-05-09 Thread Jakub Kicinski
On Wed, 18 Apr 2018 15:56:05 -0700, Martin KaFai Lau wrote: > diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h > index 39f6a0d64a3b..01bda076310f 100644 > --- a/tools/lib/bpf/bpf.h > +++ b/tools/lib/bpf/bpf.h > @@ -26,6 +26,20 @@ > #include > #include > > +struct bpf_create_map_attr {

[PATCH bpf-next v5 09/10] bpf: btf: Add BTF support to libbpf

2018-04-18 Thread Martin KaFai Lau
If the ".BTF" elf section exists, libbpf will try to create a btf_fd (through BPF_BTF_LOAD). If that fails, it will still continue loading the bpf prog/map without the BTF. If the bpf_object has a BTF loaded, it will create a map with the btf_fd. libbpf will try to figure out the btf_key_id and