From: David Vernet <void@manifault.com>
To: bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
martin.lau@linux.dev, song@kernel.org, yhs@meta.com,
john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com,
haoluo@google.com, jolsa@kernel.org,
linux-kernel@vger.kernel.org, kernel-team@meta.com,
corbet@lwn.net, hch@infradead.org, acme@kernel.org,
alan.maguire@oracle.com
Subject: [PATCH bpf-next v3 0/4] bpf: Add __bpf_kfunc tag for kfunc definitions
Date: Wed, 1 Feb 2023 11:30:12 -0600 [thread overview]
Message-ID: <20230201173016.342758-1-void@manifault.com> (raw)
This is v3 of the patchset [0]. v2 can be found at [1].
[0]: https://lore.kernel.org/bpf/Y7kCsjBZ%2FFrsWW%2Fe@maniforge.lan/T/
[1]: https://lore.kernel.org/lkml/20230123171506.71995-1-void@manifault.com/
Changelog:
----------
v2 -> v3:
- Go back to the __bpf_kfunc approach from v1. The BPF_KFUNC macro
received pushback as it didn't match the more typical EXPORT_SYMBOL*
APIs used elsewhere in the kernel. It's the longer term plan, but for
now we're proposing something less controversial to fix kfuncs and BTF
encoding.
- Add __bpf_kfunc macro to newly added cpumask kfuncs.
- Add __bpf_kfunc macro to newly added XDP metadata kfuncs, which were
failing to be BTF encoded in the thread in [2].
- Update patch description(s) to reference the discussions in [2].
- Add a selftest that validates that a static kfunc with unused args is
properly BTF encoded and can be invoked.
[2]: https://lore.kernel.org/all/fe5d42d1-faad-d05e-99ad-1c2c04776950@oracle.com/
v1 -> v2:
- Wrap entire function signature in BPF_KFUNC macro instead of using
__bpf_kfunc tag (Kumar)
- Update all kfunc definitions to use this macro.
- Update kfuncs.rst documentation to describe and illustrate the macro.
- Also clean up a few small parts of kfuncs.rst, e.g. some grammar, and
in general making it a bit tighter.
David Vernet (4):
bpf: Add __bpf_kfunc tag for marking kernel functions as kfuncs
bpf: Document usage of the new __bpf_kfunc macro
bpf: Add __bpf_kfunc tag to all kfuncs
selftests/bpf: Add testcase for static kfunc
Documentation/bpf/kfuncs.rst | 20 +++++-
Documentation/conf.py | 3 +
include/linux/btf.h | 8 +++
kernel/bpf/cpumask.c | 60 +++++++++---------
kernel/bpf/helpers.c | 38 ++++++------
kernel/cgroup/rstat.c | 4 +-
kernel/kexec_core.c | 3 +-
kernel/trace/bpf_trace.c | 8 +--
net/bpf/test_run.c | 61 +++++++++++--------
net/core/xdp.c | 5 +-
net/ipv4/tcp_bbr.c | 16 ++---
net/ipv4/tcp_cong.c | 10 +--
net/ipv4/tcp_cubic.c | 12 ++--
net/ipv4/tcp_dctcp.c | 12 ++--
net/netfilter/nf_conntrack_bpf.c | 20 +++---
net/netfilter/nf_nat_bpf.c | 6 +-
net/xfrm/xfrm_interface_bpf.c | 7 +--
.../selftests/bpf/bpf_testmod/bpf_testmod.c | 2 +-
.../selftests/bpf/prog_tests/kfunc_call.c | 1 +
.../selftests/bpf/progs/kfunc_call_test.c | 11 ++++
20 files changed, 176 insertions(+), 131 deletions(-)
--
2.39.0
next reply other threads:[~2023-02-01 17:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 17:30 David Vernet [this message]
2023-02-01 17:30 ` [PATCH bpf-next v3 1/4] bpf: Add __bpf_kfunc tag for marking kernel functions as kfuncs David Vernet
2023-02-01 17:30 ` [PATCH bpf-next v3 2/4] bpf: Document usage of the new __bpf_kfunc macro David Vernet
2023-02-01 17:30 ` [PATCH bpf-next v3 3/4] bpf: Add __bpf_kfunc tag to all kfuncs David Vernet
2023-02-01 17:30 ` [PATCH bpf-next v3 4/4] selftests/bpf: Add testcase for static kfunc with unused arg David Vernet
2023-02-01 23:30 ` [PATCH bpf-next v3 0/4] bpf: Add __bpf_kfunc tag for kfunc definitions 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=20230201173016.342758-1-void@manifault.com \
--to=void@manifault.com \
--cc=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=hch@infradead.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kernel-team@meta.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=yhs@meta.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