Skip to content

Commit

Permalink
mvpp2: prefetch frame header
Browse files Browse the repository at this point in the history
When receiving traffic, eth_type_trans() is high up on the perf top list,
because it's the first function which access the packet data.

Move the DMA unmap a bit higher, and put a prefetch just after it, so we
have more time to load the data into the cache.

The packet rate increase is about 14% with a tc drop test: 1620 => 1853 kpps

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Matteo Croce authored and David S. Miller committed Oct 28, 2019
1 parent e192116 commit a0c7833
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2962,6 +2962,7 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi,
dma_sync_single_for_cpu(dev->dev.parent, dma_addr,
rx_bytes + MVPP2_MH_SIZE,
DMA_FROM_DEVICE);
prefetch(data);

if (bm_pool->frag_size > PAGE_SIZE)
frag_size = 0;
Expand Down

0 comments on commit a0c7833

Please sign in to comment.