All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: Add pid limit for mptcpify prog
@ 2024-04-02 10:50 Geliang Tang
  2024-04-02 11:43 ` MPTCP CI
  2024-04-02 17:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From: Geliang Tang @ 2024-04-02 10:50 UTC (permalink / raw)
  To: 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
  Cc: Geliang Tang, bpf, mptcp, Martin KaFai Lau

From: Geliang Tang <tanggeliang@kylinos.cn>

In order to prevent mptcpify prog from affecting the running results
of other BPF tests, a pid limit was added to restrict it from only
modifying its own program.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Suggested-by: Martin KaFai Lau <martin.lau@kernel.org>
---
 tools/testing/selftests/bpf/prog_tests/mptcp.c | 2 ++
 tools/testing/selftests/bpf/progs/mptcpify.c   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
index bff13ecec64c..17f352154994 100644
--- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
+++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
@@ -266,6 +266,8 @@ static int run_mptcpify(int cgroup_fd)
 	if (!ASSERT_OK_PTR(mptcpify_skel, "skel_open_load"))
 		return libbpf_get_error(mptcpify_skel);
 
+	mptcpify_skel->bss->pid = getpid();
+
 	err = mptcpify__attach(mptcpify_skel);
 	if (!ASSERT_OK(err, "skel_attach"))
 		goto out;
diff --git a/tools/testing/selftests/bpf/progs/mptcpify.c b/tools/testing/selftests/bpf/progs/mptcpify.c
index 53301ae8a8f7..cbdc730c3a47 100644
--- a/tools/testing/selftests/bpf/progs/mptcpify.c
+++ b/tools/testing/selftests/bpf/progs/mptcpify.c
@@ -6,10 +6,14 @@
 #include "bpf_tracing_net.h"
 
 char _license[] SEC("license") = "GPL";
+int pid;
 
 SEC("fmod_ret/update_socket_protocol")
 int BPF_PROG(mptcpify, int family, int type, int protocol)
 {
+	if (bpf_get_current_pid_tgid() >> 32 != pid)
+		return protocol;
+
 	if ((family == AF_INET || family == AF_INET6) &&
 	    type == SOCK_STREAM &&
 	    (!protocol || protocol == IPPROTO_TCP)) {
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: Add pid limit for mptcpify prog
  2024-04-02 10:50 [PATCH bpf-next] selftests/bpf: Add pid limit for mptcpify prog Geliang Tang
@ 2024-04-02 11:43 ` MPTCP CI
  2024-04-02 17:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 5+ messages in thread
From: MPTCP CI @ 2024-04-02 11:43 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Unstable: 1 failed test(s): packetdrill_fastopen 🔴
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/8521765619

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/b907465ec479
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=840571


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: Add pid limit for mptcpify prog
  2024-04-02 10:50 [PATCH bpf-next] selftests/bpf: Add pid limit for mptcpify prog Geliang Tang
  2024-04-02 11:43 ` MPTCP CI
@ 2024-04-02 17:10 ` patchwork-bot+netdevbpf
  2024-04-03  1:00   ` Geliang Tang
  1 sibling, 1 reply; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-02 17:10 UTC (permalink / raw)
  To: Geliang Tang
  Cc: andrii, eddyz87, mykolal, ast, daniel, martin.lau, song,
	yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa,
	shuah, tanggeliang, bpf, mptcp, martin.lau

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Tue,  2 Apr 2024 18:50:21 +0800 you wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> In order to prevent mptcpify prog from affecting the running results
> of other BPF tests, a pid limit was added to restrict it from only
> modifying its own program.
> 
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> Suggested-by: Martin KaFai Lau <martin.lau@kernel.org>
> 
> [...]

Here is the summary with links:
  - [bpf-next] selftests/bpf: Add pid limit for mptcpify prog
    https://git.kernel.org/bpf/bpf-next/c/c07b4bcd5163

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: Add pid limit for mptcpify prog
  2024-04-02 17:10 ` patchwork-bot+netdevbpf
@ 2024-04-03  1:00   ` Geliang Tang
  2024-04-04 10:55     ` Matthieu Baerts
  0 siblings, 1 reply; 5+ messages in thread
From: Geliang Tang @ 2024-04-03  1:00 UTC (permalink / raw)
  To: Matthieu Baerts; +Cc: mptcp

Hi Matt,

On Tue, 2024-04-02 at 17:10 +0000, patchwork-bot+netdevbpf@kernel.org
wrote:
> Hello:
> 
> This patch was applied to bpf/bpf-next.git (master)
> by Andrii Nakryiko <andrii@kernel.org>:
> 
> On Tue,  2 Apr 2024 18:50:21 +0800 you wrote:
> > From: Geliang Tang <tanggeliang@kylinos.cn>
> > 
> > In order to prevent mptcpify prog from affecting the running
> > results
> > of other BPF tests, a pid limit was added to restrict it from only
> > modifying its own program.
> > 
> > Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> > Suggested-by: Martin KaFai Lau <martin.lau@kernel.org>
> > 
> > [...]
> 
> Here is the summary with links:
>   - [bpf-next] selftests/bpf: Add pid limit for mptcpify prog
>     https://git.kernel.org/bpf/bpf-next/c/c07b4bcd5163
> 
> You are awesome, thank you!

Please also merge this patch into our MPTCP export branch, since some
patches in our patchwork depond on it.

These two patches need to be merged too:

selftests/bpf: Use connect_fd_to_fd in bpf_tcp_ca
selftests/bpf: Drop settimeo in do_test

I changed the states of them all as "Queued" and delegated them to you
in our patchwork.

Thanks,
-Geliang

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: Add pid limit for mptcpify prog
  2024-04-03  1:00   ` Geliang Tang
@ 2024-04-04 10:55     ` Matthieu Baerts
  0 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts @ 2024-04-04 10:55 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

Hi Geliang,

On 03/04/2024 03:00, Geliang Tang wrote:
> Hi Matt,
> 
> On Tue, 2024-04-02 at 17:10 +0000, patchwork-bot+netdevbpf@kernel.org
> wrote:
>> Hello:
>>
>> This patch was applied to bpf/bpf-next.git (master)
>> by Andrii Nakryiko <andrii@kernel.org>:
>>
>> On Tue,  2 Apr 2024 18:50:21 +0800 you wrote:
>>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>>
>>> In order to prevent mptcpify prog from affecting the running
>>> results
>>> of other BPF tests, a pid limit was added to restrict it from only
>>> modifying its own program.
>>>
>>> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
>>> Suggested-by: Martin KaFai Lau <martin.lau@kernel.org>
>>>
>>> [...]
>>
>> Here is the summary with links:
>>   - [bpf-next] selftests/bpf: Add pid limit for mptcpify prog
>>     https://git.kernel.org/bpf/bpf-next/c/c07b4bcd5163
>>
>> You are awesome, thank you!
> 
> Please also merge this patch into our MPTCP export branch, since some
> patches in our patchwork depond on it.
> 
> These two patches need to be merged too:
> 
> selftests/bpf: Use connect_fd_to_fd in bpf_tcp_ca
> selftests/bpf: Drop settimeo in do_test
> 
> I changed the states of them all as "Queued" and delegated them to you
> in our patchwork.

I thought the bpf-next tree was synced with net-next every week, but no.
So I just added them in our tree ('fixes for net-next', but that's
temporally).

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-04 10:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 10:50 [PATCH bpf-next] selftests/bpf: Add pid limit for mptcpify prog Geliang Tang
2024-04-02 11:43 ` MPTCP CI
2024-04-02 17:10 ` patchwork-bot+netdevbpf
2024-04-03  1:00   ` Geliang Tang
2024-04-04 10:55     ` Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.