* [PATCH bpf-next] selftests/bpf: improve netcnt test robustness
@ 2023-05-15 20:48 Andrii Nakryiko
2023-05-15 20:53 ` Stanislav Fomichev
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2023-05-15 20:48 UTC (permalink / raw)
To: bpf, ast, daniel, martin.lau; +Cc: andrii, kernel-team, Stanislav Fomichev
Change netcnt to demand at least 10K packets, as we frequently see some
stray packet arriving during the test in BPF CI. It seems more important
to make sure we haven't lost any packet than enforcing exact number of
packets.
Cc: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
tools/testing/selftests/bpf/prog_tests/netcnt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/netcnt.c b/tools/testing/selftests/bpf/prog_tests/netcnt.c
index d3915c58d0e1..c3333edd029f 100644
--- a/tools/testing/selftests/bpf/prog_tests/netcnt.c
+++ b/tools/testing/selftests/bpf/prog_tests/netcnt.c
@@ -67,12 +67,12 @@ void serial_test_netcnt(void)
}
/* No packets should be lost */
- ASSERT_EQ(packets, 10000, "packets");
+ ASSERT_GE(packets, 10000, "packets");
/* Let's check that bytes counter matches the number of packets
* multiplied by the size of ipv6 ICMP packet.
*/
- ASSERT_EQ(bytes, packets * 104, "bytes");
+ ASSERT_GE(bytes, packets * 104, "bytes");
err:
if (cg_fd != -1)
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: improve netcnt test robustness
2023-05-15 20:48 [PATCH bpf-next] selftests/bpf: improve netcnt test robustness Andrii Nakryiko
@ 2023-05-15 20:53 ` Stanislav Fomichev
2023-05-15 23:50 ` patchwork-bot+netdevbpf
2023-05-17 3:38 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Stanislav Fomichev @ 2023-05-15 20:53 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: bpf, ast, daniel, martin.lau, kernel-team
On Mon, May 15, 2023 at 1:48 PM Andrii Nakryiko <andrii@kernel.org> wrote:
>
> Change netcnt to demand at least 10K packets, as we frequently see some
> stray packet arriving during the test in BPF CI. It seems more important
> to make sure we haven't lost any packet than enforcing exact number of
> packets.
>
> Cc: Stanislav Fomichev <sdf@google.com>
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Stanislav Fomichev <sdf@google.com>
I was gonna try to count only icmp packets in the bpf program, but _GE
works as well :-)
> ---
> tools/testing/selftests/bpf/prog_tests/netcnt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/netcnt.c b/tools/testing/selftests/bpf/prog_tests/netcnt.c
> index d3915c58d0e1..c3333edd029f 100644
> --- a/tools/testing/selftests/bpf/prog_tests/netcnt.c
> +++ b/tools/testing/selftests/bpf/prog_tests/netcnt.c
> @@ -67,12 +67,12 @@ void serial_test_netcnt(void)
> }
>
> /* No packets should be lost */
> - ASSERT_EQ(packets, 10000, "packets");
> + ASSERT_GE(packets, 10000, "packets");
>
> /* Let's check that bytes counter matches the number of packets
> * multiplied by the size of ipv6 ICMP packet.
> */
> - ASSERT_EQ(bytes, packets * 104, "bytes");
> + ASSERT_GE(bytes, packets * 104, "bytes");
>
> err:
> if (cg_fd != -1)
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: improve netcnt test robustness
2023-05-15 20:48 [PATCH bpf-next] selftests/bpf: improve netcnt test robustness Andrii Nakryiko
2023-05-15 20:53 ` Stanislav Fomichev
@ 2023-05-15 23:50 ` patchwork-bot+netdevbpf
2023-05-17 3:38 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-15 23:50 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: bpf, ast, daniel, martin.lau, kernel-team, sdf
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:
On Mon, 15 May 2023 13:48:33 -0700 you wrote:
> Change netcnt to demand at least 10K packets, as we frequently see some
> stray packet arriving during the test in BPF CI. It seems more important
> to make sure we haven't lost any packet than enforcing exact number of
> packets.
>
> Cc: Stanislav Fomichev <sdf@google.com>
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
>
> [...]
Here is the summary with links:
- [bpf-next] selftests/bpf: improve netcnt test robustness
https://git.kernel.org/bpf/bpf-next/c/fdb16e48e1c8
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] 4+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: improve netcnt test robustness
2023-05-15 20:48 [PATCH bpf-next] selftests/bpf: improve netcnt test robustness Andrii Nakryiko
2023-05-15 20:53 ` Stanislav Fomichev
2023-05-15 23:50 ` patchwork-bot+netdevbpf
@ 2023-05-17 3:38 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-17 3:38 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: bpf, ast, daniel, martin.lau, kernel-team, sdf
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Mon, 15 May 2023 13:48:33 -0700 you wrote:
> Change netcnt to demand at least 10K packets, as we frequently see some
> stray packet arriving during the test in BPF CI. It seems more important
> to make sure we haven't lost any packet than enforcing exact number of
> packets.
>
> Cc: Stanislav Fomichev <sdf@google.com>
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
>
> [...]
Here is the summary with links:
- [bpf-next] selftests/bpf: improve netcnt test robustness
https://git.kernel.org/bpf/bpf-next/c/387912285917
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] 4+ messages in thread
end of thread, other threads:[~2023-05-17 3:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15 20:48 [PATCH bpf-next] selftests/bpf: improve netcnt test robustness Andrii Nakryiko
2023-05-15 20:53 ` Stanislav Fomichev
2023-05-15 23:50 ` patchwork-bot+netdevbpf
2023-05-17 3:38 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).