eth: fbnic: Correct packet header prefetch

The existing call to net_prefetch() fetched a stale address. The data
pointer is not initialized until after the call to xdp_prepare_buff().
Thus, making the prefetch ineffective.

Open code the address calcuation to give the prefetch as much time
as possible.

This was found by manual code inspection. No issues have been observed
from this.

Fixes: 9064ab485f ("eth: fbnic: Prefetch packet headers on Rx")
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261020172706.1090951-1-dimitri.daskalakis1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Dimitri Daskalakis 2026-10-20 10:27:06 -07:00 committed by Jakub Kicinski
parent e3aaeebbef
commit 286154ae69

View File

@ -1025,7 +1025,7 @@ static void fbnic_pkt_prepare(struct fbnic_napi_vector *nv, u64 rcd,
/* Build frame around buffer */
hdr_start = page_address(page) + hdr_pg_start;
net_prefetch(pkt->buff.data);
net_prefetch(hdr_start + headroom);
xdp_prepare_buff(&pkt->buff, hdr_start, headroom,
len - FBNIC_RX_PAD, true);