From: Matthieu Baerts <matttbe@kernel.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: MPTCP Upstream <mptcp@lists.linux.dev>,
Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Mykola Lysenko <mykolal@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Network Development <netdev@vger.kernel.org>,
bpf <bpf@vger.kernel.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>,
Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH bpf-next 2/4] selftests/bpf: Add RUN_MPTCP_TEST macro
Date: Wed, 8 May 2024 09:36:13 +0200 [thread overview]
Message-ID: <b7d28a78-63f0-4531-b14f-2ad79454b2cd@kernel.org> (raw)
In-Reply-To: <CAADnVQJM73g9gTq3GxR-RMmpJPK3DGgzUTQiJXjz_B1G_4JAAw@mail.gmail.com>
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 <matttbe@kernel.org> 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)
>>> <matttbe@kernel.org> wrote:
>>>>
>>>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>>>
>>>> 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 <tanggeliang@kylinos.cn>
>>>> Reviewed-by: Mat Martineau <martineau@kernel.org>
>>>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>>>> ---
>>>> 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.
next prev parent reply other threads:[~2024-05-08 7:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 10:53 [PATCH bpf-next 0/4] selftests/bpf: new MPTCP subflow subtest & improvements Matthieu Baerts (NGI0)
2024-05-07 10:53 ` [PATCH bpf-next 1/4] selftests/bpf: Handle SIGINT when creating netns Matthieu Baerts (NGI0)
2024-05-07 14:43 ` Alexei Starovoitov
2024-05-07 15:59 ` Matthieu Baerts
2024-05-07 10:53 ` [PATCH bpf-next 2/4] selftests/bpf: Add RUN_MPTCP_TEST macro Matthieu Baerts (NGI0)
2024-05-07 14:44 ` Alexei Starovoitov
2024-05-07 16:02 ` Matthieu Baerts
2024-05-07 20:51 ` Alexei Starovoitov
2024-05-08 7:36 ` Matthieu Baerts [this message]
2024-05-11 1:42 ` Geliang Tang
2024-05-07 10:53 ` [PATCH bpf-next 3/4] selftests/bpf: Add mptcp subflow example Matthieu Baerts (NGI0)
2024-05-07 14:49 ` Alexei Starovoitov
2024-05-07 16:03 ` Matthieu Baerts
2024-05-07 20:54 ` Alexei Starovoitov
2024-05-08 7:36 ` Matthieu Baerts
2024-05-08 14:32 ` Alexei Starovoitov
2024-05-07 10:53 ` [PATCH bpf-next 4/4] selftests/bpf: Add mptcp subflow subtest Matthieu Baerts (NGI0)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b7d28a78-63f0-4531-b14f-2ad79454b2cd@kernel.org \
--to=matttbe@kernel.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=geliang@kernel.org \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=mykolal@fb.com \
--cc=netdev@vger.kernel.org \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=tanggeliang@kylinos.cn \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox