]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: mvpp2: build skb from XDP-adjusted data on XDP_PASS
authorTil Kaiser <mail@tk154.de>
Sun, 7 Jun 2026 13:49:43 +0000 (15:49 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 11 Jun 2026 07:57:31 +0000 (09:57 +0200)
commit77a6b90ce56bc982dcfa94229b8e28e6abb16e95
treeb0eb340983a1a9528d273b170e237255f038c236
parent5e8e2a9624df72fca7c736b2966b2cbf6c9c3ff6
net: mvpp2: build skb from XDP-adjusted data on XDP_PASS

When an XDP program uses bpf_xdp_adjust_head() or bpf_xdp_adjust_tail()
and then returns XDP_PASS, mvpp2 still builds the skb from fixed offsets
derived from the original RX descriptor. Packet geometry changes made by
the XDP program are therefore discarded before the skb reaches the stack.

Update rx_offset and rx_bytes from xdp.data and xdp.data_end for
XDP_PASS. This makes skb_reserve() and skb_put() reflect the packet seen
by XDP, and makes RX byte accounting for XDP_PASS follow the length of the
skb passed to the network stack.

Keep a separate rx_sync_size for page-pool recycling on skb allocation
failure, which must stay tied to the received buffer range.

Non-PASS verdicts continue to account the descriptor length because no skb
is passed up in those cases.

Fixes: 07dd0a7aae7f ("mvpp2: add basic XDP support")
Signed-off-by: Til Kaiser <mail@tk154.de>
Link: https://patch.msgid.link/20260607134943.21996-5-mail@tk154.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c