From: Daniel Xu <dxu@dxuuu.xyz>
To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
andrii@kernel.org, memxor@gmail.com
Cc: Daniel Xu <dxu@dxuuu.xyz>,
pablo@netfilter.org, fw@strlen.de, toke@kernel.org,
netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH bpf-next v2 0/4] Support direct writes to nf_conn:mark
Date: Wed, 17 Aug 2022 12:42:58 -0600 [thread overview]
Message-ID: <cover.1660761035.git.dxu@dxuuu.xyz> (raw)
Support direct writes to nf_conn:mark from TC and XDP prog types. This
is useful when applications want to store per-connection metadata. This
is also particularly useful for applications that run both bpf and
iptables/nftables because the latter can trivially access this metadata.
One example use case would be if a bpf prog is responsible for advanced
packet classification and iptables/nftables is later used for routing
due to pre-existing/legacy code.
Past discussion:
- v1: https://lore.kernel.org/bpf/cover.1660592020.git.dxu@dxuuu.xyz/
Changes since v1:
- Add unimplemented stub for when !CONFIG_BPF_SYSCALL
Daniel Xu (4):
bpf: Remove duplicate PTR_TO_BTF_ID RO check
bpf: Add stub for btf_struct_access()
bpf: Add support for writing to nf_conn:mark
selftests/bpf: Add tests for writing to nf_conn:mark
include/linux/bpf.h | 9 ++++
include/net/netfilter/nf_conntrack_bpf.h | 18 +++++++
kernel/bpf/verifier.c | 3 --
net/core/filter.c | 34 +++++++++++++
net/netfilter/nf_conntrack_bpf.c | 50 +++++++++++++++++++
.../testing/selftests/bpf/prog_tests/bpf_nf.c | 1 +
.../testing/selftests/bpf/progs/test_bpf_nf.c | 6 ++-
.../selftests/bpf/progs/test_bpf_nf_fail.c | 14 ++++++
8 files changed, 130 insertions(+), 5 deletions(-)
--
2.37.1
reply other threads:[~2022-08-17 18:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=cover.1660761035.git.dxu@dxuuu.xyz \
--to=dxu@dxuuu.xyz \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=fw@strlen.de \
--cc=linux-kernel@vger.kernel.org \
--cc=memxor@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=toke@kernel.org \
/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).