Skip to content

Commit 0f3cd43

Browse files
Amit Cohenkuba-moo
authored andcommitted
mlxsw: pci: Optimize data buffer access
Before accessing data buffer, call net_prefetch() to load it into the cache. This change improves driver performance, CPU can handle about 7.1% more packets per second. Signed-off-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/1fa07c510890866a6f201163ab7e78890ba28b3b.1718709196.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent b5b60bb commit 0f3cd43

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+1
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ static struct sk_buff *mlxsw_pci_rdq_build_skb(struct page *page,
396396
unsigned int allocated_size;
397397
struct sk_buff *skb;
398398

399+
net_prefetch(data);
399400
allocated_size = page_size(page);
400401
skb = napi_build_skb(data, allocated_size);
401402
if (unlikely(!skb))

0 commit comments

Comments
 (0)