All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/6] bpf: Support multi-attach for freplace programs
@ 2020-07-15 13:08 Toke Høiland-Jørgensen
  2020-07-15 13:09 ` [PATCH bpf-next v2 1/6] bpf: change logging calls from verbose() to bpf_log() and use log pointer Toke Høiland-Jørgensen
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Toke Høiland-Jørgensen @ 2020-07-15 13:08 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Andrii Nakryiko, John Fastabend, KP Singh, netdev, bpf

This series adds support attaching freplace BPF programs to multiple targets.
This is needed to support incremental attachment of multiple XDP programs using
the libxdp dispatcher model.

The first two patches are refactoring patches: The first one is a trivial change
to the logging in the verifier, split out to make the subsequent refactor easier
to read. Patch 2 refactors check_attach_btf_id() so that the checks on program
and target compatibility can be reused when attaching to a secondary location.

Patch 3 contains the change that actually allows attaching freplace programs in
multiple places. Patches 4-6 are the usual tools header updates, libbpf support
and selftest.

See the individual patches for details.

Changelog:

v2:
  - Drop the log arguments from bpf_raw_tracepoint_open
  - Fix kbot errors
  - Rebase to latest bpf-next

---

Toke Høiland-Jørgensen (6):
      bpf: change logging calls from verbose() to bpf_log() and use log pointer
      bpf: verifier: refactor check_attach_btf_id()
      bpf: support attaching freplace programs to multiple attach points
      tools: add new members to bpf_attr.raw_tracepoint in bpf.h
      libbpf: add support for supplying target to bpf_raw_tracepoint_open()
      selftests: add test for multiple attachments of freplace program


 include/linux/bpf.h                           |  23 ++-
 include/linux/bpf_verifier.h                  |   9 +
 include/uapi/linux/bpf.h                      |   6 +-
 kernel/bpf/core.c                             |   1 -
 kernel/bpf/syscall.c                          |  78 +++++++-
 kernel/bpf/trampoline.c                       |  36 +++-
 kernel/bpf/verifier.c                         | 171 ++++++++++--------
 tools/include/uapi/linux/bpf.h                |   6 +-
 tools/lib/bpf/bpf.c                           |  13 +-
 tools/lib/bpf/bpf.h                           |   9 +
 tools/lib/bpf/libbpf.map                      |   1 +
 .../selftests/bpf/prog_tests/fexit_bpf2bpf.c  | 164 ++++++++++++++---
 .../bpf/progs/freplace_get_constant.c         |  15 ++
 13 files changed, 404 insertions(+), 128 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/freplace_get_constant.c


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [PATCH bpf-next v2 1/6] bpf: change logging calls from verbose() to bpf_log() and use log pointer
@ 2020-07-15 19:11 kernel test robot
  0 siblings, 0 replies; 26+ messages in thread
From: kernel test robot @ 2020-07-15 19:11 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2519 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <159481854034.454654.14793846101394162640.stgit@toke.dk>
References: <159481854034.454654.14793846101394162640.stgit@toke.dk>
TO: "Toke Høiland-Jørgensen" <toke@redhat.com>
TO: Alexei Starovoitov <ast@kernel.org>
CC: Daniel Borkmann <daniel@iogearbox.net>
CC: Martin KaFai Lau <kafai@fb.com>
CC: Song Liu <songliubraving@fb.com>
CC: Yonghong Song <yhs@fb.com>
CC: Andrii Nakryiko <andriin@fb.com>
CC: John Fastabend <john.fastabend@gmail.com>
CC: KP Singh <kpsingh@chromium.org>
CC: netdev(a)vger.kernel.org
CC: bpf(a)vger.kernel.org

Hi "Toke,

I love your patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Toke-H-iland-J-rgensen/bpf-Support-multi-attach-for-freplace-programs/20200715-211145
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: x86_64-randconfig-m001-20200715 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
include/linux/bpf_verifier.h:351 bpf_verifier_log_needed() error: we previously assumed 'log' could be null (see line 350)
include/linux/bpf_verifier.h:351 bpf_verifier_log_needed() error: we previously assumed 'log' could be null (see line 350)

# https://github.com/0day-ci/linux/commit/e33243ff1dd2cbb3628e4044dd9e00a6abf99c7e
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout e33243ff1dd2cbb3628e4044dd9e00a6abf99c7e
vim +/log +351 include/linux/bpf_verifier.h

06ee7115b0d174 Alexei Starovoitov     2019-04-01  347  
77d2e05abd4588 Martin KaFai Lau       2018-03-24  348  static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log)
77d2e05abd4588 Martin KaFai Lau       2018-03-24  349  {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 @350  	return (log && log->level && log->ubuf && !bpf_verifier_log_full(log)) ||
8580ac9404f624 Alexei Starovoitov     2019-10-15 @351  		log->level == BPF_LOG_KERNEL;
77d2e05abd4588 Martin KaFai Lau       2018-03-24  352  }
77d2e05abd4588 Martin KaFai Lau       2018-03-24  353  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37112 bytes --]

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

end of thread, other threads:[~2020-07-23  0:57 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-15 13:08 [PATCH bpf-next v2 0/6] bpf: Support multi-attach for freplace programs Toke Høiland-Jørgensen
2020-07-15 13:09 ` [PATCH bpf-next v2 1/6] bpf: change logging calls from verbose() to bpf_log() and use log pointer Toke Høiland-Jørgensen
2020-07-16 10:10   ` Dan Carpenter
2020-07-16 10:10     ` Dan Carpenter
2020-07-16 10:10     ` Dan Carpenter
2020-07-15 13:09 ` [PATCH bpf-next v2 2/6] bpf: verifier: refactor check_attach_btf_id() Toke Høiland-Jørgensen
2020-07-15 13:09 ` [PATCH bpf-next v2 3/6] bpf: support attaching freplace programs to multiple attach points Toke Høiland-Jørgensen
2020-07-15 20:44   ` Alexei Starovoitov
2020-07-16 10:50     ` Toke Høiland-Jørgensen
2020-07-17  2:05       ` Alexei Starovoitov
2020-07-17 10:52         ` Toke Høiland-Jørgensen
2020-07-20 22:57           ` Alexei Starovoitov
2020-07-20  5:02         ` Andrii Nakryiko
2020-07-20 23:34           ` Alexei Starovoitov
2020-07-21  3:48             ` Andrii Nakryiko
2020-07-22  0:29               ` Alexei Starovoitov
2020-07-22  6:02                 ` Andrii Nakryiko
2020-07-23  0:32                   ` Alexei Starovoitov
2020-07-23  0:56                     ` Andrii Nakryiko
2020-07-16 10:14   ` Dan Carpenter
2020-07-16 10:14     ` Dan Carpenter
2020-07-16 10:14     ` Dan Carpenter
2020-07-15 13:09 ` [PATCH bpf-next v2 4/6] tools: add new members to bpf_attr.raw_tracepoint in bpf.h Toke Høiland-Jørgensen
2020-07-15 13:09 ` [PATCH bpf-next v2 5/6] libbpf: add support for supplying target to bpf_raw_tracepoint_open() Toke Høiland-Jørgensen
2020-07-15 13:09 ` [PATCH bpf-next v2 6/6] selftests: add test for multiple attachments of freplace program Toke Høiland-Jørgensen
  -- strict thread matches above, loose matches on Subject: below --
2020-07-15 19:11 [PATCH bpf-next v2 1/6] bpf: change logging calls from verbose() to bpf_log() and use log pointer kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.