net/mlx4: add flow support for multicast traffic
[dpdk.git] / drivers / net / virtio / virtio_user / virtio_user_dev.c
index 299ee16..7941271 100644 (file)
@@ -41,7 +41,6 @@
 #include <sys/eventfd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 
 #include "vhost.h"
 #include "virtio_user_dev.h"
@@ -271,6 +270,8 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
        eth_dev->intr_handle->nb_efd = dev->max_queue_pairs;
        eth_dev->intr_handle->max_intr = dev->max_queue_pairs + 1;
        eth_dev->intr_handle->type = RTE_INTR_HANDLE_VDEV;
+       if (dev->vhostfd >= 0)
+               eth_dev->intr_handle->fd = dev->vhostfd;
 
        return 0;
 }
@@ -284,12 +285,6 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)
        dev->vhostfds = NULL;
        dev->tapfds = NULL;
 
-       if (virtio_user_dev_init_notify(dev) < 0)
-               return -1;
-
-       if (virtio_user_fill_intr_handle(dev) < 0)
-               return -1;
-
        if (is_vhost_user_by_type(dev->path)) {
                dev->ops = &ops_user;
        } else {
@@ -308,7 +303,16 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)
                }
        }
 
-       return dev->ops->setup(dev);
+       if (dev->ops->setup(dev) < 0)
+               return -1;
+
+       if (virtio_user_dev_init_notify(dev) < 0)
+               return -1;
+
+       if (virtio_user_fill_intr_handle(dev) < 0)
+               return -1;
+
+       return 0;
 }
 
 /* Use below macro to filter features from vhost backend */
@@ -379,7 +383,8 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
        }
 
        /* The backend will not report this feature, we add it explicitly */
-       dev->device_features |= (1ull << VIRTIO_NET_F_STATUS);
+       if (is_vhost_user_by_type(dev->path))
+               dev->device_features |= (1ull << VIRTIO_NET_F_STATUS);
 
        dev->device_features &= VIRTIO_USER_SUPPORTED_FEATURES;