linux-stable/tools
Joanne Koong b5964b968a bpf: Add skb dynptrs
Add skb dynptrs, which are dynptrs whose underlying pointer points
to a skb. The dynptr acts on skb data. skb dynptrs have two main
benefits. One is that they allow operations on sizes that are not
statically known at compile-time (eg variable-sized accesses).
Another is that parsing the packet data through dynptrs (instead of
through direct access of skb->data and skb->data_end) can be more
ergonomic and less brittle (eg does not need manual if checking for
being within bounds of data_end).

For bpf prog types that don't support writes on skb data, the dynptr is
read-only (bpf_dynptr_write() will return an error)

For reads and writes through the bpf_dynptr_read() and bpf_dynptr_write()
interfaces, reading and writing from/to data in the head as well as from/to
non-linear paged buffers is supported. Data slices through the
bpf_dynptr_data API are not supported; instead bpf_dynptr_slice() and
bpf_dynptr_slice_rdwr() (added in subsequent commit) should be used.

For examples of how skb dynptrs can be used, please see the attached
selftests.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Link: https://lore.kernel.org/r/20230301154953.641654-8-joannelkoong@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-03-01 09:55:24 -08:00
..
accounting
arch selftests/bpf: Remove not used headers 2023-02-22 13:01:34 -08:00
bootconfig
bpf tools: bpftool: Remove invalid \' json escape 2023-02-27 11:28:16 -08:00
build
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio tools: gpio: fix -c option of gpio-event-mon 2023-01-27 14:05:46 +01:00
hv
iio
include bpf: Add skb dynptrs 2023-03-01 09:55:24 -08:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Fix bpf_xdp_query() in old kernels 2023-02-27 15:26:12 -08:00
memory-model
net/ynl tools: net: use python3 explicitly 2023-01-31 20:36:03 -08:00
objtool xen: branch for v6.3-rc1 2023-02-21 17:07:39 -08:00
pci
pcmcia
perf perf test build-id: Fix test check for PE file 2023-01-18 10:52:06 -03:00
power platform-drivers-x86 for v6.3-1 2023-02-21 17:32:50 -08:00
rcu
scripts selftests/bpf: Fix cross compilation with CLANG_CROSS_FLAGS 2023-02-22 13:04:55 -08:00
spi
testing selftests/bpf: Fix compilation errors: Assign a value to a constant 2023-02-27 11:47:48 -08:00
thermal
time
tracing rtla: Fix exit status when returning from calls to usage() 2022-12-09 18:06:24 -05:00
usb
verification Tracing fix for 6.2: 2022-12-21 19:03:42 -08:00
virtio tools/virtio: fix the vringh test for virtio ring changes 2023-01-27 06:18:41 -05:00
vm MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
wmi
Makefile