vhost: fix missing statistics update

Message ID 20220616093609.106130-1-xuan.ding@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series vhost: fix missing statistics update |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Ding, Xuan June 16, 2022, 9:36 a.m. UTC
  From: Xuan Ding <xuan.ding@intel.com>

This patch adds missing per-virtqueue statistics in async dequeue path.

Fixes: 84d5204310d7("vhost: support async dequeue for split ring")
Cc: stable@dpdk.org

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
---
 lib/vhost/virtio_net.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index 68a26eb17d..a5e510c51e 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -3538,6 +3538,7 @@  rte_vhost_async_try_dequeue_burst(int vid, uint16_t queue_id,
 		 * learning table will get updated first.
 		 */
 		pkts[0] = rarp_mbuf;
+		vhost_queue_stats_update(dev, vq, pkts, 1);
 		pkts++;
 		count -= 1;
 	}
@@ -3562,6 +3563,7 @@  rte_vhost_async_try_dequeue_burst(int vid, uint16_t queue_id,
 							    count, dma_id, vchan_id);
 
 	*nr_inflight = vq->async->pkts_inflight_n;
+	vhost_queue_stats_update(dev, vq, pkts, count);
 
 out:
 	if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))