virtio: fix wrong queue index for VIRTIO_PCI_QUEUE_SEL
PATCH 1/1 virtio: fix wrong queue index for VIRTIO_PCI_QUEUE_SEL
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.
--- drivers/net/virtio/virtio_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio/virtio_ethdev.c +1 -1
@@ -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);
Signature · 1 line
1.9.0
Thomas Monjalon
Applied2015-12-08 11:05, Yuanhan Liu:
Quoted 11 lines
We should provide
VIRTIO_PCI_QUEUE_SELwithvq->vq_queue_idx, but notvq->queue_id.
vq->queue_idis 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")Cc Bernard Iremonger <[email protected]>
Bernard was not CC'ed.
Quoted 1 line
Signed-off-by Yuanhan Liu <[email protected]>
Applied, thanks
Quoted 9 lines · Thomas Monjalon
2015-12-08 11:05, Yuanhan Liu:
Quoted 8 lines
We should provide
VIRTIO_PCI_QUEUE_SELwithvq->vq_queue_idx, but notvq->queue_id.
vq->queue_idis 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.
Quoted 5 lines
Quoted 3 lines
Fixes 5382b188fb8a ("virtio: add queue release")Cc Bernard Iremonger <[email protected]>Bernard was not CC'ed.
Weird, it was indeed in the CC list (in the patch I sent) on my email client.
--yliu