* [dpdk-dev] [PATCH] vhost: fix return value on enqueue path
@ 2018-09-06 4:59 Tiwei Bie
2018-09-12 6:57 ` Maxime Coquelin
2018-09-12 7:02 ` Maxime Coquelin
0 siblings, 2 replies; 3+ messages in thread
From: Tiwei Bie @ 2018-09-06 4:59 UTC (permalink / raw)
To: maxime.coquelin, zhihong.wang, dev; +Cc: stable
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>
---
lib/librte_vhost/virtio_net.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 99c7afc88..4bfae76a6 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 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
out_access_unlock:
rte_spinlock_unlock(&vq->access_lock);
- return count;
+ return nb_tx;
}
uint16_t
--
2.18.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: fix return value on enqueue path
2018-09-06 4:59 [dpdk-dev] [PATCH] vhost: fix return value on enqueue path Tiwei Bie
@ 2018-09-12 6:57 ` Maxime Coquelin
2018-09-12 7:02 ` Maxime Coquelin
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2018-09-12 6:57 UTC (permalink / raw)
To: Tiwei Bie, zhihong.wang, dev; +Cc: stable
On 09/06/2018 06:59 AM, Tiwei Bie wrote:
> 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>
> ---
> lib/librte_vhost/virtio_net.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Good catch! Thanks for the fix.
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
> index 99c7afc88..4bfae76a6 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 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
> out_access_unlock:
> rte_spinlock_unlock(&vq->access_lock);
>
> - return count;
> + return nb_tx;
> }
>
> uint16_t
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: fix return value on enqueue path
2018-09-06 4:59 [dpdk-dev] [PATCH] vhost: fix return value on enqueue path Tiwei Bie
2018-09-12 6:57 ` Maxime Coquelin
@ 2018-09-12 7:02 ` Maxime Coquelin
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2018-09-12 7:02 UTC (permalink / raw)
To: Tiwei Bie, zhihong.wang, dev; +Cc: stable
On 09/06/2018 06:59 AM, Tiwei Bie wrote:
> 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>
> ---
> lib/librte_vhost/virtio_net.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Applied to dpdk-next-virtio/master.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-12 7:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 4:59 [dpdk-dev] [PATCH] vhost: fix return value on enqueue path Tiwei Bie
2018-09-12 6:57 ` Maxime Coquelin
2018-09-12 7:02 ` Maxime Coquelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).