From patchwork Fri Apr 1 11:16:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 8723091 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A13EDC0554 for ; Fri, 1 Apr 2016 11:24:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 077D3203B5 for ; Fri, 1 Apr 2016 11:24:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 611832039E for ; Fri, 1 Apr 2016 11:24:11 +0000 (UTC) Received: from localhost ([::1]:43570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alxBS-00015y-Nm for patchwork-qemu-devel@patchwork.kernel.org; Fri, 01 Apr 2016 07:24:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alx4n-0006G1-AL for qemu-devel@nongnu.org; Fri, 01 Apr 2016 07:17:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alx4m-0001qx-ES for qemu-devel@nongnu.org; Fri, 01 Apr 2016 07:17:17 -0400 Received: from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e]:33120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alx4m-0001qp-1j for qemu-devel@nongnu.org; Fri, 01 Apr 2016 07:17:16 -0400 Received: by mail-qk0-x22e.google.com with SMTP id s5so36566880qkd.0 for ; Fri, 01 Apr 2016 04:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D39pJ5J9FJoRN6+8PKhrekJHeUA6FskrdTYVHnE1ZmA=; b=SlkYkGKLyfZafgHaaUw+4BmJCvcYnqiomdMgX03vHQ4Mdd7+SGrGpNbZd06SqO/+6K UQYvESAhma2sx7x/59S0pvN2+yuk3+qCGNQ69xoUJ207ivD2BIwvRak4kXJ88QiH8dMR NTikawJafwOc0dTwVlAiFftaqysNqYbL2W+9vaQVnltPk5+0FovJfkBsVLxAriU0zBlC kic15PiwJPkwXw9/sTYpYPudxFw+niarOuv5C6NNtrGWYWbn2/a8QZfvUUQBfMZR4O1U LycRN8bunaszjpKFvxuZQAWRwlhsv+BGUShXMXFIZM+Rsit/LWGwaLMjc+7TZRI/USlj 3KSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=D39pJ5J9FJoRN6+8PKhrekJHeUA6FskrdTYVHnE1ZmA=; b=jYX2/LE8GaqRrEfpmY7tM973TOCdL/zbn8h26GnhCFhQ9+cn/a5hdlj7Etn/Dd2vqp JI0+ci+2ItZULMPhjWxFv3Se6UqWDCHXFf+UTYOINse4SjBwgI2r4Hqb0DmVJUcCp5Y1 Ewn6JDF7lKNR9rq7bvzMUMC5kDRAuTy9Obn72o13Vg0MUaxWps81GjcVo3JjDaJaNXjF 2KLl5EXbU4qmpTK8QtjMjgBwSOlHFDBrR1K3I0+tG5tJGHcjNxi9jAYA+Us3GkQAsFRQ Qpc5BTflNesN1QXzEMTG/IfKjHjhPNz7RZC8MAXJyXTOc3vbxSilaQbYjt8lSfUH27W2 Q5cg== X-Gm-Message-State: AD7BkJJpoqpCjzOzEA3RLeo7Elq7KaVkneHcybLIsXxOurzPUH/bw85EHlSY1uEYhUyF6w== X-Received: by 10.55.217.22 with SMTP id u22mr17665027qki.63.1459509435746; Fri, 01 Apr 2016 04:17:15 -0700 (PDT) Received: from localhost (bne75-h02-31-39-163-232.dsl.sta.abo.bbox.fr. [31.39.163.232]) by smtp.gmail.com with ESMTPSA id r65sm5913869qki.17.2016.04.01.04.17.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Apr 2016 04:17:15 -0700 (PDT) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Date: Fri, 1 Apr 2016 13:16:26 +0200 Message-Id: <1459509388-6185-17-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1459509388-6185-1-git-send-email-marcandre.lureau@redhat.com> References: <1459509388-6185-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::22e Cc: Yuanhan Liu , "Michael S. Tsirkin" , Ilya Maximets , jonshin@cisco.com, Tetsuya Mukawa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [Qemu-devel] [PATCH 16/18] test: vubr check vring enable state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André Lureau The rings shouldn't be processed unless previously enabled. Signed-off-by: Marc-André Lureau --- tests/vhost-user-bridge.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index 0779ba2..42450a6 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -710,7 +710,8 @@ vubr_backend_recv_cb(int sock, void *ctx) int buflen = sizeof(buf); int len; - if (!dev->ready) { + if (!dev->ready || !rx_vq->enable) { + DPRINT("\n NOT READY: dev: %d, rx: %d\n", dev->ready, rx_vq->enable); return; } @@ -747,8 +748,11 @@ vubr_kick_cb(int sock, void *ctx) if (rc == -1) { vubr_die("eventfd_read()"); } else { - DPRINT("Got kick_data: %016"PRIx64"\n", kick_data); - vubr_process_avail(dev, &dev->vq[1]); + DPRINT("Got kick_data: %016"PRIx64", vq enabled: %d\n", + kick_data, dev->vq[1].enable); + if (dev->vq[1].enable) { + vubr_process_avail(dev, &dev->vq[1]); + } } }