]> git.baikalelectronics.ru Git - kernel.git/commit
xsk: i40e: ice: ixgbe: mlx5: Test for dma_need_sync earlier for better performance
authorMagnus Karlsson <magnus.karlsson@intel.com>
Fri, 28 Aug 2020 08:26:24 +0000 (10:26 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 31 Aug 2020 19:15:04 +0000 (21:15 +0200)
commit61acb2f844fe628e194e55891087e2c7f06e594e
treeb0f10d39c70160b836327b848855499a0594931c
parentd6dc003304c1475ceaf89d96466be6d5b1ccbb98
xsk: i40e: ice: ixgbe: mlx5: Test for dma_need_sync earlier for better performance

Test for dma_need_sync earlier to increase
performance. xsk_buff_dma_sync_for_cpu() takes an xdp_buff as
parameter and from that the xsk_buff_pool reference is dug out. Perf
shows that this dereference causes a lot of cache misses. But as the
buffer pool is now sent down to the driver at zero-copy initialization
time, we might as well use this pointer directly, instead of going via
the xsk_buff and we can do so already in xsk_buff_dma_sync_for_cpu()
instead of in xp_dma_sync_for_cpu. This gets rid of these cache
misses.

Throughput increases with 3% for the xdpsock l2fwd sample application
on my machine.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Link: https://lore.kernel.org/bpf/1598603189-32145-11-git-send-email-magnus.karlsson@intel.com
drivers/net/ethernet/intel/i40e/i40e_xsk.c
drivers/net/ethernet/intel/ice/ice_xsk.c
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c
include/net/xdp_sock_drv.h
include/net/xsk_buff_pool.h