Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Til Kaiser <mail@tk154.de>
Cc: Marcin Wojtas <marcin.s.wojtas@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Matteo Croce <mcroce@redhat.com>,
	Sven Auhagen <sven.auhagen@voleatech.de>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 3/4] net: mvpp2: do not return retired RX buffers to BM
Date: Thu, 4 Jun 2026 08:45:06 -0700	[thread overview]
Message-ID: <20260604084506.274d0ead@kernel.org> (raw)
In-Reply-To: <20260602164635.62517-4-mail@tk154.de>

On Tue,  2 Jun 2026 18:46:34 +0200 Til Kaiser wrote:
> The RX refill failure path jumps to err_drop_frame, which returns the
> descriptor buffer to the hardware BM pool. That is only valid while the
> driver still owns the buffer.
> 
> After a non-PASS XDP verdict, mvpp2_run_xdp() may already have recycled,
> redirected, or queued the page for XDP_TX. After build_skb(), freeing the
> skb on refill failure also retires the data buffer. Returning either of
> those buffers to BM lets hardware DMA into memory that is no longer owned
> by the RX ring.
> 
> Split the error handling so buffers are returned to BM only while still
> owned by the driver. Once XDP or an skb owns the buffer, only account the
> RX error. Mark page-pool skbs for recycle before they can be freed on the
> refill failure path, and unmap non-page-pool buffers before freeing them.

As Gemini points out the driver seems to be following the "if I can't
allocate a new buffer I'll drop the packet and give the current buffer
back to the HW" flow. So after your change on allocation error we're
permanently leaking a slot on in the buffer pool. Leaking as in it will
never be filled, if it happens enough times the pool will be empty,
and no Rx can happen.
-- 
pw-bot: cr

  reply	other threads:[~2026-06-04 15:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 16:46 [PATCH net v2 0/4] net: mvpp2: fix XDP RX buffer handling Til Kaiser
2026-06-02 16:46 ` [PATCH net v2 1/4] net: mvpp2: sync RX data at the hardware packet offset Til Kaiser
2026-06-02 16:46 ` [PATCH net v2 2/4] net: mvpp2: limit XDP frame size to the RX buffer Til Kaiser
2026-06-02 16:46 ` [PATCH net v2 3/4] net: mvpp2: do not return retired RX buffers to BM Til Kaiser
2026-06-04 15:45   ` Jakub Kicinski [this message]
2026-06-02 16:46 ` [PATCH net v2 4/4] net: mvpp2: build skb from XDP-adjusted data on XDP_PASS Til Kaiser
2026-06-03 13:55 ` [PATCH net v2 0/4] net: mvpp2: fix XDP RX buffer handling Alexander Lobakin
2026-06-04 11:30   ` Marcin Wojtas

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=20260604084506.274d0ead@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-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lorenzo@kernel.org \
    --cc=mail@tk154.de \
    --cc=marcin.s.wojtas@gmail.com \
    --cc=mcroce@redhat.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