Re: [PATCH] net: mvpp2: fix skb not reflecting XDP modifications on XDP_PASS
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-05-28 02:02:50
Also in:
bpf
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-05-28 02:02:50
Also in:
bpf
On Sun, 24 May 2026 14:23:34 +0200 Til Kaiser wrote:
When an XDP program uses bpf_xdp_adjust_head() or bpf_xdp_adjust_tail()
and then returns XDP_PASS, the driver ignores the updated xdp_buff
pointers and builds the skb from hardcoded offsets derived from the
original RX descriptor. This means any packet modifications made by the
XDP program are silently discarded before the skb reaches the network
stack.
Fix this by saving the post-XDP data pointer offset and length back into
rx_offset and rx_bytes when XDP_PASS is returned, so the subsequent
skb_reserve()/skb_put() calls use the actual packet geometry as seen by
the XDP program. When no XDP program is loaded the variables retain
their original descriptor-derived values and the non-XDP fast path is
unaffected.
Fixes: 07dd0a7aae7f ("mvpp2: add basic XDP support")
Signed-off-by: Til Kaiser <redacted>Other than the checksum complaint Sashiko review looks legit. Please respin and try to fix more of this issues in one series. Could you try to run: tools/testing/selftests/drivers/net/xdp.py it may surface other common driver bugs. See: tools/testing/selftests/drivers/net/README.rst for instructions -- pw-bot: cr