All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: Skip all serial_test_get_branch_snapshot in vm
@ 2021-10-26  0:07 Song Liu
  2021-10-26  3:45 ` Andrii Nakryiko
  0 siblings, 1 reply; 2+ messages in thread
From: Song Liu @ 2021-10-26  0:07 UTC (permalink / raw)
  To: bpf, netdev; +Cc: ast, daniel, andrii, kernel-team, Song Liu

Skipping the second half of the test is not enough to silent the warning
in dmesg. Skip the whole test before we can either properly silent the
warning in kernel, or fix LBR snapshot for VM.

Fixes: 025bd7c753aa ("selftests/bpf: Add test for bpf_get_branch_snapshot")
Fixes: aa67fdb46436 ("selftests/bpf: Skip the second half of get_branch_snapshot in vm")
Signed-off-by: Song Liu <songliubraving@fb.com>
---
 .../bpf/prog_tests/get_branch_snapshot.c         | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c b/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
index d6d70a359aeb5..81402e4439844 100644
--- a/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
+++ b/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
@@ -78,6 +78,12 @@ void serial_test_get_branch_snapshot(void)
 	struct get_branch_snapshot *skel = NULL;
 	int err;
 
+	/* Skip the test before we fix LBR snapshot for hypervisor. */
+	if (is_hypervisor()) {
+		test__skip();
+		return;
+	}
+
 	if (create_perf_events()) {
 		test__skip();  /* system doesn't support LBR */
 		goto cleanup;
@@ -107,16 +113,6 @@ void serial_test_get_branch_snapshot(void)
 		goto cleanup;
 	}
 
-	if (is_hypervisor()) {
-		/* As of today, LBR in hypervisor cannot be stopped before
-		 * too many entries are flushed. Skip the hit/waste test
-		 * for now in hypervisor until we optimize the LBR in
-		 * hypervisor.
-		 */
-		test__skip();
-		goto cleanup;
-	}
-
 	ASSERT_GT(skel->bss->test1_hits, 6, "find_looptest_in_lbr");
 
 	/* Given we stop LBR in software, we will waste a few entries.
-- 
2.30.2


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

* Re: [PATCH bpf-next] selftests/bpf: Skip all serial_test_get_branch_snapshot in vm
  2021-10-26  0:07 [PATCH bpf-next] selftests/bpf: Skip all serial_test_get_branch_snapshot in vm Song Liu
@ 2021-10-26  3:45 ` Andrii Nakryiko
  0 siblings, 0 replies; 2+ messages in thread
From: Andrii Nakryiko @ 2021-10-26  3:45 UTC (permalink / raw)
  To: Song Liu
  Cc: bpf, Networking, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Kernel Team

On Mon, Oct 25, 2021 at 5:07 PM Song Liu <songliubraving@fb.com> wrote:
>
> Skipping the second half of the test is not enough to silent the warning
> in dmesg. Skip the whole test before we can either properly silent the
> warning in kernel, or fix LBR snapshot for VM.
>
> Fixes: 025bd7c753aa ("selftests/bpf: Add test for bpf_get_branch_snapshot")
> Fixes: aa67fdb46436 ("selftests/bpf: Skip the second half of get_branch_snapshot in vm")
> Signed-off-by: Song Liu <songliubraving@fb.com>
> ---

Applied to bpf-next, thanks for the fix!

>  .../bpf/prog_tests/get_branch_snapshot.c         | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c b/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
> index d6d70a359aeb5..81402e4439844 100644
> --- a/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
> +++ b/tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
> @@ -78,6 +78,12 @@ void serial_test_get_branch_snapshot(void)
>         struct get_branch_snapshot *skel = NULL;
>         int err;
>
> +       /* Skip the test before we fix LBR snapshot for hypervisor. */
> +       if (is_hypervisor()) {
> +               test__skip();
> +               return;
> +       }
> +
>         if (create_perf_events()) {
>                 test__skip();  /* system doesn't support LBR */
>                 goto cleanup;
> @@ -107,16 +113,6 @@ void serial_test_get_branch_snapshot(void)
>                 goto cleanup;
>         }
>
> -       if (is_hypervisor()) {
> -               /* As of today, LBR in hypervisor cannot be stopped before
> -                * too many entries are flushed. Skip the hit/waste test
> -                * for now in hypervisor until we optimize the LBR in
> -                * hypervisor.
> -                */
> -               test__skip();
> -               goto cleanup;
> -       }
> -
>         ASSERT_GT(skel->bss->test1_hits, 6, "find_looptest_in_lbr");
>
>         /* Given we stop LBR in software, we will waste a few entries.
> --
> 2.30.2
>

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

end of thread, other threads:[~2021-10-26  3:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26  0:07 [PATCH bpf-next] selftests/bpf: Skip all serial_test_get_branch_snapshot in vm Song Liu
2021-10-26  3:45 ` Andrii Nakryiko

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.