bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andrii@kernel.org>,
	bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH bpf-next 4/7] libbpf: allow skipping attach_func_name in bpf_program__set_attach_target()
Date: Fri, 17 Sep 2021 11:04:29 -0700	[thread overview]
Message-ID: <CAEf4BzbMBg49+DqE2bgmYRDH5Kao5HvmMyDKY0EHL7DRU-KvKw@mail.gmail.com> (raw)
In-Reply-To: <CAADnVQK8hdbEQ0iO7X0pr_xAet-=nC0DhwkE2Kid9FrG72hD2Q@mail.gmail.com>

On Fri, Sep 17, 2021 at 9:10 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Wed, Sep 15, 2021 at 9:17 PM Yonghong Song <yhs@fb.com> wrote:
> >
> >
> >
> > On 9/15/21 6:58 PM, Andrii Nakryiko wrote:
> > > Allow to use bpf_program__set_attach_target to only set target attach
> > > program FD, while letting libbpf to use target attach function name from
> > > SEC() definition. This might be useful for some scenarios where
> > > bpf_object contains multiple related freplace BPF programs intended to
> > > replace different sub-programs in target BPF program. In such case all
> > > programs will have the same attach_prog_fd, but different
> > > attach_func_name. It's conveninent to specify such target function names
> >
> > typo: conveninent => convenient
> >
> > > declaratively in SEC() definitions, but attach_prog_fd is a dynamic
> > > runtime setting.
> > >
> > > To simplify such scenario, allow bpf_program__set_attach_target() to
> > > delay BTF ID resolution till the BPF program load time by providing NULL
> > > attach_func_name. In that case the behavior will be similar to using
> > > bpf_object_open_opts.attach_prog_fd (which is marked deprecated since
> > > v0.7), but has the benefit of allowing more control by user in what is
> > > attached to what. Such setup allows having BPF programs attached to
> > > different target attach_prog_fd with target funtions still declaratively
>
> Applied with "conveninent" and "funtions" typos fixed.

Thanks!

  reply	other threads:[~2021-09-17 18:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16  1:58 [PATCH bpf-next 0/7] Improve set_attach_target() and deprecate open_opts.attach_prog_fd Andrii Nakryiko
2021-09-16  1:58 ` [PATCH bpf-next 1/7] libbpf: use pre-setup sec_def in libbpf_find_attach_btf_id() Andrii Nakryiko
2021-09-16  2:52   ` Yonghong Song
2021-09-16  1:58 ` [PATCH bpf-next 2/7] selftests/bpf: stop using relaxed_core_relocs which has no effect Andrii Nakryiko
2021-09-16  2:57   ` Yonghong Song
2021-09-16  1:58 ` [PATCH bpf-next 3/7] libbpf: deprecated bpf_object_open_opts.relaxed_core_relocs Andrii Nakryiko
2021-09-16  2:57   ` Yonghong Song
2021-09-16  1:58 ` [PATCH bpf-next 4/7] libbpf: allow skipping attach_func_name in bpf_program__set_attach_target() Andrii Nakryiko
2021-09-16  4:17   ` Yonghong Song
2021-09-17 16:09     ` Alexei Starovoitov
2021-09-17 18:04       ` Andrii Nakryiko [this message]
2021-09-16  1:58 ` [PATCH bpf-next 5/7] selftests/bpf: switch fexit_bpf2bpf selftest to set_attach_target() API Andrii Nakryiko
2021-09-16  4:24   ` Yonghong Song
2021-09-16 17:14     ` Andrii Nakryiko
2021-09-16  1:58 ` [PATCH bpf-next 6/7] libbpf: schedule open_opts.attach_prog_fd deprecation since v0.7 Andrii Nakryiko
2021-09-16  4:26   ` Yonghong Song
2021-09-16  1:58 ` [PATCH bpf-next 7/7] libbpf: constify all high-level program attach APIs Andrii Nakryiko
2021-09-16  4:29   ` Yonghong Song
2021-09-17 16:10 ` [PATCH bpf-next 0/7] Improve set_attach_target() and deprecate open_opts.attach_prog_fd patchwork-bot+netdevbpf

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=CAEf4BzbMBg49+DqE2bgmYRDH5Kao5HvmMyDKY0EHL7DRU-KvKw@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).