1
0
Fork 0
alistair23-linux/drivers/net
Jesper Dangaard Brouer 60bbf7eeef mlx5: use page_pool for xdp_return_frame call
This patch shows how it is possible to have both the driver local page
cache, which uses elevated refcnt for "catching"/avoiding SKB
put_page returns the page through the page allocator.  And at the
same time, have pages getting returned to the page_pool from
ndp_xdp_xmit DMA completion.

The performance improvement for XDP_REDIRECT in this patch is really
good.  Especially considering that (currently) the xdp_return_frame
API and page_pool_put_page() does per frame operations of both
rhashtable ID-lookup and locked return into (page_pool) ptr_ring.
(It is the plan to remove these per frame operation in a followup
patchset).

The benchmark performed was RX on mlx5 and XDP_REDIRECT out ixgbe,
with xdp_redirect_map (using devmap) . And the target/maximum
capability of ixgbe is 13Mpps (on this HW setup).

Before this patch for mlx5, XDP redirected frames were returned via
the page allocator.  The single flow performance was 6Mpps, and if I
started two flows the collective performance drop to 4Mpps, because we
hit the page allocator lock (further negative scaling occurs).

Two test scenarios need to be covered, for xdp_return_frame API, which
is DMA-TX completion running on same-CPU or cross-CPU free/return.
Results were same-CPU=10Mpps, and cross-CPU=12Mpps.  This is very
close to our 13Mpps max target.

The reason max target isn't reached in cross-CPU test, is likely due
to RX-ring DMA unmap/map overhead (which doesn't occur in ixgbe to
ixgbe testing).  It is also planned to remove this unnecessary DMA
unmap in a later patchset

V2: Adjustments requested by Tariq
 - Changed page_pool_create return codes not return NULL, only
   ERR_PTR, as this simplifies err handling in drivers.
 - Save a branch in mlx5e_page_release
 - Correct page_pool size calc for MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ

V5: Updated patch desc

V8: Adjust for b0cedc844c ("net/mlx5e: Remove rq_headroom field from params")
V9:
 - Adjust for 121e892754 ("net/mlx5e: Refactor RQ XDP_TX indication")
 - Adjust for 73281b78a3 ("net/mlx5e: Derive Striding RQ size from MTU")
 - Correct handling if page_pool_create fail for MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ

V10: Req from Tariq
 - Change pool_size calc for MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-17 10:50:29 -04:00
..
appletalk
arcnet
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-04-01 19:49:34 -04:00
caif drivers/net: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-04-03 14:04:18 -07:00
dsa net: dsa: mt7530: Use NULL instead of plain integer 2018-04-04 11:15:49 -04:00
ethernet mlx5: use page_pool for xdp_return_frame call 2018-04-17 10:50:29 -04:00
fddi
fjes
hamradio drivers/net: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
hippi
hyperv hv_netvsc: Pass net_device parameter to revoke and teardown functions 2018-04-05 22:21:00 -04:00
ieee802154 Merge branch 'ieee802154-for-davem-2018-03-29' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next 2018-03-30 13:00:11 -04:00
ipvlan net: Drop pernet_operations::async 2018-03-27 13:18:09 -04:00
netdevsim devlink: convert occ_get op to separate registration 2018-04-08 12:45:57 -04:00
phy dp83640: Ensure against premature access to PHY registers after reset 2018-04-08 19:58:52 -04:00
plip
ppp pptp: remove a buggy dst release in pptp_connect() 2018-04-04 11:17:55 -04:00
slip slip: Check if rstate is initialized before uncompressing 2018-04-11 10:33:46 -04:00
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-04-01 19:49:34 -04:00
usb lan78xx: Don't reset the interface on open 2018-04-11 14:44:45 -04:00
vmxnet3 vmxnet3: remove unused flag "rxcsum" from struct vmxnet3_adapter 2018-03-20 10:56:25 -04:00
wan hdlc_ppp: carrier detect ok, don't turn off negotiation 2018-02-26 14:38:12 -05:00
wimax net: drivers/net: Remove unnecessary skb_copy_expand OOM messages 2018-03-15 14:28:03 -04:00
wireless mac80211_hwsim: use DEFINE_IDA 2018-04-11 10:28:39 -07:00
xen-netback drivers/net: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
Kconfig netdevsim: Add simple FIB resource controller via devlink 2018-03-29 14:10:31 -04:00
LICENSE.SRC
Makefile net: remove cris etrax ethernet driver 2018-03-26 15:56:24 +02:00
Space.c net/mac89x0: Convert to platform_driver 2018-03-01 21:21:36 -05:00
dummy.c net: Do not take net_rwsem in __rtnl_link_unregister() 2018-03-31 22:24:58 -04:00
eql.c
geneve.c net: Drop pernet_operations::async 2018-03-27 13:18:09 -04:00
gtp.c net: Drop pernet_operations::async 2018-03-27 13:18:09 -04:00
ifb.c net: Do not take net_rwsem in __rtnl_link_unregister() 2018-03-31 22:24:58 -04:00
loopback.c net: Drop pernet_operations::async 2018-03-27 13:18:09 -04:00
macsec.c macsec: missing dev_put() on error in macsec_newlink() 2018-03-22 14:30:36 -04:00
macvlan.c macvlan: filter out unsupported feature flags 2018-03-11 22:46:16 -04:00
macvtap.c
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
thunderbolt.c net: thunderbolt: Run disconnect flow asynchronously when logout is received 2018-02-12 12:03:04 -05:00
tun.c xdp: rhashtable with allocator ID to pointer mapping 2018-04-17 10:50:29 -04:00
veth.c
virtio_net.c xdp: rhashtable with allocator ID to pointer mapping 2018-04-17 10:50:29 -04:00
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-04-01 19:49:34 -04:00
vsockmon.c
vxlan.c net: Drop pernet_operations::async 2018-03-27 13:18:09 -04:00
xen-netfront.c drivers/net: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00