qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv2] tap: set IFF_ONE_QUEUE per default


From: Peter Lieven
Subject: Re: [Qemu-devel] [PATCHv2] tap: set IFF_ONE_QUEUE per default
Date: Mon, 18 Feb 2013 13:39:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

On 15.02.2013 14:32, Stefan Hajnoczi wrote:
On Fri, Feb 15, 2013 at 10:32:31AM +0100, Peter Lieven wrote:
historically the kernel queues packets two times. once
at the device and second in qdisc. this is believed to cause
interface stalls if one of these queues overruns.

setting IFF_ONE_QUEUE is the default in kernels >= 3.8. the
flag is ignored since then. see kernel commit
5d097109257c03a71845729f8db6b5770c4bbedc

v2:
  - do only set the flag on linux as it breaks macvtap
  - define IFF_ONE_QUEUE in tap-linux.h

Signed-off-by: Peter Lieven <address@hidden>
---
  net/tap-linux.c |    4 ++++
  net/tap-linux.h |    1 +
  2 files changed, 5 insertions(+)

diff --git a/net/tap-linux.c b/net/tap-linux.c
index a953189..d49f2fd 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -51,6 +51,10 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
      memset(&ifr, 0, sizeof(ifr));
      ifr.ifr_flags = IFF_TAP | IFF_NO_PI;

+#ifdef __linux__
+    ifr.ifr_flags |= IFF_ONE_QUEUE;
+#endif

tap-linux.c  <--- notice the filename

Perhaps the solution is to try with IFF_ONE_QUEUE.  If the result is
-EINVAL, try without.

Is IFF_ONE_QUEUE queryable with ioctl(fd, TUNGETFEATURES, &features) ?

Peter


Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]