[v1] vhost: remove fallback in async enqueue API

Message ID 20201021054425.4077276-1-patrick.fu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [v1] vhost: remove fallback in async enqueue API |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Patrick Fu Oct. 21, 2020, 5:44 a.m. UTC
  By design, async enqueue API should return directly if async device
is not registered. This patch removes the corrupted implementation of
the enqueue fallback from async mode to sync mode.

Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring")

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
---
 lib/librte_vhost/virtio_net.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
  

Comments

Maxime Coquelin Oct. 23, 2020, 11 a.m. UTC | #1
On 10/21/20 7:44 AM, Patrick Fu wrote:
> By design, async enqueue API should return directly if async device
> is not registered. This patch removes the corrupted implementation of
> the enqueue fallback from async mode to sync mode.
> 
> Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring")
> 
> Signed-off-by: Patrick Fu <patrick.fu@intel.com>
> ---
>  lib/librte_vhost/virtio_net.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin Oct. 23, 2020, 11:22 a.m. UTC | #2
On 10/21/20 7:44 AM, Patrick Fu wrote:
> By design, async enqueue API should return directly if async device
> is not registered. This patch removes the corrupted implementation of
> the enqueue fallback from async mode to sync mode.
> 
> Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring")
> 
> Signed-off-by: Patrick Fu <patrick.fu@intel.com>
> ---
>  lib/librte_vhost/virtio_net.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)

Applied to dpdk-next-virtio/main.

Thanks,
Maxime
  

Patch

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 3a019b744..030795645 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -1714,7 +1714,6 @@  virtio_dev_rx_async_submit(struct virtio_net *dev, uint16_t queue_id,
 {
 	struct vhost_virtqueue *vq;
 	uint32_t nb_tx = 0;
-	bool drawback = false;
 
 	VHOST_LOG_DATA(DEBUG, "(%d) %s\n", dev->vid, __func__);
 	if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->nr_vring))) {
@@ -1727,13 +1726,8 @@  virtio_dev_rx_async_submit(struct virtio_net *dev, uint16_t queue_id,
 
 	rte_spinlock_lock(&vq->access_lock);
 
-	if (unlikely(vq->enabled == 0))
-		goto out_access_unlock;
-
-	if (unlikely(!vq->async_registered)) {
-		drawback = true;
+	if (unlikely(vq->enabled == 0 || !vq->async_registered))
 		goto out_access_unlock;
-	}
 
 	if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))
 		vhost_user_iotlb_rd_lock(vq);
@@ -1760,9 +1754,6 @@  virtio_dev_rx_async_submit(struct virtio_net *dev, uint16_t queue_id,
 out_access_unlock:
 	rte_spinlock_unlock(&vq->access_lock);
 
-	if (drawback)
-		return rte_vhost_enqueue_burst(dev->vid, queue_id, pkts, count);
-
 	return nb_tx;
 }