From: Matteo Croce <redacted>
These two patches prefetch some data from RAM so to reduce stall
and speedup the packet processing.
Matteo Croce (2):
mvpp2: prefetch right address
mvpp2: prefetch page
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--
2.31.1
From: Matteo Croce <redacted>
Most of the time during the RX is caused by the compound_head() call
done at the end of the RX loop:
│ build_skb():
[...]
│ static inline struct page *compound_head(struct page *page)
│ {
│ unsigned long head = READ_ONCE(page->compound_head);
65.23 │ ldr x2, [x1, #8]
Prefetch the page struct as soon as possible, to speedup the RX path
noticeabily by a ~3-4% packet rate in a drop test.
│ build_skb():
[...]
│ static inline struct page *compound_head(struct page *page)
│ {
│ unsigned long head = READ_ONCE(page->compound_head);
17.92 │ ldr x2, [x1, #8]
Signed-off-by: Matteo Croce <redacted>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
From: Matteo Croce <redacted>
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 <redacted>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Marcin Wojtas <hidden> Date: 2021-06-09 14:04:11
Hi Matteo,
śr., 9 cze 2021 o 15:47 Matteo Croce [off-list ref] napisał(a):
From: Matteo Croce <redacted>
These two patches prefetch some data from RAM so to reduce stall
and speedup the packet processing.
Matteo Croce (2):
mvpp2: prefetch right address
mvpp2: prefetch page
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
Thank you for the patches, they seem reasonable, however I'd like to
stress it on the CN913x setup @10G - I should have some slot for that
closer to EOW.
Best regards,
Marcin
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Wed, 9 Jun 2021 15:47:12 +0200 you wrote:
From: Matteo Croce <redacted>
These two patches prefetch some data from RAM so to reduce stall
and speedup the packet processing.
Matteo Croce (2):
mvpp2: prefetch right address
mvpp2: prefetch page
[...]