net/virtio-user: fix Rx interrupts with multi-queue
[dpdk.git] / drivers / net / virtio / virtio_user / virtio_user_dev.c
index 1cd1e95..89f8b22 100644 (file)
@@ -416,7 +416,7 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
        }
 
        for (i = 0; i < dev->max_queue_pairs; ++i)
-               eth_dev->intr_handle->efds[i] = dev->callfds[i];
+               eth_dev->intr_handle->efds[i] = dev->callfds[2 * i];
        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;
@@ -654,6 +654,13 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 void
 virtio_user_dev_uninit(struct virtio_user_dev *dev)
 {
+       struct rte_eth_dev *eth_dev = &rte_eth_devices[dev->hw.port_id];
+
+       if (eth_dev->intr_handle) {
+               free(eth_dev->intr_handle);
+               eth_dev->intr_handle = NULL;
+       }
+
        virtio_user_stop_device(dev);
 
        rte_mem_event_callback_unregister(VIRTIO_USER_MEM_EVENT_CLB_NAME, dev);