Merge branch 'upstream-16.11-stable' into 16.11.x
[deb_dpdk.git] / drivers / net / virtio / virtio_user / virtio_user_dev.c
index a38398b..8bb155d 100644 (file)
@@ -142,6 +142,9 @@ virtio_user_start_device(struct virtio_user_dev *dev)
        uint64_t features;
        int ret;
 
+       /* Do not check return as already done in init, or reset in stop */
+       vhost_user_sock(dev->vhostfd, VHOST_USER_SET_OWNER, NULL);
+
        /* Step 0: tell vhost to create queues */
        if (virtio_user_queue_setup(dev, virtio_user_create_queue) < 0)
                goto error;
@@ -230,7 +233,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
        parse_mac(dev, mac);
        dev->vhostfd = -1;
 
-       for (i = 0; i < VIRTIO_MAX_VIRTQUEUES * 2 + 1; ++i) {
+       for (i = 0; i < VIRTIO_MAX_VIRTQUEUES; ++i) {
                dev->kickfds[i] = -1;
                dev->callfds[i] = -1;
        }
@@ -240,6 +243,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
                PMD_INIT_LOG(ERR, "backend set up fails");
                return -1;
        }
+
        if (vhost_user_sock(dev->vhostfd, VHOST_USER_SET_OWNER, NULL) < 0) {
                PMD_INIT_LOG(ERR, "set_owner fails: %s", strerror(errno));
                return -1;