Skip to content

Commit

Permalink
[FROMLIST] net: stmmac: Convert prefetch() to net_prefetch() for rece…
Browse files Browse the repository at this point in the history
…ived frames

next inclusion
from next-20250122
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]>
  • Loading branch information
opsiff authored Jan 24, 2025
1 parent 99b075d commit 8e04ba2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 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,9 @@ 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),
buf->page_offset, buf1_len, true);
Expand Down

0 comments on commit 8e04ba2

Please sign in to comment.