Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3258228imw; Wed, 6 Jul 2022 21:13:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uz/YdqisAEJDNkHVRm0lzBsJppyCJVSc/hC0dYwlJH32R0Sq1g+hRA2Fc4h9GR9AXOjDNN X-Received: by 2002:a05:6402:2816:b0:434:ed38:16f3 with SMTP id h22-20020a056402281600b00434ed3816f3mr59485728ede.116.1657167221251; Wed, 06 Jul 2022 21:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657167221; cv=none; d=google.com; s=arc-20160816; b=gMIMWA8s9KupNf7dfc9CxujWlRk/iyYXCAfHwgLIAimT9djj0zjZ0NDB56YRM4Ghex l3qgAOHNRXjk0yHHgRQ+0BH7vnzPCsh/Kq5hAdv8zN24AK5/2naT74Y5UOu1V7oKHX/5 MpFj7DvZyJ6MPR48qu48awZ6KrJDd+xRe0P5nyeuTVSImVPUhsOWTUACs7FHDu4edNts jiypMEWhrg6l6vJDKGuxsM+26M+C2Ey0DtUg4nVY3XMeC670pQdVAdqkvHkm7iJN5EjR gJ0K04LRQhNTphufPqR3k43j5yoMSTkRq72Os595QnrjZO3du4sT8kcV/ncvYl7jMQGC 0ZCQ== 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=yQVvE7moNqsosTNwCpmObemRXP4dITfqCHHrpUmgv/+49lddS6qHqlc7BZPSrZAouL 0jKxifmyQ2+utt9TGxGdWP7wBANcOaDwKv7flHcYMaY3J5M/ASzQz6bC8ALxDb+om0P3 vGcF97Cm49RegBWiHZeLdLjM+SpwDVnx680asblgYeBzTsvEzvTWclYlAxvu9f2Ej8on Srhc05/0k6+Y6ybtiKhDKYf/UlTwcNqj9UKMOLb+6oavHvAd0SN+A9zu2RvZwM7jlWOC Vw9Am8I70fwEj/AyJCHhbx5Kw7VE1ltocbB/yZtu1zbe+cCDLvQxrxJTUN2Hm2QQhoBP OgTQ== 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 ds15-20020a0564021ccf00b0043a9bfde144si529268edb.598.2022.07.06.21.13.16; Wed, 06 Jul 2022 21:13:41 -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 S234925AbiGGDAW (ORCPT + 99 others); Wed, 6 Jul 2022 23:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234885AbiGGDAQ (ORCPT ); Wed, 6 Jul 2022 23:00:16 -0400 Received: from smtp236.sjtu.edu.cn (smtp236.sjtu.edu.cn [202.120.2.236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03D612F672 for ; Wed, 6 Jul 2022 20:00: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 A45F41008B38C; Thu, 7 Jul 2022 10:44:30 +0800 (CST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy02.sjtu.edu.cn (Postfix) with ESMTP id 8DEC9200C91EE; Thu, 7 Jul 2022 10:44:30 +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 2O45w16mEfGD; Thu, 7 Jul 2022 10:44:30 +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 9B0C4200C91EC; Thu, 7 Jul 2022 10:44:20 +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 v2 1/4] virtio_test: kick vhost for a batch of descriptors Date: Thu, 7 Jul 2022 10:44:06 +0800 Message-Id: <20220707024409.1869-2-qtxuning1999@sjtu.edu.cn> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220707024409.1869-1-qtxuning1999@sjtu.edu.cn> References: <20220707024409.1869-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