From: Joanne Koong <joannelkoong@gmail.com>
To: bpf@vger.kernel.org
Cc: andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net,
Joanne Koong <joannelkoong@gmail.com>
Subject: [PATCH v1 bpf-next 0/5] Dynptr convenience helpers
Date: Sat, 8 Apr 2023 20:34:26 -0700 [thread overview]
Message-ID: <20230409033431.3992432-1-joannelkoong@gmail.com> (raw)
This patchset is the 3rd in the dynptr series. The 1st (dynptr
fundamentals) can be found here [0] and the second (skb + xdp dynptrs)
can be found here [1].
This patchset adds the following convenience helpers for interacting
with dynptrs:
int bpf_dynptr_trim(struct bpf_dynptr *ptr, __u32 len) __ksym;
int bpf_dynptr_advance(struct bpf_dynptr *ptr, __u32 len) __ksym;
int bpf_dynptr_is_null(const struct bpf_dynptr *ptr) __ksym;
int bpf_dynptr_is_rdonly(const struct bpf_dynptr *ptr) __ksym;
__u32 bpf_dynptr_get_size(const struct bpf_dynptr *ptr) __ksym;
__u32 bpf_dynptr_get_offset(const struct bpf_dynptr *ptr) __ksym;
int bpf_dynptr_clone(const struct bpf_dynptr *ptr, struct bpf_dynptr *clone__init) __ksym;
[0] https://lore.kernel.org/bpf/20220523210712.3641569-1-joannelkoong@gmail.com/
[1] https://lore.kernel.org/bpf/20230301154953.641654-1-joannelkoong@gmail.com/
Joanne Koong (5):
bpf: Add bpf_dynptr_trim and bpf_dynptr_advance
bpf: Add bpf_dynptr_is_null and bpf_dynptr_is_rdonly
bpf: Add bpf_dynptr_get_size and bpf_dynptr_get_offset
bpf: Add bpf_dynptr_clone
selftests/bpf: add tests for dynptr convenience helpers
include/linux/bpf.h | 2 +-
kernel/bpf/helpers.c | 108 +++++-
kernel/bpf/verifier.c | 125 ++++++-
kernel/trace/bpf_trace.c | 4 +-
tools/testing/selftests/bpf/bpf_kfuncs.h | 8 +
.../testing/selftests/bpf/prog_tests/dynptr.c | 6 +
.../testing/selftests/bpf/progs/dynptr_fail.c | 313 +++++++++++++++++
.../selftests/bpf/progs/dynptr_success.c | 320 ++++++++++++++++++
8 files changed, 864 insertions(+), 22 deletions(-)
--
2.34.1
next reply other threads:[~2023-04-09 3:34 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-09 3:34 Joanne Koong [this message]
2023-04-09 3:34 ` [PATCH v1 bpf-next 1/5] bpf: Add bpf_dynptr_trim and bpf_dynptr_advance Joanne Koong
2023-04-12 21:46 ` Andrii Nakryiko
2023-04-14 5:15 ` Joanne Koong
2023-04-17 23:35 ` Andrii Nakryiko
2023-04-19 6:22 ` Joanne Koong
2023-04-19 16:30 ` Andrii Nakryiko
2023-04-09 3:34 ` [PATCH v1 bpf-next 2/5] bpf: Add bpf_dynptr_is_null and bpf_dynptr_is_rdonly Joanne Koong
2023-04-12 21:50 ` Andrii Nakryiko
2023-04-20 6:45 ` Joanne Koong
2023-04-09 3:34 ` [PATCH v1 bpf-next 3/5] bpf: Add bpf_dynptr_get_size and bpf_dynptr_get_offset Joanne Koong
2023-04-12 21:52 ` Andrii Nakryiko
2023-04-14 5:17 ` Joanne Koong
2023-04-09 3:34 ` [PATCH v1 bpf-next 4/5] bpf: Add bpf_dynptr_clone Joanne Koong
2023-04-12 22:12 ` Andrii Nakryiko
2023-04-14 6:02 ` Joanne Koong
2023-04-17 23:46 ` Andrii Nakryiko
2023-04-19 6:56 ` Joanne Koong
2023-04-19 16:34 ` Andrii Nakryiko
2023-04-17 18:53 ` kernel test robot
2023-04-09 3:34 ` [PATCH v1 bpf-next 5/5] selftests/bpf: add tests for dynptr convenience helpers Joanne Koong
2023-04-12 21:48 ` [PATCH v1 bpf-next 0/5] Dynptr " Andrii Nakryiko
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=20230409033431.3992432-1-joannelkoong@gmail.com \
--to=joannelkoong@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
/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).