Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-20 Thread Andrii Nakryiko
On Thu, Jun 20, 2019 at 2:28 AM Lorenz Bauer wrote: > > On Mon, 17 Jun 2019 at 22:00, Andrii Nakryiko > wrote: > > > In my mind, BPF loaders should be able to pass through BTF to the kernel > > > as a binary blob as much as possible. That's why I want the format to > > > be "self describing". Co

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-20 Thread Lorenz Bauer
On Mon, 17 Jun 2019 at 22:00, Andrii Nakryiko wrote: > > In my mind, BPF loaders should be able to pass through BTF to the kernel > > as a binary blob as much as possible. That's why I want the format to > > be "self describing". Compatibility then becomes a question of: what > > feature are you u

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-17 Thread Andrii Nakryiko
On Mon, Jun 17, 2019 at 2:07 AM Lorenz Bauer wrote: > > On Thu, 6 Jun 2019 at 23:35, Andrii Nakryiko > wrote: > > > > On Thu, Jun 6, 2019 at 9:43 AM Lorenz Bauer wrote: > > > > > > Thanks for sending this RFC! For me, the biggest draw is that map-in-map > > > would be so much nicer to use, plus

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-17 Thread Lorenz Bauer
On Thu, 6 Jun 2019 at 23:35, Andrii Nakryiko wrote: > > On Thu, Jun 6, 2019 at 9:43 AM Lorenz Bauer wrote: > > > > Thanks for sending this RFC! For me, the biggest draw is that map-in-map > > would be so much nicer to use, plus automatic dumping of map values. > > > > Others on the thread have ra

[RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-10 Thread Andrii Nakryiko
This patch adds support for a new way to define BPF maps. It relies on BTF to describe mandatory and optional attributes of a map, as well as captures type information of key and value naturally. This eliminates the need for BPF_ANNOTATE_KV_PAIR hack and ensures key/value sizes are always in sync w

Re: explicit maps. Was: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-10 Thread Andrii Nakryiko
On Sun, Jun 9, 2019 at 6:17 PM Alexei Starovoitov wrote: > > On 6/6/19 6:02 PM, Jakub Kicinski wrote: > > On Fri, 7 Jun 2019 00:27:52 +, Alexei Starovoitov wrote: > >> the solution we're discussing should solve BPF_ANNOTATE_KV_PAIR too. > >> That hack must go. > > > > I see. > > > >> If I unde

Re: explicit maps. Was: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-10 Thread Jakub Kicinski
On Mon, 10 Jun 2019 01:17:13 +, Alexei Starovoitov wrote: > On 6/6/19 6:02 PM, Jakub Kicinski wrote: > > On Fri, 7 Jun 2019 00:27:52 +, Alexei Starovoitov wrote: > >> the solution we're discussing should solve BPF_ANNOTATE_KV_PAIR too. > >> That hack must go. > > > > I see. > > > >>

explicit maps. Was: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-09 Thread Alexei Starovoitov
On 6/6/19 6:02 PM, Jakub Kicinski wrote: > On Fri, 7 Jun 2019 00:27:52 +, Alexei Starovoitov wrote: >> the solution we're discussing should solve BPF_ANNOTATE_KV_PAIR too. >> That hack must go. > > I see. > >> If I understood your objections to Andrii's format is that >> you don't like pointe

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-06 Thread Jakub Kicinski
On Fri, 7 Jun 2019 00:27:52 +, Alexei Starovoitov wrote: > the solution we're discussing should solve BPF_ANNOTATE_KV_PAIR too. > That hack must go. I see. > If I understood your objections to Andrii's format is that > you don't like pointer part of key/value while Andrii explained > why we p

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-06 Thread Alexei Starovoitov
On 6/6/19 5:10 PM, Jakub Kicinski wrote: > On Thu, 6 Jun 2019 23:27:36 +, Alexei Starovoitov wrote: >> On 6/6/19 4:02 PM, Andrii Nakryiko wrote: struct { int type; int max_entries; } my_map __attribute__((map(int,struct my_value))) = { .typ

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-06 Thread Jakub Kicinski
On Thu, 6 Jun 2019 23:27:36 +, Alexei Starovoitov wrote: > On 6/6/19 4:02 PM, Andrii Nakryiko wrote: > >> struct { > >> int type; > >> int max_entries; > >> } my_map __attribute__((map(int,struct my_value))) = { > >> .type = BPF_MAP_TYPE_ARRAY, > >> .max_entr

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-06 Thread Alexei Starovoitov
On 6/6/19 4:02 PM, Andrii Nakryiko wrote: >> struct { >> int type; >> int max_entries; >> } my_map __attribute__((map(int,struct my_value))) = { >> .type = BPF_MAP_TYPE_ARRAY, >> .max_entries = 16, >> }; >> >> Of course this would need BPF backend support, but at

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-06 Thread Andrii Nakryiko
On Thu, Jun 6, 2019 at 2:09 PM Daniel Borkmann wrote: > > On 06/04/2019 07:31 PM, Andrii Nakryiko wrote: > > On Tue, Jun 4, 2019 at 6:45 AM Stanislav Fomichev wrote: > >> On 06/03, Stanislav Fomichev wrote: > BTF is mandatory for _any_ new feature. > >>> If something is easy to support witho

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-06 Thread Andrii Nakryiko
On Thu, Jun 6, 2019 at 9:43 AM Lorenz Bauer wrote: > > Thanks for sending this RFC! For me, the biggest draw is that map-in-map > would be so much nicer to use, plus automatic dumping of map values. > > Others on the thread have raised this point already: not everybody lives > on the bleeding edge

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-06 Thread Daniel Borkmann
On 06/04/2019 07:31 PM, Andrii Nakryiko wrote: > On Tue, Jun 4, 2019 at 6:45 AM Stanislav Fomichev wrote: >> On 06/03, Stanislav Fomichev wrote: BTF is mandatory for _any_ new feature. >>> If something is easy to support without asking everyone to upgrade to >>> a bleeding edge llvm, why not

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-06 Thread Lorenz Bauer
Thanks for sending this RFC! For me, the biggest draw is that map-in-map would be so much nicer to use, plus automatic dumping of map values. Others on the thread have raised this point already: not everybody lives on the bleeding edge or can control all of their dependencies. To me this means tha

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-04 Thread Andrii Nakryiko
On Tue, Jun 4, 2019 at 2:07 PM Stanislav Fomichev wrote: > > On 06/04, Andrii Nakryiko wrote: > > On Tue, Jun 4, 2019 at 6:45 AM Stanislav Fomichev wrote: > > > > > > On 06/03, Stanislav Fomichev wrote: > > > > > BTF is mandatory for _any_ new feature. > > > > If something is easy to support with

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-04 Thread Stanislav Fomichev
On 06/04, Andrii Nakryiko wrote: > On Tue, Jun 4, 2019 at 6:45 AM Stanislav Fomichev wrote: > > > > On 06/03, Stanislav Fomichev wrote: > > > > BTF is mandatory for _any_ new feature. > > > If something is easy to support without asking everyone to upgrade to > > > a bleeding edge llvm, why not do

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-04 Thread Andrii Nakryiko
On Tue, Jun 4, 2019 at 6:45 AM Stanislav Fomichev wrote: > > On 06/03, Stanislav Fomichev wrote: > > > BTF is mandatory for _any_ new feature. > > If something is easy to support without asking everyone to upgrade to > > a bleeding edge llvm, why not do it? > > So much for backwards compatibility

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-04 Thread Stanislav Fomichev
On 06/03, Stanislav Fomichev wrote: > > BTF is mandatory for _any_ new feature. > If something is easy to support without asking everyone to upgrade to > a bleeding edge llvm, why not do it? > So much for backwards compatibility and flexibility. > > > It's for introspection and debuggability in th

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-03 Thread Stanislav Fomichev
> BTF is mandatory for _any_ new feature. If something is easy to support without asking everyone to upgrade to a bleeding edge llvm, why not do it? So much for backwards compatibility and flexibility. > It's for introspection and debuggability in the first place. > Good debugging is not optional.

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-03 Thread Alexei Starovoitov
On 6/3/19 6:02 PM, Stanislav Fomichev wrote: > Do we want to lock everyone out of new libbpf features? BTF is mandatory for _any_ new feature. It's for introspection and debuggability in the first place. Good debugging is not optional.

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-03 Thread Stanislav Fomichev
On 06/03, Andrii Nakryiko wrote: > On Mon, Jun 3, 2019 at 9:32 AM Stanislav Fomichev wrote: > > > > On 05/31, Andrii Nakryiko wrote: > > > On Fri, May 31, 2019 at 2:28 PM Stanislav Fomichev > > > wrote: > > > > > > > > On 05/31, Andrii Nakryiko wrote: > > > > > This patch adds support for a new

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-03 Thread Jakub Kicinski
On Mon, 3 Jun 2019 14:54:53 -0700, Andrii Nakryiko wrote: > On Sun, Jun 2, 2019 at 5:33 PM Jakub Kicinski wrote: > > On Fri, 31 May 2019 15:58:41 -0700, Andrii Nakryiko wrote: > > > On Fri, May 31, 2019 at 2:28 PM Stanislav Fomichev > > > wrote: > > > > On 05/31, Andrii Nakryiko wrote: > >

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-03 Thread Andrii Nakryiko
On Fri, May 31, 2019 at 1:21 PM Andrii Nakryiko wrote: > > This patch adds support for a new way to define BPF maps. It relies on > BTF to describe mandatory and optional attributes of a map, as well as > captures type information of key and value naturally. This eliminates > the need for BPF_ANNO

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-03 Thread Andrii Nakryiko
On Mon, Jun 3, 2019 at 9:32 AM Stanislav Fomichev wrote: > > On 05/31, Andrii Nakryiko wrote: > > On Fri, May 31, 2019 at 2:28 PM Stanislav Fomichev wrote: > > > > > > On 05/31, Andrii Nakryiko wrote: > > > > This patch adds support for a new way to define BPF maps. It relies on > > > > BTF to de

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-03 Thread Andrii Nakryiko
On Sun, Jun 2, 2019 at 5:33 PM Jakub Kicinski wrote: > > On Fri, 31 May 2019 15:58:41 -0700, Andrii Nakryiko wrote: > > On Fri, May 31, 2019 at 2:28 PM Stanislav Fomichev wrote: > > > On 05/31, Andrii Nakryiko wrote: > > > > This patch adds support for a new way to define BPF maps. It relies on >

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-03 Thread Stanislav Fomichev
On 05/31, Andrii Nakryiko wrote: > On Fri, May 31, 2019 at 2:28 PM Stanislav Fomichev wrote: > > > > On 05/31, Andrii Nakryiko wrote: > > > This patch adds support for a new way to define BPF maps. It relies on > > > BTF to describe mandatory and optional attributes of a map, as well as > > > capt

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-02 Thread Jakub Kicinski
On Fri, 31 May 2019 15:58:41 -0700, Andrii Nakryiko wrote: > On Fri, May 31, 2019 at 2:28 PM Stanislav Fomichev wrote: > > On 05/31, Andrii Nakryiko wrote: > > > This patch adds support for a new way to define BPF maps. It relies on > > > BTF to describe mandatory and optional attributes of a ma

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-05-31 Thread Andrii Nakryiko
On Fri, May 31, 2019 at 2:28 PM Stanislav Fomichev wrote: > > On 05/31, Andrii Nakryiko wrote: > > This patch adds support for a new way to define BPF maps. It relies on > > BTF to describe mandatory and optional attributes of a map, as well as > > captures type information of key and value natura

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-05-31 Thread Stanislav Fomichev
On 05/31, Andrii Nakryiko wrote: > This patch adds support for a new way to define BPF maps. It relies on > BTF to describe mandatory and optional attributes of a map, as well as > captures type information of key and value naturally. This eliminates > the need for BPF_ANNOTATE_KV_PAIR hack and ens

[RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-05-31 Thread Andrii Nakryiko
This patch adds support for a new way to define BPF maps. It relies on BTF to describe mandatory and optional attributes of a map, as well as captures type information of key and value naturally. This eliminates the need for BPF_ANNOTATE_KV_PAIR hack and ensures key/value sizes are always in sync w