From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C9FCAA04DD; Wed, 21 Oct 2020 07:55:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5E97DAC67; Wed, 21 Oct 2020 07:55:54 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 61354AC65 for ; Wed, 21 Oct 2020 07:55:52 +0200 (CEST) IronPort-SDR: pKj/irv6w7ChTsDZMY8G8wmeMFQvA0TujqK7eRAic8u63sg2MBq80GgahzlSgeWPEoxDd5Dq0r +26Vdmk2FBqQ== X-IronPort-AV: E=McAfee;i="6000,8403,9780"; a="167437911" X-IronPort-AV: E=Sophos;i="5.77,400,1596524400"; d="scan'208";a="167437911" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2020 22:55:50 -0700 IronPort-SDR: Plde99pgvYp/NwlMmjkMpU8Url2f/vjAWPYTPU12CSyCnnPIg1Tt6fIYBRkI4ZTyXeDRci0hZc OmF8RgEQqxkQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,400,1596524400"; d="scan'208";a="320905796" Received: from npg-dpdk-patrickfu-casc2.sh.intel.com ([10.67.119.92]) by orsmga006.jf.intel.com with ESMTP; 20 Oct 2020 22:55:49 -0700 From: Patrick Fu To: dev@dpdk.org, maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: cheng1.jiang@intel.com, patrick.fu@intel.com Date: Wed, 21 Oct 2020 13:44:25 +0800 Message-Id: <20201021054425.4077276-1-patrick.fu@intel.com> X-Mailer: git-send-email 2.18.4 Subject: [dpdk-dev] [PATCH v1] vhost: remove fallback in async enqueue API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- lib/librte_vhost/virtio_net.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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; } -- 2.18.4