summaryrefslogtreecommitdiff
path: root/lib/librte_vhost
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.bie@intel.com>2018-10-23 14:07:49 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-26 22:14:05 +0200
commit16b9e38e74147fb004fa112c055b2fd500403b36 (patch)
treed67af58e20873011c5708f8bb0ead92da0ba2e27 /lib/librte_vhost
parent1726e9994c77cddd40a2982a1a01ceaf18a83403 (diff)
downloaddpdk-16b9e38e74147fb004fa112c055b2fd500403b36.zip
dpdk-16b9e38e74147fb004fa112c055b2fd500403b36.tar.gz
dpdk-16b9e38e74147fb004fa112c055b2fd500403b36.tar.xz
vhost: fix vector filling for packed ring
We should return the length of the buffers described by the current descriptor chain after filling the buffer vector. So we need to zero the *len first. Fixes: 2f3225a7d69b ("vhost: add vector filling support for packed ring") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Diffstat (limited to 'lib/librte_vhost')
-rw-r--r--lib/librte_vhost/virtio_net.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index f8794ee..1c31c05 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -521,6 +521,7 @@ fill_vec_buf_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,
return -1;
*desc_count = 0;
+ *len = 0;
while (1) {
if (unlikely(vec_id >= BUF_VECTOR_MAX))