mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
The BPF-helper is now defined in bpf_helper_defs.h header:
lib/libbpf-install/usr/include/bpf/bpf_helper_defs.h
Update and keep comment as a help for people doing kernel
devel on BPF and want to test BPF-helpers not yet upstream.
Accepted in kernel v5.12
- commit 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")
- https://git.kernel.org/torvalds/c/34b2021cc616
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
BPF testing packet size changes
Playing with increasing packet size with TC-BPF. Testing what happens when sending packets larger that MTU out an interface.
Notes loading BPF object
How to manually load TC program:
export DEV=mlx5p1
tc qdisc del dev "$DEV" clsact # Also deletes all filters
tc qdisc add dev "$DEV" clsact
tc filter add dev "$DEV" pref 1 handle 1 egress bpf da obj tc_bpf_inc_pkt_size.o
tc filter show dev "$DEV" egress
Be VERY careful with replace command, it MUST have same pref +=handle=:
tc filter replace dev "$DEV" pref 1 handle 1 egress bpf da obj tc_bpf_inc_pkt_size.o