From: "Toke Høiland-Jørgensen" <toke@redhat•com>
To: Alexei Starovoitov <alexei.starovoitov@gmail•com>
Cc: Alexei Starovoitov <ast@kernel•org>,
davem@davemloft•net, daniel@iogearbox•net,
netdev@vger•kernel.org, bpf@vger•kernel.org, kernel-team@fb•com
Subject: Re: [PATCH v2 bpf-next 0/3] bpf: Program extensions or dynamic re-linking
Date: Wed, 22 Jan 2020 11:45:03 +0100 [thread overview]
Message-ID: <87blqvbwi8.fsf@toke.dk> (raw)
In-Reply-To: <20200121165958.zfpvsz7kdcx2dotr@ast-mbp.dhcp.thefacebook.com>
Alexei Starovoitov <alexei.starovoitov@gmail•com> writes:
> On Tue, Jan 21, 2020 at 04:37:31PM +0100, Toke Høiland-Jørgensen wrote:
>> Alexei Starovoitov <ast@kernel•org> writes:
>>
>> > The last few month BPF community has been discussing an approach to call
>> > chaining, since exiting bpt_tail_call() mechanism used in production XDP
>> > programs has plenty of downsides. The outcome of these discussion was a
>> > conclusion to implement dynamic re-linking of BPF programs. Where rootlet XDP
>> > program attached to a netdevice can programmatically define a policy of
>> > execution of other XDP programs. Such rootlet would be compiled as normal XDP
>> > program and provide a number of placeholder global functions which later can be
>> > replaced with future XDP programs. BPF trampoline, function by function
>> > verification were building blocks towards that goal. The patch 1 is a final
>> > building block. It introduces dynamic program extensions. A number of
>> > improvements like more flexible function by function verification and better
>> > libbpf api will be implemented in future patches.
>>
>> This is great, thank you! I'll go play around with it; couldn't spot
>> anything obvious from eye-balling the code, except that yeah, it does
>> need a more flexible libbpf api :)
>>
>> One thing that's not obvious to me: How can userspace tell which
>> programs replace which functions after they are loaded? Is this put into
>> prog_tags in struct bpf_prog_info, or?
>
> good point. Would be good to extend bpf_prog_info. Since prog-to-prog
> connection is unidirectional the bpf_prog_info of extension prog will be able
> to say which original program it's replacing.
Yeah, that'll do. I can live with having to enumerate all programs and
backtrack to the attached XDP program to figure out its component parts.
> bpftool prog show will be able to print all this data. I think
> fenry/fexit progs would need the same bpf_prog_info extension.
> attach_prog_id + attach_btf_id would be enough.
Yes, please. I actually assumed this was already there for fentry/fexit,
which is why I was puzzled I couldn't find where this series hooked into
that. I'll just wait for such an extension to show up, then :)
> In the mean time I can try to hack drgn script to do the same.
That would be great, thanks!
-Toke
next prev parent reply other threads:[~2020-01-22 10:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-21 0:53 [PATCH v2 bpf-next 0/3] bpf: Program extensions or dynamic re-linking Alexei Starovoitov
2020-01-21 0:53 ` [PATCH v2 bpf-next 1/3] bpf: Introduce dynamic program extensions Alexei Starovoitov
2020-01-21 7:36 ` John Fastabend
2020-01-21 16:00 ` Alexei Starovoitov
2020-01-21 18:15 ` John Fastabend
2020-01-21 19:08 ` Alexei Starovoitov
2020-01-21 19:54 ` John Fastabend
2020-01-21 21:13 ` Yonghong Song
2020-01-21 0:53 ` [PATCH v2 bpf-next 2/3] libbpf: Add support for " Alexei Starovoitov
2020-01-21 18:38 ` John Fastabend
2020-01-21 0:53 ` [PATCH v2 bpf-next 3/3] selftests/bpf: Add tests " Alexei Starovoitov
2020-01-21 18:41 ` John Fastabend
2020-01-21 15:37 ` [PATCH v2 bpf-next 0/3] bpf: Program extensions or dynamic re-linking Toke Høiland-Jørgensen
2020-01-21 17:00 ` Alexei Starovoitov
2020-01-22 10:45 ` Toke Høiland-Jørgensen [this message]
2020-01-21 18:21 ` Andrii Nakryiko
2020-01-22 22:12 ` Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87blqvbwi8.fsf@toke.dk \
--to=toke@redhat$(echo .)com \
--cc=alexei.starovoitov@gmail$(echo .)com \
--cc=ast@kernel$(echo .)org \
--cc=bpf@vger$(echo .)kernel.org \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=kernel-team@fb$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox