[v2] vhost: fix missing statistics update

Message ID 20220616094432.108148-1-xuan.ding@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [v2] 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
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Ding, Xuan June 16, 2022, 9:44 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")

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
---

v2:
* Since this issue was introduced and fixed in same release,
no need to add cc stable.
---
 lib/vhost/virtio_net.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Ling, WeiX June 17, 2022, 5:19 a.m. UTC | #1
> -----Original Message-----
> From: xuan.ding@intel.com <xuan.ding@intel.com>
> Sent: Thursday, June 16, 2022 5:45 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; Ma, WenwuX
> <wenwux.ma@intel.com>; Ding, Xuan <xuan.ding@intel.com>
> Subject: [PATCH v2] vhost: fix missing statistics update
> 
> 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")
> 
> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> ---
> 
> v2:
> * Since this issue was introduced and fixed in same release, no need to add
> cc stable.
> ---

Tested-by: Wei Ling <weix.ling@intel.com>
  
David Marchand June 17, 2022, 5:35 a.m. UTC | #2
On Thu, Jun 16, 2022 at 11:47 AM <xuan.ding@intel.com> wrote:
>
> From: Xuan Ding <xuan.ding@intel.com>
>
> This patch adds missing per-virtqueue statistics in async dequeue path.

This would not happen if the async code was better integrated with the
sync code.

>
> Fixes: 84d5204310d7("vhost: support async dequeue for split ring")
>
> Signed-off-by: Xuan Ding <xuan.ding@intel.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>
  
Maxime Coquelin June 17, 2022, 2:08 p.m. UTC | #3
On 6/16/22 11:44, xuan.ding@intel.com wrote:
> 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")
> 
> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> ---
> 
> v2:
> * Since this issue was introduced and fixed in same release,
> no need to add cc stable.
> ---
>   lib/vhost/virtio_net.c | 2 ++
>   1 file changed, 2 insertions(+)
> 

Applied to dpdk-next-virtio/main.

Thanks,
Maxime
  

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))