From: Jakub Kicinski <kuba@kernel.org>
To: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Cc: Marcin Wojtas <marcin.s.wojtas@gmail.com>,
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>,
Toke Hoiland-Jorgensen <toke@redhat.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net] net: mvneta: clear XDP pfmemalloc flag between frames
Date: Tue, 22 Sep 2026 19:01:18 -0700 [thread overview]
Message-ID: <20260922190118.1f1ffb81@kernel.org> (raw)
In-Reply-To: <20260920-mvneta-xdp-clear-frag-fix-v1-1-d7efadecf959@oss.qualcomm.com>
On Sun, 20 Sep 2026 09:55:09 +0200 Lorenzo Bianconi wrote:
> In mvneta_swbm_add_rx_fragment() the XDP pfmemalloc flag is set on the
> xdp_buff if the page under pressure is a pfmemalloc one. The xdp_buff is
> reused for the next packet and the flag is never cleared, so a pfmemalloc
> fragment in one packet wrongly marks the skb of a subsequent packet as
> pfmemalloc. Clear the flag in mvneta_swbm_rx_frame(), which is invoked for
> each new frame.
>
> Fixes: ed7a58cb40bd ("net: marvell: rely on xdp_update_skb_shared_info utility routine")
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
> ---
> drivers/net/ethernet/marvell/mvneta.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 543e566425c1..32416999f3d6 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -2341,6 +2341,7 @@ mvneta_swbm_rx_frame(struct mvneta_port *pp,
> /* Prefetch header */
> prefetch(data);
> xdp_buff_clear_frags_flag(xdp);
> + xdp_buff_clear_frag_pfmemalloc(xdp);
bit of a trap for your future self to clear the flags one by one.
Should we not write the flags to 0 ? Or maybe add:
/* Clear xdp_buf state for reuse on the same ring */
static __always_inline void xdp_reinit_buff(struct xdp_buff *xdp)
{
xdp->flags = 0;
}
and call that?
> xdp_prepare_buff(xdp, data, pp->rx_offset_correction + MVNETA_MH_SIZE,
> data_len, true);
> }
next prev parent reply other threads:[~2026-09-23 2:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 7:55 [PATCH net] net: mvneta: clear XDP pfmemalloc flag between frames Lorenzo Bianconi
2026-09-21 12:32 ` Simon Horman
2026-09-23 2:01 ` Jakub Kicinski [this message]
2026-09-23 10:09 ` Lorenzo Bianconi
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=20260922190118.1f1ffb81@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=lorenzo.bianconi@oss.qualcomm.com \
--cc=lorenzo@kernel.org \
--cc=marcin.s.wojtas@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=toke@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.