bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BPF program metadata
@ 2020-07-29 16:27 sdf
  2020-08-04 19:42 ` sdf
  0 siblings, 1 reply; 5+ messages in thread
From: sdf @ 2020-07-29 16:27 UTC (permalink / raw)
  To: bpf; +Cc: ast, daniel, andriin, zhuyifei, maheshb

As discussed in
https://docs.google.com/presentation/d/1A9Anx8JPHl_pK1aXy8hlxs3V5pkrKwHHtkPf_-HeYTc
during BPF office hours, we'd like to attach arbitrary auxiliary
metadata to the program, for example, the build timestamp or the commit
hash.

IIRC, the suggestion was to explore BTF and .BTF.ext section in
particular.
We've spent some time looking at the BTF encoding and BTF.ext section
and we don't see how we can put this data into .BTF.ext or even .BTF
without any kernel changes.

The reasoning (at least how we see it):
* .BTF.ext is just a container with func_info/line_info/relocation_info
   and libbpf extracts the data form this section and passes it to
   sys_bpf(BPF_PROG_LOAD); the important note is that it doesn't pass the
   whole container to the kernel, but passes the data that's been
   extracted from the appropriate sections
* .BTF can be used for metadata, but it looks like we'd have to add
   another BTF_INFO_KIND() to make it a less messy (YiFei, feel free to
   correct me)

So the question is: are we missing something? Is there some way to add
key=value metadata to BTF that doesn't involve a lot of kernel changes?

If the restrictions above are correct, should we go back to trying to
put this metadata into .data section (or maybe even the new .metadata
section)? The only missing piece of the puzzle in that case is the
ability to extend BPF_PROG_LOAD with a way to say 'hold this map
unconditionally'.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: BPF program metadata
  2020-07-29 16:27 BPF program metadata sdf
@ 2020-08-04 19:42 ` sdf
  2020-08-05 22:44   ` Alexei Starovoitov
  0 siblings, 1 reply; 5+ messages in thread
From: sdf @ 2020-08-04 19:42 UTC (permalink / raw)
  To: bpf; +Cc: ast, daniel, andriin, zhuyifei, maheshb

On 07/29, sdf@google.com wrote:
> As discussed in
> https://docs.google.com/presentation/d/1A9Anx8JPHl_pK1aXy8hlxs3V5pkrKwHHtkPf_-HeYTc
> during BPF office hours, we'd like to attach arbitrary auxiliary
> metadata to the program, for example, the build timestamp or the commit
> hash.

> IIRC, the suggestion was to explore BTF and .BTF.ext section in
> particular.
> We've spent some time looking at the BTF encoding and BTF.ext section
> and we don't see how we can put this data into .BTF.ext or even .BTF
> without any kernel changes.

> The reasoning (at least how we see it):
> * .BTF.ext is just a container with func_info/line_info/relocation_info
>    and libbpf extracts the data form this section and passes it to
>    sys_bpf(BPF_PROG_LOAD); the important note is that it doesn't pass the
>    whole container to the kernel, but passes the data that's been
>    extracted from the appropriate sections
> * .BTF can be used for metadata, but it looks like we'd have to add
>    another BTF_INFO_KIND() to make it a less messy (YiFei, feel free to
>    correct me)

> So the question is: are we missing something? Is there some way to add
> key=value metadata to BTF that doesn't involve a lot of kernel changes?

> If the restrictions above are correct, should we go back to trying to
> put this metadata into .data section (or maybe even the new .metadata
> section)? The only missing piece of the puzzle in that case is the
> ability to extend BPF_PROG_LOAD with a way to say 'hold this map
> unconditionally'.
Should we have a short discussion about that this Thu during the office
hours? I don't see this week's sheet page in there yet :-(

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: BPF program metadata
  2020-08-04 19:42 ` sdf
@ 2020-08-05 22:44   ` Alexei Starovoitov
  2020-08-05 23:10     ` sdf
  0 siblings, 1 reply; 5+ messages in thread
From: Alexei Starovoitov @ 2020-08-05 22:44 UTC (permalink / raw)
  To: Stanislav Fomichev
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	YiFei Zhu, Mahesh Bandewar

On Tue, Aug 4, 2020 at 12:42 PM <sdf@google.com> wrote:
>
> On 07/29, sdf@google.com wrote:
> > As discussed in
> > https://docs.google.com/presentation/d/1A9Anx8JPHl_pK1aXy8hlxs3V5pkrKwHHtkPf_-HeYTc
> > during BPF office hours, we'd like to attach arbitrary auxiliary
> > metadata to the program, for example, the build timestamp or the commit
> > hash.
>
> > IIRC, the suggestion was to explore BTF and .BTF.ext section in
> > particular.
> > We've spent some time looking at the BTF encoding and BTF.ext section
> > and we don't see how we can put this data into .BTF.ext or even .BTF
> > without any kernel changes.
>
> > The reasoning (at least how we see it):
> > * .BTF.ext is just a container with func_info/line_info/relocation_info
> >    and libbpf extracts the data form this section and passes it to
> >    sys_bpf(BPF_PROG_LOAD); the important note is that it doesn't pass the
> >    whole container to the kernel, but passes the data that's been
> >    extracted from the appropriate sections
> > * .BTF can be used for metadata, but it looks like we'd have to add
> >    another BTF_INFO_KIND() to make it a less messy (YiFei, feel free to
> >    correct me)
>
> > So the question is: are we missing something? Is there some way to add
> > key=value metadata to BTF that doesn't involve a lot of kernel changes?
>
> > If the restrictions above are correct, should we go back to trying to
> > put this metadata into .data section (or maybe even the new .metadata
> > section)? The only missing piece of the puzzle in that case is the
> > ability to extend BPF_PROG_LOAD with a way to say 'hold this map
> > unconditionally'.
> Should we have a short discussion about that this Thu during the office
> hours?

Of course. That's what office hours are for.
Since google folks have trouble with zoom I've added google meets link
to the spreadsheet. Let's try it tomorrow.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: BPF program metadata
  2020-08-05 22:44   ` Alexei Starovoitov
@ 2020-08-05 23:10     ` sdf
  2020-08-06 17:06       ` BPF office hours via google meet. Was: " Alexei Starovoitov
  0 siblings, 1 reply; 5+ messages in thread
From: sdf @ 2020-08-05 23:10 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	YiFei Zhu, Mahesh Bandewar

On 08/05, Alexei Starovoitov wrote:
> On Tue, Aug 4, 2020 at 12:42 PM <sdf@google.com> wrote:
> >
> > On 07/29, sdf@google.com wrote:
> > > As discussed in
> > >  
> https://docs.google.com/presentation/d/1A9Anx8JPHl_pK1aXy8hlxs3V5pkrKwHHtkPf_-HeYTc
> > > during BPF office hours, we'd like to attach arbitrary auxiliary
> > > metadata to the program, for example, the build timestamp or the  
> commit
> > > hash.
> >
> > > IIRC, the suggestion was to explore BTF and .BTF.ext section in
> > > particular.
> > > We've spent some time looking at the BTF encoding and BTF.ext section
> > > and we don't see how we can put this data into .BTF.ext or even .BTF
> > > without any kernel changes.
> >
> > > The reasoning (at least how we see it):
> > > * .BTF.ext is just a container with  
> func_info/line_info/relocation_info
> > >    and libbpf extracts the data form this section and passes it to
> > >    sys_bpf(BPF_PROG_LOAD); the important note is that it doesn't pass  
> the
> > >    whole container to the kernel, but passes the data that's been
> > >    extracted from the appropriate sections
> > > * .BTF can be used for metadata, but it looks like we'd have to add
> > >    another BTF_INFO_KIND() to make it a less messy (YiFei, feel free  
> to
> > >    correct me)
> >
> > > So the question is: are we missing something? Is there some way to add
> > > key=value metadata to BTF that doesn't involve a lot of kernel  
> changes?
> >
> > > If the restrictions above are correct, should we go back to trying to
> > > put this metadata into .data section (or maybe even the new .metadata
> > > section)? The only missing piece of the puzzle in that case is the
> > > ability to extend BPF_PROG_LOAD with a way to say 'hold this map
> > > unconditionally'.
> > Should we have a short discussion about that this Thu during the office
> > hours?

> Of course. That's what office hours are for.
> Since google folks have trouble with zoom I've added google meets link
> to the spreadsheet. Let's try it tomorrow.
Ooooh, thank you for the Google Meets link :-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* BPF office hours via google meet. Was: BPF program metadata
  2020-08-05 23:10     ` sdf
@ 2020-08-06 17:06       ` Alexei Starovoitov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexei Starovoitov @ 2020-08-06 17:06 UTC (permalink / raw)
  To: Stanislav Fomichev, Network Development
  Cc: bpf, Daniel Borkmann, Andrii Nakryiko, YiFei Zhu

On Wed, Aug 5, 2020 at 4:10 PM <sdf@google.com> wrote:
> > Since google folks have trouble with zoom I've added google meets link
> > to the spreadsheet. Let's try it tomorrow.

Today we held BPF office hours via google meet and it worked well.
So we will be using it for future meetings.
zoom link has been removed from the spreadsheet to avoid confusion.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-06 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-29 16:27 BPF program metadata sdf
2020-08-04 19:42 ` sdf
2020-08-05 22:44   ` Alexei Starovoitov
2020-08-05 23:10     ` sdf
2020-08-06 17:06       ` BPF office hours via google meet. Was: " Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).