From patchwork Mon Dec 11 20:20:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 176910 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7317120vqy; Mon, 11 Dec 2023 12:21:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGX0gamCsCicHfH26GTQLWtelz141mBWRc3Z6ZQttsOwmS/GNi/IWRrQxkU1bWKQc8yVTuw X-Received: by 2002:a17:902:f68d:b0:1d0:977e:29b0 with SMTP id l13-20020a170902f68d00b001d0977e29b0mr5125053plg.49.1702326099087; Mon, 11 Dec 2023 12:21:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702326099; cv=none; d=google.com; s=arc-20160816; b=Ah7R7toplFaP1n1wmz4OTNR9fqli5chERXADH8fzde49DhcQk61C6pHx/7wuIkYUJw sP0XCw8I5K6NO4/wLfjaBKTN17y0eaJXzKQ2Vq0BzYOk6MXlomCkqZRh3llg9sF35saa lBjWuPToXsqBFhqoj+8DnfMHrsxBpAf2kpCQFWrVCf2xj3H0OKzgOsnQFp3j1fJxrshx YvDxgWtJsz7+DDV2U5fC4JSMO3ZflJ5omDdTjMjS5NlL7uKgYX6zHAzNVr6bNRBvsp2m JWn5UeNXsWq1qCoI1fo/b3VfrU3lELs0iT3vghtjZfGnPjVzL6aZx5cGFpV6rROYHSK+ X+Ew== 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=zIt7i/tZWl0ZiVj1ikFYul/lVojdXxdypL0j8VsQMP8=; b=f/GU4V35+kiSz3Bjik/x5glBDCiGd8F0CWAW9EYCzLnvvR4A0i257818iYK/re1uX/ 7cb9UBdTPTiY7rNijXIrfwXgT4d39N9lUZTNmhHNVU0KbJtaraupcLwhQMF0GWjNxP2w l6iHsC3uSCsNll8O6nynhrUxIH4+OFz13cZV2mP9EpCQxC3IP9fgdPmuAuyPUl4BlL67 bdEGIFyCI6JPXACy8Q9GRfv8YUQDcCLei0pDAfk7e3mwEv+CktxC7umPn2EvXP8xYbNN /bmhQfzaDZKcZ9R0O1e1kYiHf1r5/fcZ6Vrv56Jv1oTuPSB/6RkxVnWsXSR3gXlsdSwm q3zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=JVqifZby; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="eFtJ6MH/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id k9-20020a170902c40900b001d0bcb62f98si6984011plk.368.2023.12.11.12.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 12:21:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=JVqifZby; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="eFtJ6MH/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id B6D18803DAD1; Mon, 11 Dec 2023 12:21:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345076AbjLKUVD (ORCPT + 99 others); Mon, 11 Dec 2023 15:21:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345051AbjLKUUk (ORCPT ); Mon, 11 Dec 2023 15:20:40 -0500 Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02D7AC4; Mon, 11 Dec 2023 12:20:43 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id EB9BF58094F; Mon, 11 Dec 2023 15:20:42 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 11 Dec 2023 15:20:42 -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=1702326042; x= 1702333242; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; b=J VqifZby8iTVbIJr45A2Wmiev1aJW+TsXEbNf3yd8V+3ICvgJMw5d1B4byygvcxLV c1FPo5UbeLe2QSF2Tf/2LXqiH4sOK6LLQ4qKUOes/Cd/q7E5eskcjyYWEtPgOFFp zB9dTNw+Q9ZjCTSb0xOSS5iXW4jO2iybfVhM6jQSGryr6VL1LlRHYTfvhF8YxU2b FNlbRs+ThKMaX72/snNmnlIRFAYCD8g3vDOkWJbUVZBtwqd7HuVttlIrKXxpqau/ BzYFweClaeTPHRBLpGqyMOEBWu+Cfy1j3VTGwAJPbLnMNK2yBrLGEDU6McATG5vA 1nQwOKE2SsrnGVUVzlKWg== 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=1702326042; x= 1702333242; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; b=e FtJ6MH/HBvNzW5tiPBaMHj5ijZy+tr5MyHVJPpUwTpndNfGQpVK6BaazSWw8Ajfp sGU7udWshLOgVHWy3ki3GrhLG+QRVWT5OTzJAj0YmFKSlPyCQPoG6cLRYvO3je6P IE02RnR5whrge+p4gReMs71SM/BSZNeefsqWN3eOYb0s8u9iFPzKep2mNg5iPS5I 6X+yeunyDkvg8FPFFyYZ4YPrK9qIfUqvhmI52Zdlbu/MjGYqAHkssAKGKmDcE0w7 K7bFCQ6wpaMmP/mYibHP/9dQDVr1jQrpFqGNRms9fRL/tThiWxmZAfw903D+cx5G LzRmsysIdIwQiOML+mrMA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudelvddgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhephf fvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgrnhhivghlucgiuhcu oegugihusegugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpefgfefggeejhfduie ekvdeuteffleeifeeuvdfhheejleejjeekgfffgefhtddtteenucevlhhushhtvghrufhi iigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Dec 2023 15:20:41 -0500 (EST) From: Daniel Xu To: ast@kernel.org, andrii@kernel.org, shuah@kernel.org, daniel@iogearbox.net, steffen.klassert@secunet.com, antony.antony@secunet.com, alexei.starovoitov@gmail.com, yonghong.song@linux.dev, eddyz87@gmail.com, eyal.birger@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 v5 6/9] bpf: selftests: test_tunnel: Setup fresh topology for each subtest Date: Mon, 11 Dec 2023 13:20:10 -0700 Message-ID: <64d0eca46fb43b089262ec96c797f56c10e494a5.1702325874.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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 11 Dec 2023 12:21:27 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785018291839391434 X-GMAIL-MSGID: 1785018291839391434 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; }