pull-request: bpf-next 2025-04-17
Subsystems (3)
Martin KaFai Lau
reviewerHi David, hi Jakub, hi Paolo, hi Eric,
The following pull-request contains BPF updates for your *net-next* tree.
We've added 12 non-merge commits during the last 9 day(s) which contain a total of 18 files changed, 1748 insertions(+), 19 deletions(-).
The main changes are:
1) bpf qdisc support, from Amery Hung.
A qdisc can be implemented in bpf struct_ops programs and can be used the same as other existing qdiscs in the "tc qdisc" command.
2) Add xsk tail adjustment tests, from Tushar Vyavahare.
Please consider pulling these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git tags/for-netdev
Thanks a lot!
Also thanks to reporters, reviewers and testers of commits in this pull-request:
Cong Wang, Maciej Fijalkowski, Toke Høiland-Jørgensen
----------------------------------------------------------------
The following changes since commit 0f681b0ecd190fb4516bb34cec227296b10533d1:
net: ena: Support persistent per-NAPI config. (2025-04-08 12:34:32 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git tags/for-netdev
for you to fetch changes up to fd23ce3eb4a1005bd109977856d12ec0fde7ef75:
Merge branch 'bpf-qdisc' (2025-04-17 10:54:41 -0700)
----------------------------------------------------------------
bpf-next-for-netdev
----------------------------------------------------------------
Amery Hung (10):
bpf: Prepare to reuse get_ctx_arg_idx
bpf: net_sched: Support implementation of Qdisc_ops in bpf
bpf: net_sched: Add basic bpf qdisc kfuncs
bpf: net_sched: Add a qdisc watchdog timer
bpf: net_sched: Support updating bstats
bpf: net_sched: Disable attaching bpf qdisc to non root
libbpf: Support creating and destroying qdisc selftests/bpf: Add a basic fifo qdisc test selftests/bpf: Add a bpf fq qdisc to selftest selftests/bpf: Test attaching bpf qdisc to mq and non root
Martin KaFai Lau (2):
Merge branch 'selftests-xsk-add-tests-for-xdp-tail-adjustment-in-af_xdp' Merge branch 'bpf-qdisc'
Tushar Vyavahare (2):
selftests/xsk: Add packet stream replacement function selftests/xsk: Add tail adjustment tests and support check
include/linux/btf.h | 1 + kernel/bpf/btf.c | 6 +- net/sched/Kconfig | 12 + net/sched/Makefile | 1 + net/sched/bpf_qdisc.c | 461 +++++++++++++ net/sched/sch_api.c | 7 +- net/sched/sch_generic.c | 3 +- tools/lib/bpf/libbpf.h | 5 +- tools/lib/bpf/netlink.c | 20 +- tools/testing/selftests/bpf/config | 2 + tools/testing/selftests/bpf/prog_tests/bpf_qdisc.c | 180 +++++ .../testing/selftests/bpf/progs/bpf_qdisc_common.h | 31 + tools/testing/selftests/bpf/progs/bpf_qdisc_fifo.c | 117 ++++ tools/testing/selftests/bpf/progs/bpf_qdisc_fq.c | 750 +++++++++++++++++++++ tools/testing/selftests/bpf/progs/xsk_xdp_progs.c | 50 ++ tools/testing/selftests/bpf/xsk_xdp_common.h | 1 + tools/testing/selftests/bpf/xskxceiver.c | 118 +++- tools/testing/selftests/bpf/xskxceiver.h | 2 + 18 files changed, 1748 insertions(+), 19 deletions(-) create mode 100644 net/sched/bpf_qdisc.c create mode 100644 tools/testing/selftests/bpf/prog_tests/bpf_qdisc.c create mode 100644 tools/testing/selftests/bpf/progs/bpf_qdisc_common.h create mode 100644 tools/testing/selftests/bpf/progs/bpf_qdisc_fifo.c create mode 100644 tools/testing/selftests/bpf/progs/bpf_qdisc_fq.c
Jakub Kicinski
maintainerQuoted 4 lines · On Thu, 17 Apr 2025 11:43:37 -0700 Martin KaFai Lau wrote:
1) bpf qdisc support, from Amery Hung.
A qdisc can be implemented in bpfstruct_opsprograms and can be used the same as other existing qdiscs in the "tc qdisc" command.
Hm, it doesn't build in allmodconfig. Is there a strong reason for it?
This pull request was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This pull request was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 17 Apr 2025 11:43:37 -0700 you wrote:
Hi David, hi Jakub, hi Paolo, hi Eric,
The following pull-request contains BPF updates for your *net-next* tree.
We've added 12 non-merge commits during the last 9 day(s) which contain a total of 18 files changed, 1748 insertions(+), 19 deletions(-).
[...]
Here is the summary with links:
- pull-request: bpf-next 2025-04-17
https://git.kernel.org/netdev/net-next/c/07e32237ed9d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Martin KaFai Lau
reviewerQuoted 7 lines · Jakub Kicinski
Quoted 4 lines · On Thu, 17 Apr 2025 11:43:37 -0700 Martin KaFai Lau wrote:
1) bpf qdisc support, from Amery Hung.
A qdisc can be implemented in bpfstruct_opsprograms and can be used the same as other existing qdiscs in the "tc qdisc" command.Hm, it doesn't build in allmodconfig. Is there a strong reason for it?
The bpf_qdisc.c is enforcing some correctness in the bpf Qdisc_op.{init,reset,destroy}. For example, it ensures that qdisc_watchdog_cancel is done in reset/destroy.
It is done by patching the bpf .reset prog and call a kfunc to ensure the cleanup work is done. Patching with mod kfunc is not supported now. We can consider to directly use BPF_EMIT_CALL to support mod helper call which should be simpler verifier changes.