[dpdk-dev,v3,18/25] virtio: Fix descriptor index issue

Message ID 1422516249-14596-19-git-send-email-changchun.ouyang@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Ouyang Changchun Jan. 29, 2015, 7:24 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(-)
  

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);