linux/drivers/net
Toke Høiland-Jørgensen 1d233886dd xdp: Use bulking for non-map XDP_REDIRECT and consolidate code paths
Since the bulk queue used by XDP_REDIRECT now lives in struct net_device,
we can re-use the bulking for the non-map version of the bpf_redirect()
helper. This is a simple matter of having xdp_do_redirect_slow() queue the
frame on the bulk queue instead of sending it out with __bpf_tx_xdp().

Unfortunately we can't make the bpf_redirect() helper return an error if
the ifindex doesn't exit (as bpf_redirect_map() does), because we don't
have a reference to the network namespace of the ingress device at the time
the helper is called. So we have to leave it as-is and keep the device
lookup in xdp_do_redirect_slow().

Since this leaves less reason to have the non-map redirect code in a
separate function, so we get rid of the xdp_do_redirect_slow() function
entirely. This does lose us the tracepoint disambiguation, but fortunately
the xdp_redirect and xdp_redirect_map tracepoints use the same tracepoint
entry structures. This means both can contain a map index, so we can just
amend the tracepoint definitions so we always emit the xdp_redirect(_err)
tracepoints, but with the map ID only populated if a map is present. This
means we retire the xdp_redirect_map(_err) tracepoints entirely, but keep
the definitions around in case someone is still listening for them.

With this change, the performance of the xdp_redirect sample program goes
from 5Mpps to 8.4Mpps (a 68% increase).

Since the flush functions are no longer map-specific, rename the flush()
functions to drop _map from their names. One of the renamed functions is
the xdp_do_flush_map() callback used in all the xdp-enabled drivers. To
keep from having to update all drivers, use a #define to keep the old name
working, and only update the virtual drivers in this patch.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/157918768505.1458396.17518057312953572912.stgit@toke.dk
2020-01-16 20:03:34 -08:00
..
appletalk netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
arcnet netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
bonding bonding: rename AD_STATE_* to LACP_STATE_* 2019-12-26 13:09:37 -08:00
caif net: caif: replace BUG_ON with recovery code 2019-12-16 16:29:05 -08:00
can can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices 2019-12-08 12:22:01 +01:00
dsa net: dsa: mv88e6xxx: Unique ATU and VTU IRQ names 2020-01-06 18:30:15 -08:00
ethernet enetc: Fix inconsistent IS_ERR and PTR_ERR 2020-01-07 13:46:42 -08:00
fddi
fjes Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 09:54:33 -08:00
ieee802154 drivers: net: Fix Kconfig indentation, continued 2019-11-21 11:54:09 -08:00
ipvlan
netdevsim ipv6: Remove old route notifications and convert listeners 2019-12-24 22:37:30 -08:00
phy net: phylink: add support for polling MAC PCS 2020-01-05 23:22:32 -08:00
plip
ppp ppp: Remove redundant BUG_ON() check in ppp_pernet 2019-12-27 16:30:52 -08:00
slip netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
team
usb net: ch9200: remove unnecessary return 2020-01-07 13:30:36 -08:00
vmxnet3 netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
wan drivers: net: cisco_hdlc: use __func__ in debug message 2020-01-07 13:33:35 -08:00
wimax netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
wireguard wireguard: socket: mark skbs as not on list when receiving via gro 2020-01-05 14:08:32 -08:00
wireless wil6210: get rid of begin() and complete() ethtool_ops 2020-01-06 13:54:55 -08:00
xen-netback xen-netback: support dynamic unbind/bind 2019-12-26 15:16:26 -08:00
Kconfig wireguard: Kconfig: select parent dependency for crypto 2019-12-16 19:22:22 -08:00
LICENSE.SRC
Makefile net: WireGuard secure network tunnel 2019-12-08 17:48:42 -08:00
Space.c
dummy.c
eql.c
geneve.c treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
gtp.c gtp: simplify error handling code in 'gtp_encap_enable()' 2020-01-06 13:39:35 -08:00
ifb.c
loopback.c
macsec.c
macvlan.c net: macvlan: Use the PHY time stamping interface. 2019-12-25 19:51:33 -08:00
macvtap.c
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c xdp: Use bulking for non-map XDP_REDIRECT and consolidate code paths 2020-01-16 20:03:34 -08:00
veth.c xdp: Use bulking for non-map XDP_REDIRECT and consolidate code paths 2020-01-16 20:03:34 -08:00
virtio_net.c xdp: Use bulking for non-map XDP_REDIRECT and consolidate code paths 2020-01-16 20:03:34 -08:00
vrf.c
vsockmon.c
vxlan.c vxlan: Fix alignment and code style of vxlan.c 2020-01-02 15:41:33 -08:00
xen-netfront.c