diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2011-02-01 14:25:40 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-02-01 16:50:44 -0600 |
commit | f157ed202e51dc2492b201dc34ed28e89c973fb7 (patch) | |
tree | 5e54afa6d2ba07066beb0941453b778394297bbd /net | |
parent | 466b58648a7b2ba7edb280b585e0b0c26e3be31e (diff) |
tap: safe sndbuf default
With current sndbuf default value, a blocked
target guest can prevent another guest from
transmitting any packets. While current
sndbuf value (1M) is reported to help some
UDP based workloads, the default should
be safe (0).
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/tap-linux.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/tap-linux.c b/net/tap-linux.c index f7aa9041b8..ff8cad0ea0 100644 --- a/net/tap-linux.c +++ b/net/tap-linux.c @@ -82,12 +82,17 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required return fd; } -/* sndbuf should be set to a value lower than the tx queue - * capacity of any destination network interface. +/* sndbuf implements a kind of flow control for tap. + * Unfortunately when it's enabled, and packets are sent + * to other guests on the same host, the receiver + * can lock up the transmitter indefinitely. + * + * To avoid packet loss, sndbuf should be set to a value lower than the tx + * queue capacity of any destination network interface. * Ethernet NICs generally have txqueuelen=1000, so 1Mb is - * a good default, given a 1500 byte MTU. + * a good value, given a 1500 byte MTU. */ -#define TAP_DEFAULT_SNDBUF 1024*1024 +#define TAP_DEFAULT_SNDBUF 0 int tap_set_sndbuf(int fd, QemuOpts *opts) { |