From: Daniel Borkmann <daniel@iogearbox.net>
To: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org, martin.lau@linux.dev,
razor@blackwall.org, ast@kernel.org, andrii@kernel.org,
john.fastabend@gmail.com, sdf@google.com, toke@kernel.org,
kuba@kernel.org, andrew@lunn.ch,
Daniel Borkmann <daniel@iogearbox.net>
Subject: [PATCH bpf-next v4 0/7] Add bpf programmable net device
Date: Tue, 24 Oct 2023 23:48:57 +0200 [thread overview]
Message-ID: <20231024214904.29825-1-daniel@iogearbox.net> (raw)
This work adds a BPF programmable device which can operate in L3 or L2
mode where the BPF program is part of the xmit routine. It's program
management is done via bpf_mprog and it comes with BPF link support.
For details see patch 1 and following. Thanks!
v3 -> v4:
- Moved netkit_release_all() into ndo_uninit (Stan)
- Two small commit msg corrections (Toke)
- Added Acked/Reviewed-by
v2 -> v3:
- Remove setting dev->min_mtu to ETH_MIN_MTU (Andrew)
- Do not populate ethtool info->version (Andrew)
- Populate netdev private data before register_netdevice (Andrew)
- Use strscpy for ifname template (Jakub)
- Use GFP_KERNEL_ACCOUNT for link kzalloc (Jakub)
- Carry and dump link attach type for bpftool (Toke)
v1 -> v2:
- Rename from meta (Toke, Andrii, Alexei)
- Reuse skb_scrub_packet (Stan)
- Remove IFF_META and use netdev_ops (Toke)
- Add comment to multicast handler (Toke)
- Remove silly version info (Toke)
- Fix attach_type_name (Quentin)
- Rework libbpf link attach api to be similar
as tcx (Andrii)
- Move flags last for bpf_netkit_opts (Andrii)
- Rebased to bpf_mprog query api changes
- Folded link support patch into main one
Daniel Borkmann (7):
netkit, bpf: Add bpf programmable net device
tools: Sync if_link uapi header
libbpf: Add link-based API for netkit
bpftool: Implement link show support for netkit
bpftool: Extend net dump with netkit progs
selftests/bpf: Add netlink helper library
selftests/bpf: Add selftests for netkit
MAINTAINERS | 9 +
drivers/net/Kconfig | 9 +
drivers/net/Makefile | 1 +
drivers/net/netkit.c | 940 ++++++++++++++++++
include/net/netkit.h | 38 +
include/uapi/linux/bpf.h | 14 +
include/uapi/linux/if_link.h | 24 +
kernel/bpf/syscall.c | 30 +-
.../bpf/bpftool/Documentation/bpftool-net.rst | 8 +-
tools/bpf/bpftool/link.c | 9 +
tools/bpf/bpftool/net.c | 7 +-
tools/include/uapi/linux/bpf.h | 14 +
tools/include/uapi/linux/if_link.h | 141 +++
tools/lib/bpf/bpf.c | 16 +
tools/lib/bpf/bpf.h | 5 +
tools/lib/bpf/libbpf.c | 39 +
tools/lib/bpf/libbpf.h | 15 +
tools/lib/bpf/libbpf.map | 1 +
tools/testing/selftests/bpf/Makefile | 19 +-
tools/testing/selftests/bpf/config | 1 +
tools/testing/selftests/bpf/netlink_helpers.c | 358 +++++++
tools/testing/selftests/bpf/netlink_helpers.h | 46 +
.../selftests/bpf/prog_tests/tc_helpers.h | 4 +
.../selftests/bpf/prog_tests/tc_netkit.c | 687 +++++++++++++
.../selftests/bpf/progs/test_tc_link.c | 13 +
25 files changed, 2433 insertions(+), 15 deletions(-)
create mode 100644 drivers/net/netkit.c
create mode 100644 include/net/netkit.h
create mode 100644 tools/testing/selftests/bpf/netlink_helpers.c
create mode 100644 tools/testing/selftests/bpf/netlink_helpers.h
create mode 100644 tools/testing/selftests/bpf/prog_tests/tc_netkit.c
--
2.34.1
next reply other threads:[~2023-10-24 21:49 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 21:48 Daniel Borkmann [this message]
2023-10-24 21:48 ` [PATCH bpf-next v4 1/7] netkit, bpf: Add bpf programmable net device Daniel Borkmann
2023-10-25 15:47 ` Jiri Pirko
2023-10-25 17:20 ` Daniel Borkmann
2023-10-26 5:18 ` Jiri Pirko
2023-10-26 12:11 ` Daniel Borkmann
2023-10-25 19:21 ` Nikolay Aleksandrov
2023-10-26 5:26 ` Jiri Pirko
2023-10-26 6:21 ` Nikolay Aleksandrov
2023-10-25 21:24 ` Kui-Feng Lee
2023-10-25 22:09 ` Martin KaFai Lau
2023-10-26 1:15 ` Kui-Feng Lee
2023-10-26 1:18 ` Kui-Feng Lee
2023-10-26 6:20 ` Daniel Borkmann
2023-10-26 17:47 ` Kui-Feng Lee
2023-10-26 18:46 ` Martin KaFai Lau
2023-10-24 21:48 ` [PATCH bpf-next v4 2/7] tools: Sync if_link uapi header Daniel Borkmann
2023-10-24 21:49 ` [PATCH bpf-next v4 3/7] libbpf: Add link-based API for netkit Daniel Borkmann
2023-10-24 21:49 ` [PATCH bpf-next v4 4/7] bpftool: Implement link show support " Daniel Borkmann
2023-10-24 21:49 ` [PATCH bpf-next v4 5/7] bpftool: Extend net dump with netkit progs Daniel Borkmann
2023-10-24 21:49 ` [PATCH bpf-next v4 6/7] selftests/bpf: Add netlink helper library Daniel Borkmann
2023-10-24 21:49 ` [PATCH bpf-next v4 7/7] selftests/bpf: Add selftests for netkit Daniel Borkmann
2023-10-24 22:45 ` [PATCH bpf-next v4 0/7] Add bpf programmable net device Martin KaFai Lau
2023-10-24 23:50 ` patchwork-bot+netdevbpf
2023-10-25 15:50 ` Jiri Pirko
2023-10-25 16:54 ` Martin KaFai Lau
2023-10-26 5:35 ` Jiri Pirko
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=20231024214904.29825-1-daniel@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=andrew@lunn.ch \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=sdf@google.com \
--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