Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp331792lqo; Wed, 8 May 2024 00:37:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUHgVStDtrXPdKbE0QAPwLc66PBi2gmkWN+K6ZqeuiW3CXS1mFrZ/uBgRqeJGjJ4/BrklxbZhBIgi0FSz8IdnZl29Ip6WYCXEGyyR5EQg== X-Google-Smtp-Source: AGHT+IHRYpGXJAZH9qaCQYzgZO/YUPh4IIpYpAbiJQ89JLrqdAFnEhShamJSqPCcHi89am/oeQj8 X-Received: by 2002:a17:90a:a603:b0:2a5:7188:9590 with SMTP id 98e67ed59e1d1-2b6166c3147mr1960842a91.22.1715153835393; Wed, 08 May 2024 00:37:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715153835; cv=pass; d=google.com; s=arc-20160816; b=bxsEOGSBD83tpn0TiaH6QhWi7rakTLq28T+BUYjODv4wzkN7v6y7R9hPhhRa/NUhck gXgrmgABRlvHAzX8gPOOV0ss1TkdVYWRQq8kFAMhyRrA7Nnde9v6lm8Zle3v38weG6EU OjSQWTkamJOy6H/O+vTJRKRcB317OY+fRuBy4jBI2W1/73b4mUYULbC9ZVONWhedskTm maShoFM6sj/OHqaPGI5myc/3eaJHeDDcEQtPem8tMTwAEiLIym3ojtZmF8yBtidfWgt4 cl6YAnC4BHGxRkSl99LJzUZvcCnS3BREFh1jmWX3rR69z4x9yhXzMdAs4SEuKGlzTiaE ULFQ== 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=bsg/uUgmqvooJEQiWU0Ff+d0YQj7eNT7KBTq7h+7e6Y=; fh=Phk3TTgFNdd1N32B4Yv01TsQSBeYc8VMoFRK5Qit3kM=; b=e47ReoLZyySznm56npXTfpTRsl0P/Ud/qjQzDNk4rXiISocCtkylf1ciy6LHx1D0e9 kjjQ/cckmn8Kqe+F5a/oZRL03DrJPGGTudPfveYDzGVg4i7XuaPCcodXuvaGIT8p52sC iHJZpQvuZLSc4uPm/br0UgV7r6VDQQGg5nulzf+ZhOjlgdQ+6j9ayvPT4pdYiasLzT8q wtjt9RTXh84vTRb4XDBV9C1P2NNv0/H0O1RI/L9V1bq8FMONYqjm8NmnTYfYzclb/Qug /eU3iHjnZbt7KvHr3M2Tdt98LQb74vrQOHPGNtlFLWlAja7T3j+9WXrSfiR4IgJLLO0U VElA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="MIU/PHy7"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172817-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172817-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 98e67ed59e1d1-2b628fc5546si844682a91.130.2024.05.08.00.37.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 00:37:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172817-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="MIU/PHy7"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172817-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172817-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 71399B2154A for ; Wed, 8 May 2024 07:36:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55FC4339BC; Wed, 8 May 2024 07:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MIU/PHy7" 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 45EF52BB03; Wed, 8 May 2024 07:36:23 +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=1715153783; cv=none; b=aXof1I1Dz0SUxP8VANeXGAY8IkX5oF2Sj3ZEzHQA9nC//TFtPgtm4Vu7/IDNnEAgIfb8P6IF+iohtslPQe2CN8kGo7w1+DvUwBxd9KjP0Huh2SU5A59rNWRhivex2iXLYjwElM3bdAEZLg83w5RAJAnny7oqDtekxIOOx5I5KZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715153783; c=relaxed/simple; bh=cHpeGbQQdZmrqFcIMijvSWhcpBQuIhaTwJ7sISwqIx8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Btgt8Nv42F2yxeN+SFqEUdYJMulpN96clLWa46IaQMwgFocXs0aY26wj+0nm3uh7GpSPYsvjZfownxs1j+7Gbkvx5yYQNB9Hj+DB4vBKYTO3pNzbnT7jefKSiKz7Cr0yu11CHHyguxTV1YLqXncBRGXbvpuJRgQIrAhsJPr+JNk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MIU/PHy7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74571C113CC; Wed, 8 May 2024 07:36:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715153782; bh=cHpeGbQQdZmrqFcIMijvSWhcpBQuIhaTwJ7sISwqIx8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MIU/PHy7zVYLORjc8XaXaS0Y463ri+C1q86/07kB7nqQNhu2pSOs1koNQ0uZLedbv LG1NUjWhzSAr/vWH2A23Q9o5kTH6VpGI8lKgCQv6uvdSXDFvc8qUfKMGbpqDvih9ar D2eoLXfwtGpcln3ni2faYiusDAlQ6JgrRpSinZGPRuQVqYpmbxUmTAiFsoj1RaTz+H b6xXI37fzFewQOX9brpqw86x8716amO9c2SAV6eSzki2pa6CDCHjWbJqJXypEozv7v Cri6DAQ6t3RD1qVRhcBmc2rG5K1ivOvpBHazwSXXvOvWY+2xa1f87EQ6iXlH6jN7X1 UI+XNU279bzXQ== Message-ID: Date: Wed, 8 May 2024 09:36:13 +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 AwECHgECF4AWIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZU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0 Core In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Alexei, Thank you for your reply! On 07/05/2024 22:51, Alexei Starovoitov wrote: > On Tue, May 7, 2024 at 9:02 AM Matthieu Baerts wrote: >> >> 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? > > Yeah. Pls don't hide such things in macros. > Refactor into helper function in normal C. Sure, we will revert that. > But, what do you mean "in your tree" ? > That's your development tree and you plan to send all that > properly as patches to bpf-next someday? Yes, correct, we have some WIP patches in MPTCP development tree where we added a new bpf_struct_ops structure to implement new MPTCP packet schedulers in BPF. This work was paused for a while because we had to refine the packet scheduler API, but this task is now ongoing. Hopefully we will be able to send patches to bpf-next this "soon". Cheers, Matt -- Sponsored by the NGI0 Core fund.