From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 875F41396 for ; Tue, 8 Dec 2015 04:04:17 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 07 Dec 2015 19:04:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,397,1444719600"; d="scan'208";a="866849312" Received: from yliu-dev.sh.intel.com ([10.239.66.49]) by orsmga002.jf.intel.com with ESMTP; 07 Dec 2015 19:04:16 -0800 From: Yuanhan Liu To: dev@dpdk.org Date: Tue, 8 Dec 2015 11:05:12 +0800 Message-Id: <1449543912-31066-1-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 Subject: [dpdk-dev] [PATCH] virtio: fix wrong queue index for VIRTIO_PCI_QUEUE_SEL X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 03:04:18 -0000 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") Cc: Bernard Iremonger Signed-off-by: Yuanhan Liu --- drivers/net/virtio/virtio_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 16ff827..d928339 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); -- 1.9.0