qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/4] virtio-net: notify backend with number of q


From: Maxime Coquelin
Subject: Re: [Qemu-devel] [PATCH 4/4] virtio-net: notify backend with number of queue pairs setup
Date: Tue, 16 Jan 2018 15:16:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2



On 01/16/2018 04:07 AM, Michael S. Tsirkin wrote:
On Fri, Jan 12, 2018 at 03:56:58PM +0100, Maxime Coquelin wrote:
Signed-off-by: Maxime Coquelin <address@hidden>
---
  hw/net/virtio-net.c | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 38674b08aa..b8908c98ed 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -561,6 +561,7 @@ static int peer_detach(VirtIONet *n, int index)
static void virtio_net_set_queues(VirtIONet *n)
  {
+    NetClientState *nc = qemu_get_queue(n->nic);
      int i;
      int r;
@@ -568,6 +569,10 @@ static void virtio_net_set_queues(VirtIONet *n)
          return;
      }
+ if (get_vhost_net(nc->peer)) {
+        vhost_net_set_queue_num(nc->peer, n->curr_queues);
+    }
+
      for (i = 0; i < n->max_queues; i++) {
          if (i < n->curr_queues) {
              r = peer_attach(n, i);

Seems wrong to me.
curr_queues isn't the max # of queues configured as the documentation says.
It's the number of queues currently in use by driver.

Ok. What about detecting the number of queues configured, by checking
for example that decs_phys, avail_phys and used_phys are different?

Thanks,
Maxime

--
2.14.3



reply via email to

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