aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2012-12-03 05:07:14 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-03 15:07:36 -0500
commit5d097109257c03a71845729f8db6b5770c4bbedc (patch)
tree4ef14ea47b21f6f81412c95889ca30147e0f0458 /include
parent9ba2add3cf5c103b7236f82a023c8ee05a51e4d1 (diff)
tun: only queue packets on device
Historically tun supported two modes of operation: - in default mode, a small number of packets would get queued at the device, the rest would be queued in qdisc - in one queue mode, all packets would get queued at the device This might have made sense up to a point where we made the queue depth for both modes the same and set it to a huge value (500) so unless the consumer is stuck the chance of losing packets is small. Thus in practice both modes behave the same, but the default mode has some problems: - if packets are never consumed, fragments are never orphaned which cases a DOS for sender using zero copy transmit - overrun errors are hard to diagnose: fifo error is incremented only once so you can not distinguish between userspace that is stuck and a transient failure, tcpdump on the device does not show any traffic Userspace solves this simply by enabling IFF_ONE_QUEUE but there seems to be little point in not doing the right thing for everyone, by default. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/if_tun.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index 958497ad5bb5..2835b85fd46d 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -31,6 +31,7 @@
31#define TUN_FASYNC 0x0010 31#define TUN_FASYNC 0x0010
32#define TUN_NOCHECKSUM 0x0020 32#define TUN_NOCHECKSUM 0x0020
33#define TUN_NO_PI 0x0040 33#define TUN_NO_PI 0x0040
34/* This flag has no real effect */
34#define TUN_ONE_QUEUE 0x0080 35#define TUN_ONE_QUEUE 0x0080
35#define TUN_PERSIST 0x0100 36#define TUN_PERSIST 0x0100
36#define TUN_VNET_HDR 0x0200 37#define TUN_VNET_HDR 0x0200
@@ -60,6 +61,7 @@
60#define IFF_TUN 0x0001 61#define IFF_TUN 0x0001
61#define IFF_TAP 0x0002 62#define IFF_TAP 0x0002
62#define IFF_NO_PI 0x1000 63#define IFF_NO_PI 0x1000
64/* This flag has no real effect */
63#define IFF_ONE_QUEUE 0x2000 65#define IFF_ONE_QUEUE 0x2000
64#define IFF_VNET_HDR 0x4000 66#define IFF_VNET_HDR 0x4000
65#define IFF_TUN_EXCL 0x8000 67#define IFF_TUN_EXCL 0x8000