linux/drivers/net
Xi Wang 9e641bdcfa net-tun: restructure tun_do_read for better sleep/wakeup efficiency
tun_do_read always adds current thread to wait queue, even if a packet
is ready to read. This is inefficient because both sleeper and waker
want to acquire the wait queue spin lock when packet rate is high.

We restructure the read function and use common kernel networking
routines to handle receive, sleep and wakeup. With the change
available packets are checked first before the reading thread is added
to the wait queue.

Ran performance tests with the following configuration:

 - my packet generator -> tap1 -> br0 -> tap0 -> my packet consumer
 - sender pinned to one core and receiver pinned to another core
 - sender send small UDP packets (64 bytes total) as fast as it can
 - sandy bridge cores
 - throughput are receiver side goodput numbers

The results are

baseline: 731k pkts/sec, cpu utilization at 1.50 cpus
 changed: 783k pkts/sec, cpu utilization at 1.53 cpus

The performance difference is largely determined by packet rate and
inter-cpu communication cost. For example, if the sender and
receiver are pinned to different cpu sockets, the results are

baseline: 558k pkts/sec, cpu utilization at 1.71 cpus
 changed: 690k pkts/sec, cpu utilization at 1.67 cpus

Co-authored-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Xi Wang <xii@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-05-21 15:50:28 -04:00
..
appletalk
arcnet
bonding bonding: replace SLAVE_IS_OK() with bond_slave_can_tx() 2014-05-16 16:34:33 -04:00
caif
can can: gs_usb: Added support for the GS_USB CAN devices 2014-05-19 09:38:25 +02:00
cris
dsa net: dsa: update DSA drivers to use ds_to_priv 2014-04-30 13:31:25 -04:00
ethernet net: ethernet: ibm: ehea: ehea_qmr.c: Fix for possible null pointer dereference 2014-05-18 21:26:02 -04:00
fddi
hamradio yam: replace del_timer by del_timer_sync 2014-03-27 15:28:06 -04:00
hippi
hyperv net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
ieee802154 at86rf230: remove function for setting irq polarity 2014-04-26 12:20:35 -04:00
irda irda: sh_irda: Enable driver compilation with COMPILE_TEST 2014-05-14 15:23:55 -04:00
phy net: phy: extend fixed driver with fixed_phy_register() 2014-05-16 17:18:49 -04:00
plip
ppp net: ppp: use sk_unattached_filter api 2014-03-31 00:45:09 -04:00
slip slip: fix spinlock variant 2014-04-27 23:35:12 -04:00
team team: forbid incorrect fall-through in notifier 2014-04-24 13:26:32 -04:00
usb net: cdc_ncm: fix 64bit division build error 2014-05-21 01:56:06 -04:00
vmxnet3 net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
wan drivers/net/wan: delete unneeded call to netdev_priv 2014-05-15 16:57:47 -04:00
wimax wimax/i2400m: remove open-coded skb_cow_head. 2014-03-29 17:49:47 -04:00
wireless net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
xen-netback net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
dummy.c net: Replace u64_stats_fetch_begin_bh to u64_stats_fetch_begin_irq 2014-03-14 22:41:36 -04:00
eql.c
ifb.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-03-29 18:48:54 -04:00
Kconfig netpoll: Remove dead packet receive code (CONFIG_NETPOLL_TRAP) 2014-03-17 15:48:12 -04:00
LICENSE.SRC
loopback.c net: Replace u64_stats_fetch_begin_bh to u64_stats_fetch_begin_irq 2014-03-14 22:41:36 -04:00
macvlan.c macvlan: simplify the structure port 2014-05-15 23:35:16 -04:00
macvtap.c mactap: Fix checksum errors for non-gso packets in bridge mode 2014-04-30 16:12:22 -04:00
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c net: nlmon: flag nlmon devs with LLTX/SG 2014-03-28 16:49:47 -04:00
ntb_netdev.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
rionet.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
sb1000.c
Space.c
sungem_phy.c
tun.c net-tun: restructure tun_do_read for better sleep/wakeup efficiency 2014-05-21 15:50:28 -04:00
veth.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-03-29 18:48:54 -04:00
virtio_net.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
vxlan.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
xen-netfront.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00