[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250417120005.3288549-1-vladimir.oltean@nxp.com>
Date: Thu, 17 Apr 2025 15:00:02 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: netdev@...r.kernel.org
Cc: Claudiu Manoil <claudiu.manoil@....com>,
Wei Fang <wei.fang@....com>,
Clark Wang <xiaoning.wang@....com>,
Vlatko Markovikj <vlatko.markovikj@...s.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Toke Hoiland-Jorgensen <toke@...hat.com>,
Alexander Lobakin <aleksander.lobakin@...el.com>,
imx@...ts.linux.dev,
linux-kernel@...r.kernel.org,
bpf@...r.kernel.org
Subject: [PATCH net 0/3] ENETC bug fixes for bpf_xdp_adjust_head() and bpf_xdp_adjust_tail()
It has been reported that on the ENETC driver, bpf_xdp_adjust_head()
and bpf_xdp_adjust_tail() are broken in combination with the XDP_PASS
verdict. I have constructed a series a simple XDP programs and tested
with various packet sizes and confirmed that this is the case.
Patch 3/3 fixes the core issue, which is that the sk_buff created on
XDP_PASS is created by the driver as if XDP never ran, but in fact the
geometry needs to be adjusted according to the delta applied by the
program on the original xdp_buff. It depends on commit 539c1fba1ac7
("xdp: add generic xdp_build_skb_from_buff()") which is not available in
"stable" but perhaps should be.
Patch 2/3 is a small refactor necessary for 3/3.
Patch 1/3 fixes a related issue I noticed, which is that
bpf_xdp_adjust_tail() with a positive offset works for linear XDP
buffers, but returns an error for non-linear ones, even if there is
plenty of space in the final page fragment.
Vladimir Oltean (3):
net: enetc: register XDP RX queues with frag_size
net: enetc: refactor bulk flipping of RX buffers to separate function
net: enetc: fix frame corruption on bpf_xdp_adjust_head/tail() and
XDP_PASS
drivers/net/ethernet/freescale/enetc/enetc.c | 45 ++++++++++++--------
1 file changed, 28 insertions(+), 17 deletions(-)
--
2.34.1
Powered by blists - more mailing lists