DPDK patches and discussions
 help / color / mirror / Atom feed
From: Cheng Jiang <Cheng1.jiang@intel.com>
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 <Cheng1.jiang@intel.com>
Subject: [dpdk-dev] [PATCH] examples/vhost: remove async inflight packet counter
Date: Sun, 31 Jan 2021 12:56:17 +0000	[thread overview]
Message-ID: <20210131125617.53078-1-Cheng1.jiang@intel.com> (raw)

Remove async inflight packet counter since there is no need to keep
traking it. Increase MAX_ENQUEUED_SIZE to prevent packet segment number
traking ring from being exhausted.

Fixes: 63dabdeda690 ("examples/vhost: refactor vhost data path")

Signed-off-by: Cheng Jiang <Cheng1.jiang@intel.com>
---
 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 233a2dc6e..99e8d9c69 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


             reply	other threads:[~2021-01-31 13:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-31 12:56 Cheng Jiang [this message]
2021-01-31 13:06 ` [dpdk-dev] [PATCH v2] " Cheng Jiang
2021-02-02  6:17 ` [dpdk-dev] [PATCH v3] " Cheng Jiang
2021-02-03  9:51   ` Maxime Coquelin
2021-02-03 12:11     ` Jiang, Cheng1
2021-02-03 12:55       ` Maxime Coquelin
2021-02-03 13:42         ` Jiang, Cheng1
2021-02-03 14:21           ` Maxime Coquelin
2021-02-03 14:33             ` Jiang, Cheng1
2021-02-03 16:27   ` Maxime Coquelin
2021-02-03 17:21     ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210131125617.53078-1-Cheng1.jiang@intel.com \
    --to=cheng1.jiang@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=jiayu.hu@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=yinan.wang@intel.com \
    --cc=yvonnex.yang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).