linux/drivers
Herbert Xu 33dccbb050 tun: Limit amount of queued packets per device
Unlike a normal socket path, the tuntap device send path does
not have any accounting.  This means that the user-space sender
may be able to pin down arbitrary amounts of kernel memory by
continuing to send data to an end-point that is congested.

Even when this isn't an issue because of limited queueing at
most end points, this can also be a problem because its only
response to congestion is packet loss.  That is, when those
local queues at the end-point fills up, the tuntap device will
start wasting system time because it will continue to send
data there which simply gets dropped straight away.

Of course one could argue that everybody should do congestion
control end-to-end, unfortunately there are people in this world
still hooked on UDP, and they don't appear to be going away
anywhere fast.  In fact, we've always helped them by performing
accounting in our UDP code, the sole purpose of which is to
provide congestion feedback other than through packet loss.

This patch attempts to apply the same bandaid to the tuntap device.
It creates a pseudo-socket object which is used to account our
packets just as a normal socket does for UDP.  Of course things
are a little complex because we're actually reinjecting traffic
back into the stack rather than out of the stack.

The stack complexities however should have been resolved by preceding
patches.  So this one can simply start using skb_set_owner_w.

For now the accounting is essentially disabled by default for
backwards compatibility.  In particular, we set the cap to INT_MAX.
This is so that existing applications don't get confused by the
sudden arrival EAGAIN errors.

In future we may wish (or be forced to) do this by default.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-05 21:25:32 -08:00
..
accessibility
acpi
amba
ata Fix my email address in qd65xx.[ch]/pata_qdi.c 2009-02-03 16:53:56 -08:00
atm
auxdisplay
base driver-core: fix kernel-doc parameter name 2009-01-28 15:55:48 -08:00
block
bluetooth
cdrom
char Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2009-02-04 16:51:58 -08:00
clocksource
connector connector: create connector workqueue only while needed once 2009-02-02 23:22:04 -08:00
cpufreq
cpuidle
crypto
dca dca: redesign locks to fix deadlocks 2009-02-02 23:26:57 -08:00
dio
dma
edac powerpc: More printing warning fixes for the l64 to ll64 conversion 2009-01-28 17:15:52 +11:00
eisa
firewire firewire: sbp2: add workarounds for 2nd and 3rd generation iPods 2009-01-29 20:19:48 +01:00
firmware DMI: Introduce dmi_first_match to make the interface more flexible 2009-01-27 02:15:47 -05:00
gpio gpiolib: fix request related issue 2009-01-29 18:04:43 -08:00
gpu Stop playing silly games with the VM_ACCOUNT flag 2009-01-31 15:08:56 -08:00
hid HID: document difference between hid_blacklist and hid_ignore_list 2009-01-29 11:23:12 +01:00
hwmon hwmon: applesmc: add support for MacPro 3 temperature sensors 2009-01-29 18:04:45 -08:00
i2c
ide Fix my email address in qd65xx.[ch]/pata_qdi.c 2009-02-03 16:53:56 -08:00
idle
ieee1394 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2009-01-29 18:09:41 -08:00
infiniband iw_cxgb3: handle chip reset notifications 2009-01-26 22:22:19 -08:00
input
isdn
leds
lguest lguest: Fix a memory leak with the lg object during launcher close 2009-01-30 11:34:11 +10:30
macintosh
mca
md
media V4L/DVB (10411): s5h1409: Perform s5h1409 soft reset after tuning 2009-02-01 10:41:02 -02:00
memstick
message
mfd
misc sgi-xp: link XPNET's net_device_ops to its net_device structure 2009-02-03 15:16:48 -08:00
mmc pxamci: enable DMA for write ops after CMD/RESP 2009-02-02 20:57:07 +01:00
mtd Merge master.kernel.org:/home/rmk/linux-2.6-arm 2009-02-03 16:52:10 -08:00
net tun: Limit amount of queued packets per device 2009-02-05 21:25:32 -08:00
nubus
of
oprofile
parisc Documentation: move DMA-mapping.txt to Doc/PCI/ 2009-01-29 18:19:29 -08:00
parport
pci PCI hotplug: Change link order of pciehp & acpiphp 2009-01-27 15:35:51 -08:00
pcmcia
platform hp-wmi: set initial docking state 2009-01-29 18:04:45 -08:00
pnp
power
ps3
rapidio
regulator leds: Fix bounds checking of wm8350->pmic.led 2009-01-30 21:50:49 +00:00
rtc
s390 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-01-26 17:43:16 -08:00
sbus
scsi Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-02-03 00:15:35 -08:00
serial Add enable_ms to jsm driver 2009-01-30 08:40:54 -08:00
sh
sn
spi
ssb b43/ssb: Add SPROM8 extraction and LP-PHY detection 2009-01-29 15:59:38 -05:00
staging Documentation: move DMA-mapping.txt to Doc/PCI/ 2009-01-29 18:19:29 -08:00
tc
telephony
thermal
uio
usb Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream 2009-02-02 17:52:39 +00:00
uwb
video Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2009-02-02 19:26:44 -08:00
virtio virtio-pci: do not oops on config change if driver not loaded 2009-02-02 19:17:56 -08:00
w1
watchdog
xen xen: make sysfs files behave as their names suggest 2009-01-29 13:20:36 +01:00
zorro
Kconfig
Makefile