1
0
Fork 0
alistair23-linux/drivers/net
Andrey Konovalov d4aea20d88 tun: Use netif_receive_skb instead of netif_rx
This patch changes tun.c to call netif_receive_skb instead of netif_rx
when a packet is received (if CONFIG_4KSTACKS is not enabled to avoid
stack exhaustion). The difference between the two is that netif_rx queues
the packet into the backlog, and netif_receive_skb proccesses the packet
in the current context.

This patch is required for syzkaller [1] to collect coverage from packet
receive paths, when a packet being received through tun (syzkaller collects
coverage per process in the process context).

As mentioned by Eric this change also speeds up tun/tap. As measured by
Peter it speeds up his closed-loop single-stream tap/OVS benchmark by
about 23%, from 700k packets/second to 867k packets/second.

A similar patch was introduced back in 2010 [2, 3], but the author found
out that the patch doesn't help with the task he had in mind (for cgroups
to shape network traffic based on the original process) and decided not to
go further with it. The main concern back then was about possible stack
exhaustion with 4K stacks.

[1] https://github.com/google/syzkaller

[2] https://www.spinics.net/lists/netdev/thrd440.html#130570

[3] https://www.spinics.net/lists/netdev/msg130570.html

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-06 22:24:59 -05:00
..
appletalk net: deprecate eth_change_mtu, remove usage 2016-10-13 09:36:57 -04:00
arcnet
bonding netns: make struct pernet_operations::id unsigned int 2016-11-18 10:59:15 -05:00
caif
can linux-can-next-for-4.10-20161201 2016-12-03 15:26:30 -05:00
cris net: cris: make eth_v10.c explicitly non-modular 2016-10-31 20:58:34 -04:00
dsa net: dsa: mv88e6xxx: add PPU operations 2016-12-06 11:32:28 -05:00
ethernet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-06 21:33:19 -05:00
fddi net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
fjes net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
hamradio 6pack: fix buffer length mishandling 2016-09-20 22:51:30 -04:00
hippi net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
hyperv hv_netvsc: remove excessive logging on MTU change 2016-11-29 20:50:07 -05:00
ieee802154 ieee802154: fakelb: print number of created fake devices during probe 2016-11-30 12:33:07 +01:00
ipvlan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-03 12:29:53 -05:00
irda irda: w83977af_ir: Neaten logging 2016-12-06 21:46:56 -05:00
phy net: phy: dp83848: Support ethernet pause frames 2016-12-05 13:13:32 -05:00
plip net: deprecate eth_change_mtu, remove usage 2016-10-13 09:36:57 -04:00
ppp netns: make struct pernet_operations::id unsigned int 2016-11-18 10:59:15 -05:00
slip net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
team genetlink: mark families as __ro_after_init 2016-10-27 16:16:09 -04:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-06 21:33:19 -05:00
vmxnet3 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-30 12:42:58 -04:00
wan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-30 12:42:58 -04:00
wimax net: use core MTU range checking in wireless drivers 2016-10-20 14:51:08 -04:00
wireless iwlwifi: use reset to set transport header 2016-12-03 15:49:16 -05:00
xen-netback xen-netback: prefer xenbus_scanf() over xenbus_gather() 2016-11-09 20:24:35 -05:00
Kconfig ipvlan: Fix dependency issue 2016-09-20 22:55:23 -04:00
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
geneve.c geneve: avoid use-after-free of skb->data 2016-12-02 14:07:11 -05:00
gtp.c netns: make struct pernet_operations::id unsigned int 2016-11-18 10:59:15 -05:00
ifb.c
loopback.c
macsec.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-30 12:42:58 -04:00
macvlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-26 23:42:21 -05:00
macvtap.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-03 12:29:53 -05:00
mdio.c
mii.c net: mii: report 0 for unknown lp_advertising 2016-11-09 20:26:58 -05:00
netconsole.c
nlmon.c
ntb_netdev.c net: use core MTU range checking in core net infra 2016-10-20 14:51:09 -04:00
rionet.c net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
sb1000.c net: deprecate eth_change_mtu, remove usage 2016-10-13 09:36:57 -04:00
sungem_phy.c
tun.c tun: Use netif_receive_skb instead of netif_rx 2016-12-06 22:24:59 -05:00
veth.c net: use core MTU range checking in core net infra 2016-10-20 14:51:09 -04:00
virtio_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-06 21:33:19 -05:00
vrf.c net: Enable support for VRF with ipv4 multicast 2016-11-01 11:54:26 -04:00
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-03 12:29:53 -05:00
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-15 10:54:36 -05:00