]> git.baikalelectronics.ru Git - kernel.git/commit
mvpp2: prefetch right address
authorMatteo Croce <mcroce@microsoft.com>
Wed, 9 Jun 2021 13:47:13 +0000 (15:47 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jun 2021 22:26:50 +0000 (15:26 -0700)
commit0b7fa9a569b191166afcaa4cf9443205e35c6a19
tree392c2ffffe20cb682387a5e961dae17790ae6c00
parent8e158aa26090239ecaf16a690bd4a9cfd28f50ac
mvpp2: prefetch right address

In the RX buffer, the received data starts after a headroom used to
align the IP header and to allow prepending headers efficiently.
The prefetch() should take this into account, and prefetch from
the very start of the received data.

We can see that ether_addr_equal_64bits(), which is the first function
to access the data, drops from the top of the perf top output.

prefetch(data):

Overhead  Shared Object     Symbol
  11.64%  [kernel]          [k] eth_type_trans

prefetch(data + MVPP2_MH_SIZE + MVPP2_SKB_HEADROOM):

Overhead  Shared Object     Symbol
  13.42%  [kernel]          [k] build_skb
  10.35%  [mvpp2]           [k] mvpp2_rx
   9.35%  [kernel]          [k] __netif_receive_skb_core
   8.24%  [kernel]          [k] kmem_cache_free
   7.97%  [kernel]          [k] dev_gro_receive
   7.68%  [kernel]          [k] page_pool_put_page
   7.32%  [kernel]          [k] kmem_cache_alloc
   7.09%  [mvpp2]           [k] mvpp2_bm_pool_put
   3.36%  [kernel]          [k] eth_type_trans

Also, move the eth_type_trans() call a bit down, to give the RAM more
time to prefetch the data.

Signed-off-by: Matteo Croce <mcroce@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c