New upstream version 17.11.1
[deb_dpdk.git] / drivers / net / virtio / virtio_user / virtio_user_dev.c
index 450404b..7ce512c 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"
@@ -172,6 +171,11 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
        for (i = 0; i < dev->max_queue_pairs; ++i)
                dev->ops->enable_qp(dev, i, 0);
 
+       if (dev->ops->send_request(dev, VHOST_USER_RESET_OWNER, NULL) < 0) {
+               PMD_DRV_LOG(INFO, "Failed to reset the device\n");
+               return -1;
+       }
+
        return 0;
 }
 
@@ -271,6 +275,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;
+       /* For virtio vdev, no need to read counter for clean */
+       eth_dev->intr_handle->efd_counter_size = 0;
        if (dev->vhostfd >= 0)
                eth_dev->intr_handle->fd = dev->vhostfd;