Hi Stefan,

On 01/19/2018 02:44 PM, Stefan Hajnoczi wrote:
The virtio-net mq vring deletion code should be in virtio_net.c, not in
the generic vhost_user.c code where it breaks non-virtio-net devices.

Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>
---
  drivers/librte_vhost/vhost_user.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/librte_vhost/vhost_user.c 
b/drivers/librte_vhost/vhost_user.c
index a819684b4..08fab933b 100644
--- a/drivers/librte_vhost/vhost_user.c
+++ b/drivers/librte_vhost/vhost_user.c
@@ -163,6 +163,7 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t 
features)
                (dev->features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ? "on" : "off",
                (dev->features & (1ULL << VIRTIO_F_VERSION_1)) ? "on" : "off");
+#if 0
        if (!(dev->features & (1ULL << VIRTIO_NET_F_MQ))) {
                /*
                 * Remove all but first queue pair if MQ hasn't been
@@ -181,6 +182,7 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t 
features)
                        free_vq(vq);
                }
        }
+#endif
return 0;
  }


Thanks for reporting the issue.
It seems difficult to move this check in virtio-net.c without a deep
rework.

But I think we can workaround by ensuring the backend supports
VIRTIO_NET_F_MQ, but it has not been negotiated.
Something like:

if ((vhost_features & (1ULL << VIRTIO_NET_F_MQ)) &&
        !(dev->features & (1ULL << VIRTIO_NET_F_MQ)) {
...
}

Any thoughts?

Thanks,
Maxime

Reply via email to