From 45ba914134075f67200f55e5b5a9ad8b3da4df48 Mon Sep 17 00:00:00 2001 From: Patrick Fu Date: Tue, 3 Nov 2020 13:35:01 +0800 Subject: [PATCH] vhost: fix async inflight packet counter 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") Cc: stable@dpdk.org Signed-off-by: Patrick Fu Reviewed-by: Maxime Coquelin --- 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 10dec5e54d..6c5128665e 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.20.1