bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Stanislav Fomichev <sdf@google.com>
Cc: Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: Re: [PATCH bpf-next v5 0/3] libbpf: use func name when pinning programs with LIBBPF_STRICT_SEC_NAME
Date: Fri, 22 Oct 2021 16:57:15 -0700	[thread overview]
Message-ID: <CAEf4BzabNUTWPWgxFhCdmuERRqVomuWMMReD1xQ0ma2i98uqRg@mail.gmail.com> (raw)
In-Reply-To: <20211021214814.1236114-1-sdf@google.com>

On Thu, Oct 21, 2021 at 2:48 PM Stanislav Fomichev <sdf@google.com> wrote:
>
> Commit 15669e1dcd75 ("selftests/bpf: Normalize all the rest SEC() uses")
> broke flow dissector tests. With the strict section names, bpftool isn't
> able to pin all programs of the objects (all section names are the
> same now). To bring it back to life let's do the following:
>
> - teach libbpf to pin by func name with LIBBPF_STRICT_SEC_NAME
> - enable strict mode in bpftool (breaking cli change)
> - fix custom flow_dissector loader to use strict mode
> - fix flow_dissector tests to use new pin names (func vs sec)
>
> v5:
> - get rid of error when retrying with '/' (Quentin Monnet)
>
> v4:
> - fix comment spelling (Quentin Monnet)
> - retry progtype without / (Quentin Monnet)
>
> v3:
> - clarify program pinning in LIBBPF_STRICT_SEC_NAME,
>   for real this time (Andrii Nakryiko)
> - fix possible segfault in __bpf_program__pin_name (Andrii Nakryiko)
>
> v2:
> - add github issue (Andrii Nakryiko)
> - remove sec_name from bpf_program.pin_name comment (Andrii Nakryiko)
> - add cover letter (Andrii Nakryiko)
>
> Stanislav Fomichev (3):
>   libbpf: use func name when pinning programs with
>     LIBBPF_STRICT_SEC_NAME
>   bpftool: conditionally append / to the progtype
>   selftests/bpf: fix flow dissector tests

I've applied patches #1 and #3, as they have to happen regardless of
how bpftool incompatibility is going to be handled. Please see
comments from John about bpftool. I think we should try to preserve
bpftool's backwards compatibility, or at the very least give users
some way to fall back to non-strict mode during the transition period.
I trust you, John and Quentin will figure out the best way forward
there.

Also, please move this flow_dissector_load selftest into test_progs,
so that we exercise it regularly.

>
>  tools/bpf/bpftool/main.c                      |  4 +++
>  tools/bpf/bpftool/prog.c                      | 35 ++++++++++---------
>  tools/lib/bpf/libbpf.c                        | 13 +++++--
>  tools/lib/bpf/libbpf_legacy.h                 |  3 ++
>  .../selftests/bpf/flow_dissector_load.c       | 18 ++++++----
>  .../selftests/bpf/flow_dissector_load.h       | 10 ++----
>  .../selftests/bpf/test_flow_dissector.sh      | 10 +++---
>  7 files changed, 55 insertions(+), 38 deletions(-)
>
> --
> 2.33.0.1079.g6e70778dc9-goog
>

      parent reply	other threads:[~2021-10-22 23:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 21:48 [PATCH bpf-next v5 0/3] libbpf: use func name when pinning programs with LIBBPF_STRICT_SEC_NAME Stanislav Fomichev
2021-10-21 21:48 ` [PATCH bpf-next v5 1/3] " Stanislav Fomichev
2021-10-21 21:48 ` [PATCH bpf-next v5 2/3] bpftool: conditionally append / to the progtype Stanislav Fomichev
2021-10-22  8:20   ` Quentin Monnet
2021-10-21 21:48 ` [PATCH bpf-next v5 3/3] selftests/bpf: fix flow dissector tests Stanislav Fomichev
2021-10-22 23:57 ` Andrii Nakryiko [this message]

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=CAEf4BzabNUTWPWgxFhCdmuERRqVomuWMMReD1xQ0ma2i98uqRg@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.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).