net/virtio-user: fail if cq used with packed vq
authorJens Freimann <jfreimann@redhat.com>
Mon, 17 Dec 2018 21:31:38 +0000 (22:31 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 21 Dec 2018 15:22:40 +0000 (16:22 +0100)
Until we have support for control virtqueues let's disable it and
fail device initalization if specified as a parameter.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_user/virtio_user_dev.c

index 697ba4a..4e331fc 100644 (file)
@@ -467,10 +467,16 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
        if (!in_order)
                dev->unsupported_features |= (1ull << VIRTIO_F_IN_ORDER);
 
-       if (packed_vq)
+       if (packed_vq) {
+               if (cq) {
+                       PMD_INIT_LOG(ERR, "control vq not supported yet with "
+                                         "packed virtqueues\n");
+                       return -1;
+               }
                dev->device_features |= (1ull << VIRTIO_F_RING_PACKED);
-       else
+       } else {
                dev->device_features &= ~(1ull << VIRTIO_F_RING_PACKED);
+       }
 
        if (dev->mac_specified) {
                dev->device_features |= (1ull << VIRTIO_NET_F_MAC);