summaryrefslogtreecommitdiff
path: root/lib/librte_vhost
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.bie@intel.com>2018-09-06 12:59:27 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-09-14 20:08:41 +0200
commit58e90a91138d2ed491b37b2173fe39ae44c9ca06 (patch)
treec450949ab22dabece84ec803b6a229537a552c9a /lib/librte_vhost
parent0d7853a4da3bd681005ecb64ef1183c59356eeea (diff)
downloaddpdk-58e90a91138d2ed491b37b2173fe39ae44c9ca06.zip
dpdk-58e90a91138d2ed491b37b2173fe39ae44c9ca06.tar.gz
dpdk-58e90a91138d2ed491b37b2173fe39ae44c9ca06.tar.xz
vhost: fix return value on enqueue path
Fixes: 62250c1d0978 ("vhost: extract split ring handling from Rx and Tx functions") Fixes: a922401f35cc ("vhost: add Rx 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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 99c7afc..4bfae76 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -888,6 +888,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
struct rte_mbuf **pkts, uint32_t count)
{
struct vhost_virtqueue *vq;
+ uint32_t nb_tx = 0;
VHOST_LOG_DEBUG(VHOST_DATA, "(%d) %s\n", dev->vid, __func__);
if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->nr_vring))) {
@@ -915,9 +916,9 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
goto out;
if (vq_is_packed(dev))
- count = virtio_dev_rx_packed(dev, vq, pkts, count);
+ nb_tx = virtio_dev_rx_packed(dev, vq, pkts, count);
else
- count = virtio_dev_rx_split(dev, vq, pkts, count);
+ nb_tx = virtio_dev_rx_split(dev, vq, pkts, count);
out:
if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))
@@ -926,7 +927,7 @@ out:
out_access_unlock:
rte_spinlock_unlock(&vq->access_lock);
- return count;
+ return nb_tx;
}
uint16_t