Thread (15 messages) 15 messages, 4 authors, 2026-03-30

Re: [PATCH bpf-next 1/3] bpf: Disallow freplace on XDP with mismatched xdp_has_frags values

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-03-28 00:12:22
Also in: bpf, linux-kselftest, lkml

On Fri, 27 Mar 2026 14:42:19 +0800 Leon Hwang wrote:
quoted
It may be worth adding a selftest to
tools/testing/selftests/drivers/net/xdp.py
which sets MTU to 9k, tries to attach a non-frag-capable prog
if that fails attaches a frag-capable prog and then checks if
replacing the capable prog with non-capable fails.
Drivers may be buggy in this regard.  
Do you mean adding these two tests to xdp.py?

1. Verify the failure of attaching non-frag-capable prog to mtu=9k
   driver.
2. Verify the failure of updating frag-capable prog with non-frag-
   capable prog via libbpf.c::bpf_link__update_program().
Not directly via libbpf just ip -f link, it uses libbpf internally
but testing with  ip link is simpler. Also - there are already XDP
progs which return XDP_PASS in frag-capable and non-capable mode,
so just use those.
As for test #2, it may require a helper to attach prog then update prog
using libbpf's APIs.
See above.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help