From: Huawei Xie Date: Thu, 10 Dec 2015 16:07:32 +0000 (+0800) Subject: virtio: fix descriptors pointing to the same buffer X-Git-Tag: spdx-start~7288 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3b1e3e4e362453df8cecbc6d481444be8b84326e;p=dpdk.git virtio: fix descriptors pointing to the same buffer The virtio_net_hdr desc all pointed to the same buffer. It doesn't cause issue because in the simple TX mode we don't use the header. This patch makes the header desc point to different buffer. Fixes: b4ae9c505f2e ("virtio: optimize ring layout") Signed-off-by: Huawei Xie Acked-by: Jianfeng Tan Acked-by: Yuanhan Liu --- diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index e96352cedb..a7a58be630 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -353,7 +353,7 @@ virtio_dev_vring_start(struct virtqueue *vq, int queue_type) vq->vq_ring.desc[i + mid_idx].next = i; vq->vq_ring.desc[i + mid_idx].addr = vq->virtio_net_hdr_mem + - mid_idx * vq->hw->vtnet_hdr_size; + i * vq->hw->vtnet_hdr_size; vq->vq_ring.desc[i + mid_idx].len = vq->hw->vtnet_hdr_size; vq->vq_ring.desc[i + mid_idx].flags =