diff mbox

[dpdk-dev,v4,18/26] virtio: Fix descriptor index issue

Message ID 1423444455-11330-19-git-send-email-changchun.ouyang@intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Ouyang Changchun Feb. 9, 2015, 1:14 a.m. UTC
It should use vring descriptor index instead of used_ring index to index vq_descx.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
---
 lib/librte_pmd_virtio/virtio_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/lib/librte_pmd_virtio/virtio_rxtx.c b/lib/librte_pmd_virtio/virtio_rxtx.c
index 580701a..a82e8eb 100644
--- a/lib/librte_pmd_virtio/virtio_rxtx.c
+++ b/lib/librte_pmd_virtio/virtio_rxtx.c
@@ -144,9 +144,9 @@  virtio_xmit_cleanup(struct virtqueue *vq, uint16_t num)
 
 		used_idx = (uint16_t)(vq->vq_used_cons_idx & (vq->vq_nentries - 1));
 		uep = &vq->vq_ring.used->ring[used_idx];
-		dxp = &vq->vq_descx[used_idx];
 
 		desc_idx = (uint16_t) uep->id;
+		dxp = &vq->vq_descx[desc_idx];
 		vq->vq_used_cons_idx++;
 		vq_ring_free_chain(vq, desc_idx);