linux/drivers/net/ethernet/mellanox/mlx5/core
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
..
accel net/mlx5: Add flow-steering commands for FPGA IPSec implementation 2018-03-07 15:54:35 -08:00
diag net/mlx5: Add core support for vlan push/pop steering action 2018-03-26 13:47:13 -07:00
en_accel net/mlx5: IPSec, Add support for ESN 2018-03-07 15:54:36 -08:00
fpga Merge candidates for 4.17 merge window 2018-04-06 17:35:43 -07:00
ipoib net/mlx5e: Derive Striding RQ size from MTU 2018-03-30 16:16:17 -07:00
lib net/mlx5e: Eliminate build warnings on no previous prototype 2018-02-20 12:52:56 -08:00
alloc.c IB/mlx5: Implement fragmented completion queue (CQ) 2018-02-15 00:30:03 -08:00
cmd.c net/mlx5: Protect from command bit overflow 2018-03-26 13:47:14 -07:00
cq.c net/mlx5: Fix wrongly assigned CQ reference counter 2018-03-07 15:54:36 -08:00
debugfs.c
dev.c net/mlx5: E-Switch, Reload IB interface when switching devlink modes 2018-02-23 12:36:39 -08:00
en_arfs.c
en_common.c net/mlx5: Mkey creation command adjustments 2018-04-05 13:04:49 -06:00
en_dcbnl.c net/mlx5e: Check support before TC swap in ETS init 2018-01-12 02:01:49 +02:00
en_dim.c net/mlx5e: Move dynamic interrupt coalescing code to include/linux 2018-01-10 15:27:44 -05:00
en_ethtool.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-04-01 19:49:34 -04:00
en_fs_ethtool.c
en_fs.c net/mlx5e: Refactor RSS related objects and code 2018-01-19 22:41:32 +02:00
en_main.c mlx5: use page_pool for xdp_return_frame call 2018-04-17 10:50:29 -04:00
en_rep.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-04-01 19:49:34 -04:00
en_rep.h
en_rx.c xdp: transition into using xdp_frame for return API 2018-04-17 10:50:29 -04:00
en_selftest.c net/mlx5e: Fix loopback self test when GRO is off 2018-02-20 12:52:54 -08:00
en_stats.c net/mlx5e: Recover Send Queue (SQ) from error state 2018-03-27 17:29:28 -07:00
en_stats.h net/mlx5e: Recover Send Queue (SQ) from error state 2018-03-27 17:29:28 -07:00
en_tc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-04-01 19:49:34 -04:00
en_tc.h
en_tx.c net/mlx5e: Recover Send Queue (SQ) from error state 2018-03-27 17:29:28 -07:00
en_txrx.c net/dim: use struct net_dim_sample as arg to net_dim 2018-01-10 15:27:45 -05:00
en.h mlx5: use page_pool for xdp_return_frame call 2018-04-17 10:50:29 -04:00
eq.c net/mlx5: Remove redundant EQ API exports 2018-02-15 00:30:02 -08:00
eswitch_offloads.c net/mlx5e: Offload tc vlan push/pop using HW action 2018-03-26 13:47:13 -07:00
eswitch.c net/mlx5: Add packet dropped while vport down statistics 2018-03-26 13:47:11 -07:00
eswitch.h net/mlx5e: Offload tc vlan push/pop using HW action 2018-03-26 13:47:13 -07:00
fs_cmd.c net/mlx5: Add core support for vlan push/pop steering action 2018-03-26 13:47:13 -07:00
fs_cmd.h net/mlx5: Flow steering cmd interface should get the fte when deleting 2018-03-06 22:20:15 -08:00
fs_core.c net/mlx5: Add core support for vlan push/pop steering action 2018-03-26 13:47:13 -07:00
fs_core.h net/mlx5: Embed mlx5_flow_act into fs_fte 2018-03-06 22:20:13 -08:00
fs_counters.c
fw.c Merge candidates for 4.17 merge window 2018-04-06 17:35:43 -07:00
health.c {net, IB}/mlx5: Raise fatal IB event when sys error occurs 2018-02-28 12:10:32 -07:00
Kconfig page_pool: refurbish version of page_pool code 2018-04-17 10:50:29 -04:00
lag.c
mad.c
main.c pci-v4.17-changes 2018-04-06 18:31:06 -07:00
Makefile net/mlx5e: Move dynamic interrupt coalescing code to include/linux 2018-01-10 15:27:44 -05:00
mcg.c
mlx5_core.h net/mlx5e: Unify slow PCI heuristic 2018-03-27 17:17:26 -07:00
mr.c
pagealloc.c
pd.c
port.c net/mlx5e: PFC stall prevention support 2018-03-26 13:46:46 -07:00
qp.c Linux 4.15 2018-01-30 09:30:00 -07:00
rl.c net/mlx5: Packet pacing enhancement 2018-03-19 11:54:41 -06:00
sriov.c
srq.c
transobj.c net/mlx5: Eliminate query xsrq dead code 2018-03-30 16:16:17 -07:00
uar.c net/mlx5: Fix mlx5_get_uars_page to return error code 2018-01-12 02:01:47 +02:00
vport.c net/mlx5: Add packet dropped while vport down statistics 2018-03-26 13:47:11 -07:00
vxlan.c
vxlan.h
wq.c IB/mlx5: Implement fragmented completion queue (CQ) 2018-02-15 00:30:03 -08:00
wq.h IB/mlx5: Implement fragmented completion queue (CQ) 2018-02-15 00:30:03 -08:00