Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Til Kaiser <mail@tk154.de>
Cc: netdev@vger.kernel.org, marcin.s.wojtas@gmail.com,
	linux@armlinux.org.uk, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org,
	john.fastabend@gmail.com, sdf@fomichev.me, mcroce@microsoft.com,
	sven.auhagen@voleatech.de, bpf@vger.kernel.org
Subject: Re: [PATCH] net: mvpp2: fix skb not reflecting XDP modifications on XDP_PASS
Date: Wed, 27 May 2026 19:02:49 -0700	[thread overview]
Message-ID: <20260527190249.0eefda22@kernel.org> (raw)
In-Reply-To: <20260524122334.1730451-1-mail@tk154.de>

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 <mail@tk154.de>

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

      reply	other threads:[~2026-05-28  2:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-24 12:23 [PATCH] net: mvpp2: fix skb not reflecting XDP modifications on XDP_PASS Til Kaiser
2026-05-28  2:02 ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260527190249.0eefda22@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=mail@tk154.de \
    --cc=marcin.s.wojtas@gmail.com \
    --cc=mcroce@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=sven.auhagen@voleatech.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox