From patchwork Mon Oct 2 19:15:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 820643 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y5X2V2QZkz9sPk for ; Tue, 3 Oct 2017 06:16:13 +1100 (AEDT) Received: from localhost ([::1]:53820 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz6CJ-0001g8-84 for incoming@patchwork.ozlabs.org; Mon, 02 Oct 2017 15:16:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz6Bi-0001fp-L1 for qemu-devel@nongnu.org; Mon, 02 Oct 2017 15:15:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dz6Bh-0000Pi-E8 for qemu-devel@nongnu.org; Mon, 02 Oct 2017 15:15:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46356) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dz6Bh-0000P6-7r for qemu-devel@nongnu.org; Mon, 02 Oct 2017 15:15:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5CA9D7E43D for ; Mon, 2 Oct 2017 19:15:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5CA9D7E43D Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dgilbert@redhat.com Received: from dgilbert-t530.redhat.com (ovpn-117-189.ams2.redhat.com [10.36.117.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 564E460246; Mon, 2 Oct 2017 19:15:31 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, mst@redhat.com, marcandre.lureau@redhat.com, maxime.coquelin@redhat.com Date: Mon, 2 Oct 2017 20:15:19 +0100 Message-Id: <20171002191521.15748-3-dgilbert@redhat.com> In-Reply-To: <20171002191521.15748-1-dgilbert@redhat.com> References: <20171002191521.15748-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 02 Oct 2017 19:15:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/4] vhost-user-bridge: Only process received packets on started queues X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org Sender: "Qemu-devel" From: "Dr. David Alan Gilbert" Only process received packets if the queue has been started. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Marc-André Lureau --- tests/vhost-user-bridge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index f922cc75ae..d820033a72 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -277,6 +277,7 @@ vubr_backend_recv_cb(int sock, void *ctx) DPRINT(" hdrlen = %d\n", hdrlen); if (!vu_queue_enabled(dev, vq) || + !vu_queue_started(dev, vq) || !vu_queue_avail_bytes(dev, vq, hdrlen, 0)) { DPRINT("Got UDP packet, but no available descriptors on RX virtq.\n"); return;