qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 1/2] virtio-net: avoid call tap_enable when there's o


From: Jason Wang
Subject: [Qemu-devel] [PULL 1/2] virtio-net: avoid call tap_enable when there's only one queue
Date: Fri, 31 Mar 2017 09:15:55 +0800

We call tap_enable() even if for multiqueue is not enabled. This is
wrong since it should be used for multiqueue codes to enable a
disabled queue. Fixing this by only calling this when multiqueue is
used.

Fixes: 16dbaf905b72 ("tap: support enabling or disabling a queue")
Reported-by: Andrew Baumann <address@hidden>
Tested-by: Andrew Baumann <address@hidden>
Cc: address@hidden
Signed-off-by: Jason Wang <address@hidden>
---
 hw/net/virtio-net.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index c321680..7d091c9 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -510,6 +510,10 @@ static int peer_attach(VirtIONet *n, int index)
         return 0;
     }
 
+    if (n->max_queues == 1) {
+        return 0;
+    }
+
     return tap_enable(nc->peer);
 }
 
-- 
2.7.4




reply via email to

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