Skip to content

Commit c6f9b71

Browse files
committed
Merge tag 'for-netdev' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
Daniel Borkmann says: ==================== pull-request: bpf-next 2023-10-26 We've added 51 non-merge commits during the last 10 day(s) which contain a total of 75 files changed, 5037 insertions(+), 200 deletions(-). The main changes are: 1) Add open-coded task, css_task and css iterator support. One of the use cases is customizable OOM victim selection via BPF, from Chuyi Zhou. 2) Fix BPF verifier's iterator convergence logic to use exact states comparison for convergence checks, from Eduard Zingerman, Andrii Nakryiko and Alexei Starovoitov. 3) Add BPF programmable net device where bpf_mprog defines the logic of its xmit routine. It can operate in L3 and L2 mode, from Daniel Borkmann and Nikolay Aleksandrov. 4) Batch of fixes for BPF per-CPU kptr and re-enable unit_size checking for global per-CPU allocator, from Hou Tao. 5) Fix libbpf which eagerly assumed that SHT_GNU_verdef ELF section was going to be present whenever a binary has SHT_GNU_versym section, from Andrii Nakryiko. 6) Fix BPF ringbuf correctness to fold smp_mb__before_atomic() into atomic_set_release(), from Paul E. McKenney. 7) Add a warning if NAPI callback missed xdp_do_flush() under CONFIG_DEBUG_NET which helps checking if drivers were missing the former, from Sebastian Andrzej Siewior. 8) Fix missed RCU read-lock in bpf_task_under_cgroup() which was throwing a warning under sleepable programs, from Yafang Shao. 9) Avoid unnecessary -EBUSY from htab_lock_bucket by disabling IRQ before checking map_locked, from Song Liu. 10) Make BPF CI linked_list failure test more robust, from Kumar Kartikeya Dwivedi. 11) Enable samples/bpf to be built as PIE in Fedora, from Viktor Malik. 12) Fix xsk starving when multiple xsk sockets were associated with a single xsk_buff_pool, from Albert Huang. 13) Clarify the signed modulo implementation for the BPF ISA standardization document that it uses truncated division, from Dave Thaler. 14) Improve BPF verifier's JEQ/JNE branch taken logic to also consider signed bounds knowledge, from Andrii Nakryiko. 15) Add an option to XDP selftests to use multi-buffer AF_XDP xdp_hw_metadata and mark used XDP programs as capable to use frags, from Larysa Zaremba. 16) Fix bpftool's BTF dumper wrt printing a pointer value and another one to fix struct_ops dump in an array, from Manu Bretelle. * tag 'for-netdev' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (51 commits) netkit: Remove explicit active/peer ptr initialization selftests/bpf: Fix selftests broken by mitigations=off samples/bpf: Allow building with custom bpftool samples/bpf: Fix passing LDFLAGS to libbpf samples/bpf: Allow building with custom CFLAGS/LDFLAGS bpf: Add more WARN_ON_ONCE checks for mismatched alloc and free selftests/bpf: Add selftests for netkit selftests/bpf: Add netlink helper library bpftool: Extend net dump with netkit progs bpftool: Implement link show support for netkit libbpf: Add link-based API for netkit tools: Sync if_link uapi header netkit, bpf: Add bpf programmable net device bpf: Improve JEQ/JNE branch taken logic bpf: Fold smp_mb__before_atomic() into atomic_set_release() bpf: Fix unnecessary -EBUSY from htab_lock_bucket xsk: Avoid starving the xsk further down the list bpf: print full verifier states on infinite loop detection selftests/bpf: test if state loops are detected in a tricky case bpf: correct loop detection for iterators convergence ... ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents cc33a80 + ea41b88 commit c6f9b71

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+5037
-200
lines changed

Documentation/bpf/standardization/instruction-set.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,14 @@ For signed operations (``BPF_SDIV`` and ``BPF_SMOD``), for ``BPF_ALU``,
283283
is first :term:`sign extended<Sign Extend>` from 32 to 64 bits, and then
284284
interpreted as a 64-bit signed value.
285285

286+
Note that there are varying definitions of the signed modulo operation
287+
when the dividend or divisor are negative, where implementations often
288+
vary by language such that Python, Ruby, etc. differ from C, Go, Java,
289+
etc. This specification requires that signed modulo use truncated division
290+
(where -13 % 3 == -1) as implemented in C, Go, etc.:
291+
292+
a % n = a - n * trunc(a / n)
293+
286294
The ``BPF_MOVSX`` instruction does a move operation with sign extension.
287295
``BPF_ALU | BPF_MOVSX`` :term:`sign extends<Sign Extend>` 8-bit and 16-bit operands into 32
288296
bit operands, and zeroes the remaining upper 32 bits.

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3796,6 +3796,15 @@ L: [email protected]
37963796
S: Odd Fixes
37973797
K: (?:\b|_)bpf(?:\b|_)
37983798

3799+
BPF [NETKIT] (BPF-programmable network device)
3800+
M: Daniel Borkmann <[email protected]>
3801+
M: Nikolay Aleksandrov <[email protected]>
3802+
3803+
3804+
S: Supported
3805+
F: drivers/net/netkit.c
3806+
F: include/net/netkit.h
3807+
37993808
BPF [NETWORKING] (struct_ops, reuseport)
38003809
M: Martin KaFai Lau <[email protected]>
38013810

drivers/net/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,15 @@ config NLMON
448448
diagnostics, etc. This is mostly intended for developers or support
449449
to debug netlink issues. If unsure, say N.
450450

451+
config NETKIT
452+
bool "BPF-programmable network device"
453+
depends on BPF_SYSCALL
454+
help
455+
The netkit device is a virtual networking device where BPF programs
456+
can be attached to the device(s) transmission routine in order to
457+
implement the driver's internal logic. The device can be configured
458+
to operate in L3 or L2 mode. If unsure, say N.
459+
451460
config NET_VRF
452461
tristate "Virtual Routing and Forwarding (Lite)"
453462
depends on IP_MULTIPLE_TABLES

drivers/net/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ obj-$(CONFIG_MDIO) += mdio.o
2222
obj-$(CONFIG_NET) += loopback.o
2323
obj-$(CONFIG_NETDEV_LEGACY_INIT) += Space.o
2424
obj-$(CONFIG_NETCONSOLE) += netconsole.o
25+
obj-$(CONFIG_NETKIT) += netkit.o
2526
obj-y += phy/
2627
obj-y += pse-pd/
2728
obj-y += mdio/

0 commit comments

Comments
 (0)