Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1117277imw; Fri, 8 Jul 2022 19:36:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vj7Gncc4bMng5rM2vcRti5CZgDIcyzFFj1cibvvX7kZGY6WbtwxjiqgNf6PX9wp1GTgGfI X-Received: by 2002:a17:906:d54f:b0:726:4424:9d31 with SMTP id cr15-20020a170906d54f00b0072644249d31mr6721915ejc.227.1657334167934; Fri, 08 Jul 2022 19:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657334167; cv=none; d=google.com; s=arc-20160816; b=SyXQHwgf724r9X5Yzy0os0kSH8fAui1sgDwl7PQvaNXwgT9YMZYaBjRD8ZEyHbBJgb 3RL6zlT1HVWNp5L2DJCTxfJSoDd2AYsC2hOACdKcl5glXoi8yoPkESqdgiyavV1c+TJe 7axr37M/NQbAt5APuNL8xTEYQjUZ1XTNcZ0h67u+5C51cwNKBXLvPjXg4IpmwwvgePyt 6p5xXxJGN907gx3EJXxA8YIlZj6+Pr7i3BWW1kdPr5uh2g1UPLxq0CW6nE/+x+fnDQIp JiJ0k6JtH9mJYcZT2GGsZL4KvpAtfUS+0sgUchxJtGijDrymmbi3YBCb6imnV2iGAGN7 zCaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=rXUO1XJSSHXU09BABGWfQflLaisDcZi16d+UldJcaXA=; b=vAUk40CVaU08swM+HOxHoFXU2QsGdGVmacTZexvQlqZXEiSSr1Q5TZdfrXOqsjqI9e cx3BI8dFrBzz4O2afz7Dd6wVNYQ7DuYEvDrz7VKTFO8kDacZOkYIavmZRcW9d3y056uK vpRJtI4pq3TUbFJVIeq0joNzRVfNE4Xo9j+7lbZXUiIWPBMyj8G9gI+MpYAOCG4/Yycd UYVey7lU2UWxAaHGFQvoBLmoZkKguRXhOJJNrgPBjZizVzPwcxRKHTXJtjJWnSBHFoJ1 qs8f9r9FkhPYc+TKis4KMT+BmhqpnFmdhM5jqsNc3qEUEm3ijaJZGgsoKzU0VJ4hAsfd XGNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dc24-20020a170906c7d800b0072af35fca64si307786ejb.484.2022.07.08.19.35.42; Fri, 08 Jul 2022 19:36:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229634AbiGIC2R (ORCPT + 99 others); Fri, 8 Jul 2022 22:28:17 -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> X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_WEB, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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