Skip to content

Commit

Permalink
net: stmmac: Convert prefetch() to net_prefetch() for received frames
Browse files Browse the repository at this point in the history
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
1 parent ec3de84 commit cc4d190
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit cc4d190

Please sign in to comment.