From: Yuanhan Liu Date: Tue, 8 Dec 2015 03:05:12 +0000 (+0800) Subject: virtio: fix wrong queue index X-Git-Tag: spdx-start~7808 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6ed346a46217461319cae37f4af75a66ac4a352b;p=dpdk.git virtio: fix wrong queue index We should provide VIRTIO_PCI_QUEUE_SEL with vq->vq_queue_idx, but not vq->queue_id. vq->queue_id is the queue id from rte_eth_rx/tx_queue_setup(), which always starts from 0 no matter which queue it is. However, for virtio, even number is for RX queue, and odd number is for TX queue. Fixes: 5382b188fb8a ("virtio: add queue release") Signed-off-by: Yuanhan Liu --- diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 16ff827656..d92833906d 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -273,7 +273,7 @@ virtio_dev_queue_release(struct virtqueue *vq) { if (vq) { hw = vq->hw; /* Select and deactivate the queue */ - VIRTIO_WRITE_REG_2(hw, VIRTIO_PCI_QUEUE_SEL, vq->queue_id); + VIRTIO_WRITE_REG_2(hw, VIRTIO_PCI_QUEUE_SEL, vq->vq_queue_index); VIRTIO_WRITE_REG_4(hw, VIRTIO_PCI_QUEUE_PFN, 0); rte_free(vq->sw_ring);