]> Git Repo - qemu.git/commitdiff
virtio-net: avoid call tap_enable when there's only one queue
authorJason Wang <[email protected]>
Wed, 29 Mar 2017 02:41:23 +0000 (10:41 +0800)
committerJason Wang <[email protected]>
Fri, 31 Mar 2017 00:48:13 +0000 (08:48 +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 <[email protected]>
Tested-by: Andrew Baumann <[email protected]>
Cc: [email protected]
Signed-off-by: Jason Wang <[email protected]>
hw/net/virtio-net.c

index c32168077a6d6d8fbcff19a0134f9aa4703cc7c0..7d091c925962db71343c9762cd14b10fd6676491 100644 (file)
@@ -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);
 }
 
This page took 0.029747 seconds and 4 git commands to generate.