DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] vhost: fix async inflight packet counter
@ 2020-11-03  5:35 Patrick Fu
  2020-11-09  9:18 ` Maxime Coquelin
  2020-11-09 16:32 ` Maxime Coquelin
  0 siblings, 2 replies; 3+ messages in thread
From: Patrick Fu @ 2020-11-03  5:35 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: patrick.fu, jiayu.hu

Async inflight packet counter should take failed packets into account.
Failed packets will be deducted in the error handling logic.

Fixes: 6b3c81db8bb7 ("vhost: simplify async copy completion")
Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring")

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

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 10dec5e54..6c5128665 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -1567,7 +1567,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,
 			src_it = it_pool;
 			dst_it = it_pool + 1;
 			segs_await = 0;
-			vq->async_pkts_inflight_n += n_pkts;
+			vq->async_pkts_inflight_n += pkt_burst_idx;
 
 			if (unlikely(n_pkts < (int)pkt_burst_idx)) {
 				/*
@@ -1587,7 +1587,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,
 	if (pkt_burst_idx) {
 		n_pkts = vq->async_ops.transfer_data(dev->vid,
 				queue_id, tdes, 0, pkt_burst_idx);
-		vq->async_pkts_inflight_n += n_pkts;
+		vq->async_pkts_inflight_n += pkt_burst_idx;
 
 		if (unlikely(n_pkts < (int)pkt_burst_idx))
 			pkt_err = pkt_burst_idx - n_pkts;
-- 
2.18.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-09 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03  5:35 [dpdk-dev] [PATCH v1] vhost: fix async inflight packet counter Patrick Fu
2020-11-09  9:18 ` Maxime Coquelin
2020-11-09 16:32 ` 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).