From patchwork Mon Dec 4 20:56:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 173561 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3033471vqy; Mon, 4 Dec 2023 12:57:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IH94b2gyqty9IeBfqFUQYRVPI5noW65fpFyf2hQhF8qIxuCKQ/SrLmoFYvLRdWCMjt/zTxH X-Received: by 2002:a05:6a20:979b:b0:18b:208b:7043 with SMTP id hx27-20020a056a20979b00b0018b208b7043mr4554107pzc.49.1701723478416; Mon, 04 Dec 2023 12:57:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701723478; cv=none; d=google.com; s=arc-20160816; b=iU0V8wRSoUoLZmpktbMu6j+i1StqS5Aq2JDdmNPxfeJv8ye1roeJEWGnLtzoiVKNT+ XvNAX2+jHe+734BZoO0YoySsICJcpOm6eCzHo4lLiHbWp14clyPjPx85/wmXXCkJYCLc b1zscTlncawOA+A5Lt+noYeznPg7o27J/4DMMXUWDFZRS/8OJ/t13imcRic8np7aYyR5 2ZDHCZIyialPbWiaoodhM67raHog784ceoAPYvoEyZK7IUn3FgKTYAdLLj0AISkOapGx 6Sgw48wN10V8NClSfDYH7gzMF+qAEkkp+VeOWolyZrZ1EJq3RL1Ugqr2kWQH8c/8yq+/ sBUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; fh=MAo5rn/iZDhyZgoYtcxdejdXZMUS1JnKG5NSUpwlKTs=; b=UrdDP9KxjcXSJzkww9YKdLqyh3JCk1MuNlk/zfHMn/Q2mufD7ns+1ThUWVH3QPIDvq uz6owRrnLDCYtog+AmFQhvo0q8XZPup9AkI6qpAC+BDD3VXjqckyhjUaVXTbRtdNbtnB crjIz1BHQqaGI0heXesmZsAy2ZB1pHzqQSt2NesgK00K7bjqUebXpDHOe9CXvDmlvDzI QRuyxxFWudu64rmO/+AUCbuhdIHMzebbuHURRR3gmpf0AD2ttDCff4+zeC9kZ7cda+cU 4fMQXronUIUKrahBiUP7AdO9yUjk6goNbMW6+XWEhDOeDtU7MDSOpOu4lluZZ9n102oB 5NBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=AgScb7V5; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=F1MPREaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id h2-20020a655182000000b005c64e8141b8si5167056pgq.101.2023.12.04.12.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 12:57:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=AgScb7V5; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=F1MPREaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 10DE780D0CF5; Mon, 4 Dec 2023 12:57:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233697AbjLDU5f (ORCPT + 99 others); Mon, 4 Dec 2023 15:57:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235485AbjLDU5Q (ORCPT ); Mon, 4 Dec 2023 15:57:16 -0500 Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87A2010F7; Mon, 4 Dec 2023 12:57:06 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id BEB83580A68; Mon, 4 Dec 2023 15:57:05 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 04 Dec 2023 15:57:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1701723425; x= 1701730625; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; b=A gScb7V5WIAslO1HjIrDWIOvb5iJD0GhTZulvOD+5k76bLl/jucRiHMlIu7WfI6De bPnTmR7sjhdFLDd2SvI1DdTJs3gRwJAUVW46A1cR7J5HdEG1behaz28XyUgTdD6c tvDfCWxGOmOR2ekl8i+yJSBo0pMHeYNns26q32sfztNUFmiR5KFsi5DiRuqBPGPB iL0RsqdaY8j4BrXJx1k8hrD7HeoyabdYFdvXn0ulv4HBWlr2kie4HDCPg77lQul0 nYMzk4BAj7f7mDC3cB9Z5RKHIkh52ziYDGnuUUK5vKB7TBJBICk4x/Gn6Tk836wi ukQtLkXsYC0DQ4G2to9DA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1701723425; x= 1701730625; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; b=F 1MPREaGpmSLEewYF+SIQtBc2H3li+0vIj2Y3sRjnMdlfM7ps+UHfEyd2TG8ayUKX tPdozUI7cRf7ULWMvF86ox011b26p9y1v56szjGo0tsXZg+kItWKq22If5q8tysv wIHZWEADuEa8jcLn4Zpvs9VaTGQgxZSAFQM8dEdzxImnD/ZvZwwWvmTa021AKX7F 6FMckoe1ba9JDZ2sCKY2+0UBDsfFgfuF71eW0gEFUSgnS7X95YGbNobFOdDUOx7c wi2g/BbWzzBeJbTysRYj50KGK1ANeFn1q+GWQBH5qDrUunc9BAYInzWOkLM/c8UB 34OEgpMS9jZKFQcFwq5/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejiedgudeggecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhephf fvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgrnhhivghlucgiuhcu oegugihusegugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpefgfefggeejhfduie ekvdeuteffleeifeeuvdfhheejleejjeekgfffgefhtddtteenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Dec 2023 15:57:03 -0500 (EST) From: Daniel Xu To: daniel@iogearbox.net, shuah@kernel.org, andrii@kernel.org, ast@kernel.org, steffen.klassert@secunet.com, antony.antony@secunet.com, alexei.starovoitov@gmail.com, yonghong.song@linux.dev, eddyz87@gmail.com Cc: martin.lau@linux.dev, song@kernel.org, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, mykolal@fb.com, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linux-ipsec.org, netdev@vger.kernel.org Subject: [PATCH bpf-next v4 07/10] bpf: selftests: test_tunnel: Setup fresh topology for each subtest Date: Mon, 4 Dec 2023 13:56:27 -0700 Message-ID: <5292165f1f64883b5fc6354a9a24fb8074e3c2c6.1701722991.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.42.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 12:57:55 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784386397881877719 X-GMAIL-MSGID: 1784386397881877719 This helps with determinism b/c individual setup/teardown prevents leaking state between different subtests. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/prog_tests/test_tunnel.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_tunnel.c b/tools/testing/selftests/bpf/prog_tests/test_tunnel.c index d149ab98798d..b57d48219d0b 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_tunnel.c +++ b/tools/testing/selftests/bpf/prog_tests/test_tunnel.c @@ -535,23 +535,20 @@ static void test_ipip_tunnel(enum ipip_encap encap) #define RUN_TEST(name, ...) \ ({ \ if (test__start_subtest(#name)) { \ + config_device(); \ test_ ## name(__VA_ARGS__); \ + cleanup(); \ } \ }) static void *test_tunnel_run_tests(void *arg) { - cleanup(); - config_device(); - RUN_TEST(vxlan_tunnel); RUN_TEST(ip6vxlan_tunnel); RUN_TEST(ipip_tunnel, NONE); RUN_TEST(ipip_tunnel, FOU); RUN_TEST(ipip_tunnel, GUE); - cleanup(); - return NULL; }