eth: fbnic: Correct packet header prefetch
Subsystems (3)
PATCH 1/1 eth: fbnic: Correct packet header prefetch
From: Dimitri Daskalakis <[email protected]>
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.
--- drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c +1 -1
@@ -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);
Signature · 1 line
2.52.0
Quoted 9 lines · Dimitri Daskalakis
From: Dimitri Daskalakis <[email protected]>
The existing call to
net_prefetch()fetched a stale address. The data pointer is not initialized until after the call toxdp_prepare_buff(). Thus, making the prefetch ineffective.Open code the address calcuation to give the prefetch as much time as possible.
Quoted 6 lines
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 <[email protected]>Signed-off-by Dimitri Daskalakis <[email protected]>
Quoted 9 lines
From: Dimitri Daskalakis <[email protected]>
The existing call to
net_prefetch()fetched a stale address. The data pointer is not initialized until after the call toxdp_prepare_buff(). Thus, making the prefetch ineffective.Open code the address calcuation to give the prefetch as much time as possible.
Quoted 6 lines
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 <[email protected]>Signed-off-by Dimitri Daskalakis <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Tue, 20 Oct 2026 10:27:06 -0700 you wrote:
From: Dimitri Daskalakis <[email protected]>
The existing call to
net_prefetch()fetched a stale address. The data pointer is not initialized until after the call toxdp_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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html