[PATCH v3 1/4] virtio_test: kick vhost for a batch of descriptors

From: Guo Zhi
Date: Fri Jul 08 2022 - 22:28:20 EST


Only kick vhost when the batch finishes.

Signed-off-by: Guo Zhi <qtxuning1999@xxxxxxxxxxx>
---
tools/virtio/virtio_test.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index 23f142af5..95f78b311 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -208,11 +208,10 @@ static void run_test(struct vdev_info *dev, struct vq_info *vq,
}

++started;
-
- if (unlikely(!virtqueue_kick(vq->vq))) {
- r = -1;
- break;
- }
+ }
+ if (unlikely(!virtqueue_kick(vq->vq))) {
+ r = -1;
+ break;
}

if (started >= bufs)
--
2.17.1