Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7578348ybi; Thu, 1 Aug 2019 10:16:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4At8Z7nkTnDX2A889OKB3RS8XvM9riVPD97lIbzGm4ee5qQiaevsY8r9Re5kqGlq7aQN+ X-Received: by 2002:a63:ec13:: with SMTP id j19mr38722066pgh.369.1564679804925; Thu, 01 Aug 2019 10:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564679804; cv=none; d=google.com; s=arc-20160816; b=cdmYzoyJ09XFjXHht5UjhlODGh5VIK3O+B5H4bNiLMPPubMgAS9QzMdhRGlt1YFH3N 1IfyMDhbYeQYfUb3MeyRE5OLUIjZ1CnuNMEDfvEhHBeOOxegxKA3yZBRSXNLeRn56PH3 JNDhZKgKbiwfOJ0Xsq3JjAozvM3jg+7r9YrZD5MdZYmkKB70ChKGJ8Gqfpulkg5mTVB+ SMwzQTZ6chrcCym3n1OvokzsWPpAe0cBE/AvxbORzPd0iuP2cbOl/g9D25zguEWX7adt 5q6Mmx3p4royH/RSXfRXjjwTww8UWcoah/6WpBWV2yCxobLr0SdgPvRzSRqHxqZkFvZF vyEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=X1Ysgwih5QUoi+sLx1GSurMzlgDoC3M49KM2YtQeyc0=; b=RTvSLYIls/6ustv6s8kTmavylYlb4+rEHpdjSFDxyZBPBaF083Iaa80+qfk+suIeD4 Te9eqwlt3DD9iruKir0hlgoh1o/JDaa6BWcMDMwNJemu4GQFD7uvZuETGbZdePf+WrDE zMpTIUzT26d3ky6ELmZo35vdDLgiAzaSkpP93bWt+eT10e4JUvm+4r1G4FHOehNtypBY 0aip+2hwjPinMOl1nKoYz4u17iu6OqDgTISoqUyhPzlbyha0sXBQ+k8xxB0kdfboGJEr 0MuYycWhrtoROkJGEtGttRh72/31MoC9Z9HeWUe2r7JaDoy2X/gL8KarRcK3bGndn82t FL2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si38542542pfl.279.2019.08.01.10.16.28; Thu, 01 Aug 2019 10:16:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732650AbfHAP0G (ORCPT + 99 others); Thu, 1 Aug 2019 11:26:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35262 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732631AbfHAP0C (ORCPT ); Thu, 1 Aug 2019 11:26:02 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 55A29C08EC0A; Thu, 1 Aug 2019 15:26:02 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-117-63.ams2.redhat.com [10.36.117.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2A35600C4; Thu, 1 Aug 2019 15:25:59 +0000 (UTC) From: Stefano Garzarella To: netdev@vger.kernel.org Cc: kvm@vger.kernel.org, Stefan Hajnoczi , Dexuan Cui , virtualization@lists.linux-foundation.org, "David S. Miller" , Jorgen Hansen , linux-kernel@vger.kernel.org Subject: [PATCH v2 05/11] VSOCK: add full barrier between test cases Date: Thu, 1 Aug 2019 17:25:35 +0200 Message-Id: <20190801152541.245833-6-sgarzare@redhat.com> In-Reply-To: <20190801152541.245833-1-sgarzare@redhat.com> References: <20190801152541.245833-1-sgarzare@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 01 Aug 2019 15:26:02 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Hajnoczi See code comment for details. Signed-off-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- tools/testing/vsock/util.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/testing/vsock/util.c b/tools/testing/vsock/util.c index f838bcee3589..4280a56ba677 100644 --- a/tools/testing/vsock/util.c +++ b/tools/testing/vsock/util.c @@ -161,10 +161,24 @@ void run_tests(const struct test_case *test_cases, printf("%s...", test_cases[i].name); fflush(stdout); - if (opts->mode == TEST_MODE_CLIENT) + if (opts->mode == TEST_MODE_CLIENT) { + /* Full barrier before executing the next test. This + * ensures that client and server are executing the + * same test case. In particular, it means whoever is + * faster will not see the peer still executing the + * last test. This is important because port numbers + * can be used by multiple test cases. + */ + control_expectln("NEXT"); + control_writeln("NEXT"); + run = test_cases[i].run_client; - else + } else { + control_writeln("NEXT"); + control_expectln("NEXT"); + run = test_cases[i].run_server; + } if (run) run(opts); -- 2.20.1