From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52C46C433EF for ; Sat, 9 Jul 2022 02:28:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbiGIC2S (ORCPT ); Fri, 8 Jul 2022 22:28:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbiGIC2Q (ORCPT ); Fri, 8 Jul 2022 22:28:16 -0400 Received: from smtp236.sjtu.edu.cn (smtp236.sjtu.edu.cn [202.120.2.236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D58D479EE8 for ; Fri, 8 Jul 2022 19:28:14 -0700 (PDT) Received: from proxy02.sjtu.edu.cn (smtp188.sjtu.edu.cn [202.120.2.188]) by smtp236.sjtu.edu.cn (Postfix) with ESMTPS id 9A2941008B388; Sat, 9 Jul 2022 10:28:05 +0800 (CST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy02.sjtu.edu.cn (Postfix) with ESMTP id C61E2200A5E62; Sat, 9 Jul 2022 10:28:03 +0800 (CST) X-Virus-Scanned: amavisd-new at Received: from proxy02.sjtu.edu.cn ([127.0.0.1]) by localhost (proxy02.sjtu.edu.cn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id jtiPptT7xq7X; Sat, 9 Jul 2022 10:28:03 +0800 (CST) Received: from localhost.localdomain (unknown [202.120.40.82]) (Authenticated sender: qtxuning1999@sjtu.edu.cn) by proxy02.sjtu.edu.cn (Postfix) with ESMTPSA id 3A3F72009BEAF; Sat, 9 Jul 2022 10:27:54 +0800 (CST) From: Guo Zhi To: jasowang@redhat.com, mst@redhat.com Cc: eperezma@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, sgarzare@redhat.com, Guo Zhi Subject: [PATCH v3 1/4] virtio_test: kick vhost for a batch of descriptors Date: Sat, 9 Jul 2022 10:27:42 +0800 Message-Id: <20220709022745.21020-2-qtxuning1999@sjtu.edu.cn> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220709022745.21020-1-qtxuning1999@sjtu.edu.cn> References: <20220709022745.21020-1-qtxuning1999@sjtu.edu.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only kick vhost when the batch finishes. Signed-off-by: Guo Zhi --- 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