linux_dsm_epyc7002/drivers/net/ethernet/intel
Jesper Dangaard Brouer 039930945a xdp: transition into using xdp_frame for return API
Changing API xdp_return_frame() to take struct xdp_frame as argument,
seems like a natural choice. But there are some subtle performance
details here that needs extra care, which is a deliberate choice.

When de-referencing xdp_frame on a remote CPU during DMA-TX
completion, result in the cache-line is change to "Shared"
state. Later when the page is reused for RX, then this xdp_frame
cache-line is written, which change the state to "Modified".

This situation already happens (naturally) for, virtio_net, tun and
cpumap as the xdp_frame pointer is the queued object.  In tun and
cpumap, the ptr_ring is used for efficiently transferring cache-lines
(with pointers) between CPUs. Thus, the only option is to
de-referencing xdp_frame.

It is only the ixgbe driver that had an optimization, in which it can
avoid doing the de-reference of xdp_frame.  The driver already have
TX-ring queue, which (in case of remote DMA-TX completion) have to be
transferred between CPUs anyhow.  In this data area, we stored a
struct xdp_mem_info and a data pointer, which allowed us to avoid
de-referencing xdp_frame.

To compensate for this, a prefetchw is used for telling the cache
coherency protocol about our access pattern.  My benchmarks show that
this prefetchw is enough to compensate the ixgbe driver.

V7: Adjust for commit d9314c474d ("i40e: add support for XDP_REDIRECT")
V8: Adjust for commit bd658dda42 ("net/mlx5e: Separate dma base address
and offset in dma_sync call")

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-17 10:50:29 -04:00
..
e1000 intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
e1000e intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
fm10k pci-v4.17-changes 2018-04-06 18:31:06 -07:00
i40e xdp: transition into using xdp_frame for return API 2018-04-17 10:50:29 -04:00
i40evf intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ice ice: Bug fixes in ethtool code 2018-04-06 07:00:09 -07:00
igb ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
igbvf intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgb intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe xdp: transition into using xdp_frame for return API 2018-04-17 10:50:29 -04:00
ixgbevf ixgbevf: Add XDP queue stats reporting 2018-03-23 15:22:11 -07:00
e100.c intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
Kconfig ice: Add basic driver framework for Intel(R) E800 Series 2018-03-26 08:28:02 -07:00
Makefile ice: Add basic driver framework for Intel(R) E800 Series 2018-03-26 08:28:02 -07:00