Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deepin-Kernel-SIG] [Upstream] [linux 6.6-y] net: stmmac: Convert prefetch() to net_prefetch() for rece… #578

Merged
merged 3 commits into from
Jan 25, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
net: stmmac: Convert prefetch() to net_prefetch() for received frames
mainline inclusion
from mainline-v6.14-rc1
category: performance

The size of DMA descriptors is 32 bytes at most.
net_prefetch() for received frames, and keep prefetch() for descriptors.

This patch brings ~4.8% driver performance improvement in a TCP RX
throughput test with iPerf tool on a single isolated Cortex-A65 CPU
core, 2.92 Gbits/sec increased to 3.06 Gbits/sec.

Suggested-by: Joe Damato <[email protected]>
Signed-off-by: Furong Xu <[email protected]>
Reviewed-by: Yanteng Si <[email protected]>
Reviewed-by: Larysa Zaremba <[email protected]>
Reviewed-by: Joe Damato <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>

(cherry picked from commit 204182edb3107f87a40f34affb3de8851e1c5d68)
Signed-off-by: Wentao Guan <[email protected]>
  • Loading branch information
Furong Xu authored and opsiff committed Jan 24, 2025
commit cc4d1907a49b74a35ee3d3fea16d630128049a06
3 changes: 2 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5429,7 +5429,8 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)

dma_sync_single_for_cpu(priv->device, buf->addr,
buf1_len, dma_dir);
prefetch(page_address(buf->page) + buf->page_offset);
net_prefetch(page_address(buf->page) +
buf->page_offset);

xdp_init_buff(&ctx.xdp, buf_sz, &rx_q->xdp_rxq);
xdp_prepare_buff(&ctx.xdp, page_address(buf->page),
Expand Down
Loading