linux/drivers/net/ethernet/intel/ixgbe
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
..
ixgbe_82598.c intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_82599.c intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_common.c intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_common.h ixgbe: add status reg reads to ixgbe_check_remove 2018-03-23 14:18:26 -07:00
ixgbe_dcb_82598.c intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_dcb_82598.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_dcb_82599.c ixgbe: Fix kernel-doc format warnings 2018-01-12 08:20:40 -08:00
ixgbe_dcb_82599.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_dcb_nl.c ixgbe: Don't assume dev->num_tc is equal to hardware TC config 2018-01-12 08:20:15 -08:00
ixgbe_dcb.c ixgbe: Fix kernel-doc format warnings 2018-01-12 08:20:40 -08:00
ixgbe_dcb.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_debugfs.c ixgbe: Fix kernel-doc format warnings 2018-01-12 08:20:40 -08:00
ixgbe_ethtool.c ixgbe: Add receive length error counter 2018-03-12 11:03:32 -07:00
ixgbe_fcoe.c ixgbe: Fix kernel-doc format warnings 2018-01-12 08:20:40 -08:00
ixgbe_fcoe.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_ipsec.c ixgbe: enable TSO with IPsec offload 2018-03-23 15:04:24 -07:00
ixgbe_ipsec.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_lib.c ixgbe: remove redundant initialization of 'pool' 2018-02-26 08:28:14 -08:00
ixgbe_main.c xdp: transition into using xdp_frame for return API 2018-04-17 10:50:29 -04:00
ixgbe_mbx.c
ixgbe_mbx.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_model.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_phy.c ixgbe: Fix kernel-doc format warnings 2018-01-12 08:20:40 -08:00
ixgbe_phy.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_ptp.c ixgbe: Fix kernel-doc format warnings 2018-01-12 08:20:40 -08:00
ixgbe_sriov.c ixgbe: fix disabling hide VLAN on VF reset 2018-03-12 12:54:59 -07:00
ixgbe_sriov.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_sysfs.c ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
ixgbe_type.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_x540.c ixgbe: Clear SWFW_SYNC register during init 2017-10-09 09:28:23 -07:00
ixgbe_x540.h intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00
ixgbe_x550.c ixgbe: fix read-modify-write in x550 phy setup 2018-03-23 14:49:07 -07:00
ixgbe.h xdp: transition into using xdp_frame for return API 2018-04-17 10:50:29 -04:00
Makefile intel: add SPDX identifiers to all the Intel drivers 2018-03-23 12:18:21 -04:00