Received: by 2002:ab2:72c5:0:b0:1f7:f6a4:354b with SMTP id r5csp97518lqm; Tue, 7 May 2024 09:39:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmZzn2TejbdIud/EsGk++flZ4YefQUQZ/ghetcnPhQgKgrQOAvMYIlSThcuv71OlwfoHokld3mPI6xOdekYKspWenDnaYchM2popXM6g== X-Google-Smtp-Source: AGHT+IFNF66EWr8D/QnCZLPCn9/EACSq7L/VCu+5OBGIZbzMW6OQ0I6sHIsAo4khUpJdWlhfJFAh X-Received: by 2002:a05:6a20:3257:b0:1af:6a37:3b8a with SMTP id adf61e73a8af0-1afc8d26c83mr271194637.16.1715099986696; Tue, 07 May 2024 09:39:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715099986; cv=pass; d=google.com; s=arc-20160816; b=MoV5J2t/9ZD4ku+Li/Zr052sB2r73uGMdu/1jKBkK3HXv4kmZDzdeC66ZC5iS21Fo1 afAb3seAvF6VeVJ2fwZ2eLAMcUurCf/1PQWF1vzzlVKSB6Ogl9tWGl/yuC/65Q4yxhay Dcgt6VfIzGLjLVmGRGsixzi4oHkKtUewgdDBpKG3NXVAU4Ff2UpiH9OEuvtO04JZ8XFT 20fzRisHcsTWxKtvhAwvXJxqyK6jR+URda6HpN3q28jC8bbTTk1g91eBqqvGeAtUttvZ JyL83DLY8G79sz58y339a+UFccPfyE4M6bzVghJqldqYIeAP2eJGSjRJwFOm9WcFsxkL jvZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=QEPWyPqXjfXTsvTuPlfdpRm90Li02riAxy5iZWqixsY=; fh=Phk3TTgFNdd1N32B4Yv01TsQSBeYc8VMoFRK5Qit3kM=; b=aSy3OHetJrxFguAeZ5EqHP8pdrhWIbmQ8rIEnHPTDd2MKEplEGysstr5j7AHNq6a6u PwWVeM5OF8x6bUswOWLd9oMBPkZzAEmby35WjxMHUWlcB3DLpIsMt6FXLthTb7Lqpjxl AHFHKYEecCpW0TsK9UH5TRJCpbj+cyzZ+7SVEzDX443LADvqf2xFeWvA/Y8lIQJHKi7N 1eBH/OqOk5CI7rtFzx/iazTwqCt9nbPsQREijxbeuxCbMsqqbg4K5xrdj6iWaw9+Ctyn uFgriY1692C3r9YZrcp0KHU9V9xhvT2XF9QH5lhYpUtSlfZNndSsZosI/fGZDQTgbs6h 5bYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sZOpIzSM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171763-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d1-20020a170903230100b001e5373b0e46si8584708plh.66.2024.05.07.09.39.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:39:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sZOpIzSM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171763-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 26F81B2A407 for ; Tue, 7 May 2024 16:06:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D6DE16D33C; Tue, 7 May 2024 16:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sZOpIzSM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BA5D1649DA; Tue, 7 May 2024 16:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715097758; cv=none; b=VHm7OSHLOhcYJhANCCPpu2+3BkZR2RX0Fvm4kPqYYrx0U7OKQ/63zJWKcrP6WfFyXrS33dgKIKIK1xFlkkjVhr4jfe1uRzFr3Wgu30l1V0Hg8dQtcBIbebcPwXE3mSpURUL3pd8JOCSCNHqOpR2Q1fNPEAlVZJ5vW0BwInQSFjk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715097758; c=relaxed/simple; bh=nwWf43oku86e2innSvDOoVJQyhHvzwCs++ipm8hqsbc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cap3nJvj0tB4MKj0yV+ahb7lfKeCMlK5bGNz6s5bJ2ISFihQER/tmvOUjDn6KFNvKeT0p866ctVdyRV4bH5ALAslvXXsXJsRNCY9CTWCy2R/mQJCgjt8i2/p2ty8r9dRUhrzAqxR5MyvU0OuvmvIpW5svhIAapjmuy294BdIeyY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sZOpIzSM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20D7CC2BBFC; Tue, 7 May 2024 16:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715097757; bh=nwWf43oku86e2innSvDOoVJQyhHvzwCs++ipm8hqsbc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=sZOpIzSM6uihAF2+L2js+eSP8DbgFV0i6mLaYEUHTgRfN/62+qGPaT1y0xTx6V2cG HskidmpdiJCdi1A86YO4RVapEBjOpipUHZouKD2B+1otTpNJKeFceJunbQEkh/R759 2JX4R9fnNWAzxsYrI8RZ+KgyXwW2JmdpDdEbhiOE08XYuDxPoQHAXyZCgEUCSFd/ml q5Jx4x0aUjG0vgt2cwDif0WWV7dm/+uz7pN+z2STPSneRJmsHAA0KC+Bg57YkzmK0o iTYLxrZVTGUcnXxY19/ZshZ5u8/sR+3Iv1Eo5qEFgD9PZQZCpw+2R79FMusTF9Mp18 1cFN7vogHdY4A== Message-ID: Date: Tue, 7 May 2024 18:02:31 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH bpf-next 2/4] selftests/bpf: Add RUN_MPTCP_TEST macro Content-Language: en-GB To: Alexei Starovoitov Cc: MPTCP Upstream , Mat Martineau , Geliang Tang , Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , LKML , Network Development , bpf , "open list:KERNEL SELFTEST FRAMEWORK" , Geliang Tang References: <20240507-upstream-bpf-next-20240506-mptcp-subflow-test-v1-0-e2bcbdf49857@kernel.org> <20240507-upstream-bpf-next-20240506-mptcp-subflow-test-v1-2-e2bcbdf49857@kernel.org> From: Matthieu Baerts Autocrypt: addr=matttbe@kernel.org; keydata= xsFNBFXj+ekBEADxVr99p2guPcqHFeI/JcFxls6KibzyZD5TQTyfuYlzEp7C7A9swoK5iCvf YBNdx5Xl74NLSgx6y/1NiMQGuKeu+2BmtnkiGxBNanfXcnl4L4Lzz+iXBvvbtCbynnnqDDqU c7SPFMpMesgpcu1xFt0F6bcxE+0ojRtSCZ5HDElKlHJNYtD1uwY4UYVGWUGCF/+cY1YLmtfb WdNb/SFo+Mp0HItfBC12qtDIXYvbfNUGVnA5jXeWMEyYhSNktLnpDL2gBUCsdbkov5VjiOX7 CRTkX0UgNWRjyFZwThaZADEvAOo12M5uSBk7h07yJ97gqvBtcx45IsJwfUJE4hy8qZqsA62A nTRflBvp647IXAiCcwWsEgE5AXKwA3aL6dcpVR17JXJ6nwHHnslVi8WesiqzUI9sbO/hXeXw TDSB+YhErbNOxvHqCzZEnGAAFf6ges26fRVyuU119AzO40sjdLV0l6LE7GshddyazWZf0iac nEhX9NKxGnuhMu5SXmo2poIQttJuYAvTVUNwQVEx/0yY5xmiuyqvXa+XT7NKJkOZSiAPlNt6 VffjgOP62S7M9wDShUghN3F7CPOrrRsOHWO/l6I/qJdUMW+MHSFYPfYiFXoLUZyPvNVCYSgs 3oQaFhHapq1f345XBtfG3fOYp1K2wTXd4ThFraTLl8PHxCn4ywARAQABzSRNYXR0aGlldSBC YWVydHMgPG1hdHR0YmVAa2VybmVsLm9yZz7CwZEEEwEIADsCGwMFCwkIBwIGFQoJCAsCBBYC AwECHgECF4AWIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZ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I0 Core In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Alexei, Thank you for the review! On 07/05/2024 16:44, Alexei Starovoitov wrote: > On Tue, May 7, 2024 at 3:53 AM Matthieu Baerts (NGI0) > wrote: >> >> From: Geliang Tang >> >> Each MPTCP subtest tests test__start_subtest(suffix), then invokes >> test_suffix(). It makes sense to add a new macro RUN_MPTCP_TEST to >> simpolify the code. >> >> Signed-off-by: Geliang Tang >> Reviewed-by: Mat Martineau >> Signed-off-by: Matthieu Baerts (NGI0) >> --- >> tools/testing/selftests/bpf/prog_tests/mptcp.c | 12 ++++++++---- >> 1 file changed, 8 insertions(+), 4 deletions(-) >> >> diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c >> index baf976a7a1dd..9d1b255bb654 100644 >> --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c >> +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c >> @@ -347,10 +347,14 @@ static void test_mptcpify(void) >> close(cgroup_fd); >> } >> >> +#define RUN_MPTCP_TEST(suffix) \ >> +do { \ >> + if (test__start_subtest(#suffix)) \ >> + test_##suffix(); \ >> +} while (0) > > Please no. > Don't hide it behind macros. I understand, I'm personally not a big fan of hiding code being a macro too. This one saves only one line. Geliang added a few more tests in our tree [1], for a total of 9, so that's only saving 9 lines. Related to that, if you don't mind, Geliang also added another macro -- MPTCP_SCHED_TEST -- for tests that are currently only in our tree [2] (not ready yet). We asked him to reduce the size of this macro to the minimum. We accepted it because it removed quite a lot of similar code with very small differences [3]. Do you think we should revert this modification too? [1] https://github.com/multipath-tcp/mptcp_net-next/blob/4369d9cbd752e166961ac0db7f85886111606301/tools/testing/selftests/bpf/prog_tests/mptcp.c#L578-L595 [2] https://github.com/multipath-tcp/mptcp_net-next/blob/4369d9cbd752e166961ac0db7f85886111606301/tools/testing/selftests/bpf/prog_tests/mptcp.c#L559-L576 [3] https://lore.kernel.org/mptcp/cover.1713321357.git.tanggeliang@kylinos.cn/T/#m0b9c14f1cbae8653c6fd119f6b71d1797961d6ba Cheers, Matt -- Sponsored by the NGI0 Core fund.