From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 562BDA052A; Tue, 2 Feb 2021 07:29:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 124A4240250; Tue, 2 Feb 2021 07:29:10 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C38C7240243 for ; Tue, 2 Feb 2021 07:29:07 +0100 (CET) IronPort-SDR: 4v3uONw0wNi6Xd2D0et6UY+QWbcMtXCcLt9URrdUDemK9NefPs2VwnutCLR4nzgP0CXEDTAzE/ gVtsRYjUigLA== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="160570722" X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="160570722" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 22:29:05 -0800 IronPort-SDR: RGqDMloX+1onwpRb2fTKma55jpXxvyrM7M3d120XI9DgianlNbIau33R6oB4BoIANmzulCa3p9 g5Qr2Maz5SzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="432753483" Received: from dpdk_jiangcheng.sh.intel.com ([10.67.119.112]) by orsmga001.jf.intel.com with ESMTP; 01 Feb 2021 22:29:03 -0800 From: Cheng Jiang To: maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, yvonnex.yang@intel.com, yinan.wang@intel.com, Cheng Jiang Date: Tue, 2 Feb 2021 06:17:51 +0000 Message-Id: <20210202061751.1614-1-Cheng1.jiang@intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210131125617.53078-1-Cheng1.jiang@intel.com> References: <20210131125617.53078-1-Cheng1.jiang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3] examples/vhost: remove async inflight packet counter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Remove async inflight packet counter since there is no need to keep tracking it. Increase MAX_ENQUEUED_SIZE to prevent packet segment number tracking ring from being exhausted. Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path") Signed-off-by: Cheng Jiang --- v3: fixed fixes commit id in git log v2: fixed a typo examples/vhost/ioat.h | 2 +- examples/vhost/main.c | 10 +--------- examples/vhost/main.h | 1 - 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/examples/vhost/ioat.h b/examples/vhost/ioat.h index 0a1dbb811..1aa28ed6a 100644 --- a/examples/vhost/ioat.h +++ b/examples/vhost/ioat.h @@ -11,7 +11,7 @@ #define MAX_VHOST_DEVICE 1024 #define IOAT_RING_SIZE 4096 -#define MAX_ENQUEUED_SIZE 512 +#define MAX_ENQUEUED_SIZE 4096 struct dma_info { struct rte_pci_addr addr; diff --git a/examples/vhost/main.c b/examples/vhost/main.c index e74fc8750..ca73e7086 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -831,11 +831,8 @@ complete_async_pkts(struct vhost_dev *vdev) complete_count = rte_vhost_poll_enqueue_completed(vdev->vid, VIRTIO_RXQ, p_cpl, MAX_PKT_BURST); - if (complete_count) { - __atomic_sub_fetch(&vdev->nr_async_pkts, complete_count, - __ATOMIC_SEQ_CST); + if (complete_count) free_pkts(p_cpl, complete_count); - } } static __rte_always_inline void @@ -878,8 +875,6 @@ drain_vhost(struct vhost_dev *vdev) complete_async_pkts(vdev); ret = rte_vhost_submit_enqueue_burst(vdev->vid, VIRTIO_RXQ, m, nr_xmit, m_cpu_cpl, &cpu_cpl_nr); - __atomic_add_fetch(&vdev->nr_async_pkts, ret - cpu_cpl_nr, - __ATOMIC_SEQ_CST); if (cpu_cpl_nr) free_pkts(m_cpu_cpl, cpu_cpl_nr); @@ -1210,9 +1205,6 @@ drain_eth_rx(struct vhost_dev *vdev) enqueue_count = rte_vhost_submit_enqueue_burst(vdev->vid, VIRTIO_RXQ, pkts, rx_count, m_cpu_cpl, &cpu_cpl_nr); - __atomic_add_fetch(&vdev->nr_async_pkts, - enqueue_count - cpu_cpl_nr, - __ATOMIC_SEQ_CST); if (cpu_cpl_nr) free_pkts(m_cpu_cpl, cpu_cpl_nr); diff --git a/examples/vhost/main.h b/examples/vhost/main.h index 2d6c05fd7..0ccdce4b4 100644 --- a/examples/vhost/main.h +++ b/examples/vhost/main.h @@ -51,7 +51,6 @@ struct vhost_dev { uint64_t features; size_t hdr_len; uint16_t nr_vrings; - uint64_t nr_async_pkts; struct rte_vhost_memory *mem; struct device_statistics stats; TAILQ_ENTRY(vhost_dev) global_vdev_entry; -- 2.29.2