* [PATCH net] eth: fbnic: Correct packet header prefetch
@ 2026-10-20 17:27 Dimitri Daskalakis
2026-10-20 19:06 ` Björn Töpel
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dimitri Daskalakis @ 2026-10-20 17:27 UTC (permalink / raw)
To: David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Simon Horman, Björn Töpel,
Mohsin Bashir, Bobby Eshleman, netdev, linux-kernel,
Dimitri Daskalakis, Dimitri Daskalakis
From: Dimitri Daskalakis <daskald@meta.com>
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: 9064ab485f04 ("eth: fbnic: Prefetch packet headers on Rx")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
---
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
index 10caacffee0f..69cd96a4508f 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
@@ -1011,7 +1011,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);
--
2.52.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net] eth: fbnic: Correct packet header prefetch
2026-10-20 17:27 [PATCH net] eth: fbnic: Correct packet header prefetch Dimitri Daskalakis
@ 2026-10-20 19:06 ` Björn Töpel
2026-10-23 11:22 ` Daniel Machon
2026-10-23 21:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Björn Töpel @ 2026-10-20 19:06 UTC (permalink / raw)
To: Dimitri Daskalakis, David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Simon Horman, Mohsin Bashir,
Bobby Eshleman, netdev, linux-kernel, Dimitri Daskalakis,
Dimitri Daskalakis
Dimitri Daskalakis <dimitri.daskalakis1@gmail.com> writes:
> From: Dimitri Daskalakis <daskald@meta.com>
>
> 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: 9064ab485f04 ("eth: fbnic: Prefetch packet headers on Rx")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net] eth: fbnic: Correct packet header prefetch
2026-10-20 17:27 [PATCH net] eth: fbnic: Correct packet header prefetch Dimitri Daskalakis
2026-10-20 19:06 ` Björn Töpel
@ 2026-10-23 11:22 ` Daniel Machon
2026-10-23 21:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Daniel Machon @ 2026-10-23 11:22 UTC (permalink / raw)
To: Dimitri Daskalakis
Cc: David S. Miller, Alexander Duyck, Jakub Kicinski, kernel-team,
Andrew Lunn, Eric Dumazet, Paolo Abeni, Simon Horman,
Björn Töpel, Mohsin Bashir, Bobby Eshleman, netdev,
linux-kernel, Dimitri Daskalakis
> From: Dimitri Daskalakis <daskald@meta.com>
>
> 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: 9064ab485f04 ("eth: fbnic: Prefetch packet headers on Rx")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net] eth: fbnic: Correct packet header prefetch
2026-10-20 17:27 [PATCH net] eth: fbnic: Correct packet header prefetch Dimitri Daskalakis
2026-10-20 19:06 ` Björn Töpel
2026-10-23 11:22 ` Daniel Machon
@ 2026-10-23 21:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-23 21:00 UTC (permalink / raw)
To: Dimitri Daskalakis
Cc: davem, alexanderduyck, kuba, kernel-team, andrew+netdev,
edumazet, pabeni, horms, bjorn, mohsin.bashr, bobbyeshleman,
netdev, linux-kernel, daskald
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 20 Oct 2026 10:27:06 -0700 you wrote:
> From: Dimitri Daskalakis <daskald@meta.com>
>
> 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.
>
> [...]
Here is the summary with links:
- [net] eth: fbnic: Correct packet header prefetch
https://git.kernel.org/netdev/net/c/286154ae6998
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-23 21:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 17:27 [PATCH net] eth: fbnic: Correct packet header prefetch Dimitri Daskalakis
2026-10-20 19:06 ` Björn Töpel
2026-10-23 11:22 ` Daniel Machon
2026-10-23 21:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®