diff options
author | Amit Cohen <amcohen@nvidia.com> | 2024-06-18 13:34:44 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-06-19 17:38:11 -0700 |
commit | 0f3cd437a1d88b2a77dfb146c88a297bea974ceb (patch) | |
tree | 932aa636ff5fc656c51cf03032a6557850b2a95e /drivers/net/ethernet/mellanox/mlxsw/pci.c | |
parent | b5b60bb491b26b0e5961e021b2988562eaa6a8c7 (diff) |
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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/pci.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/pci.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c index 4b34db2ae8f0..6f41747e8a76 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c @@ -396,6 +396,7 @@ static struct sk_buff *mlxsw_pci_rdq_build_skb(struct page *page, unsigned int allocated_size; struct sk_buff *skb; + net_prefetch(data); allocated_size = page_size(page); skb = napi_build_skb(data, allocated_size); if (unlikely(!skb)) |