diff mbox series

[bpf-next] selftests/bpf: select CONFIG_FUNCTION_ERROR_INJECTION

Message ID 20221213220500.3427947-1-song@kernel.org (mailing list archive)
State Accepted
Commit e561fc8365da0215f68cfcffb6c309d1d7eb8c2b
Delegated to: BPF
Headers show
Series [bpf-next] selftests/bpf: select CONFIG_FUNCTION_ERROR_INJECTION | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 9 maintainers not CCed: linux-kselftest@vger.kernel.org kpsingh@kernel.org haoluo@google.com yhs@fb.com sdf@google.com john.fastabend@gmail.com shuah@kernel.org jolsa@kernel.org mykolal@fb.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 4 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-next-VM_Test-7 success Logs for llvm-toolchain
bpf/vmtest-bpf-next-VM_Test-8 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-5 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-6 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-4 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-11 pending Logs for test_maps on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-28 success Logs for test_progs_no_alu32_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-34 success Logs for test_verifier on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-35 success Logs for test_verifier on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-37 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-38 success Logs for test_verifier on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_maps on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-10 success Logs for test_maps on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-12 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-13 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-14 success Logs for test_progs on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-15 success Logs for test_progs on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-17 success Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-18 success Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-19 success Logs for test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-20 success Logs for test_progs_no_alu32 on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-22 success Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-23 success Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-24 success Logs for test_progs_no_alu32_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-25 success Logs for test_progs_no_alu32_parallel on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-26 success Logs for test_progs_no_alu32_parallel on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-27 success Logs for test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-29 success Logs for test_progs_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-30 success Logs for test_progs_parallel on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-32 success Logs for test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-33 success Logs for test_progs_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-36 success Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-16 success Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-21 success Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-31 success Logs for test_progs_parallel on s390x with gcc

Commit Message

Song Liu Dec. 13, 2022, 10:05 p.m. UTC
BPF selftests require CONFIG_FUNCTION_ERROR_INJECTION to work. However,
CONFIG_FUNCTION_ERROR_INJECTION is no longer 'y' by default after [1].
As a result, we are seeing errors like the following from BPF CI:

   bpf_testmod_test_read() is not modifiable
   __x64_sys_setdomainname is not sleepable
   __x64_sys_getpgid is not sleepable

Fix this by explicitly selecting CONFIG_FUNCTION_ERROR_INJECTION in the
selftest config.

[1] commit a4412fdd49dc ("error-injection: Add prompt for function error injection")
Reported-by: Daniel Müller <deso@posteo.net>
Signed-off-by: Song Liu <song@kernel.org>
---
 tools/testing/selftests/bpf/config | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Müller Dec. 13, 2022, 11:20 p.m. UTC | #1
On Tue, Dec 13, 2022 at 02:05:00PM -0800, Song Liu wrote:
> BPF selftests require CONFIG_FUNCTION_ERROR_INJECTION to work. However,
> CONFIG_FUNCTION_ERROR_INJECTION is no longer 'y' by default after [1].
> As a result, we are seeing errors like the following from BPF CI:
> 
>    bpf_testmod_test_read() is not modifiable
>    __x64_sys_setdomainname is not sleepable
>    __x64_sys_getpgid is not sleepable
> 
> Fix this by explicitly selecting CONFIG_FUNCTION_ERROR_INJECTION in the
> selftest config.
> 
> [1] commit a4412fdd49dc ("error-injection: Add prompt for function error injection")
> Reported-by: Daniel Müller <deso@posteo.net>
> Signed-off-by: Song Liu <song@kernel.org>
> ---
>  tools/testing/selftests/bpf/config | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
> index 612f699dc4f7..5cbc975fd5c8 100644
> --- a/tools/testing/selftests/bpf/config
> +++ b/tools/testing/selftests/bpf/config
> @@ -76,3 +76,4 @@ CONFIG_USERFAULTFD=y
>  CONFIG_VXLAN=y
>  CONFIG_XDP_SOCKETS=y
>  CONFIG_XFRM_INTERFACE=y
> +CONFIG_FUNCTION_ERROR_INJECTION=y
> \ No newline at end of file

Thanks for the fix! I believe we try to keep the file sorted (although I do see
one violation) to make it easy to diff against arch specific configs but also to
minimize the risk of merge conflicts (more likely if everybody appends). Would
you mind sorting the addition in?

Looks good to me otherwise.

Acked-by: Daniel Müller <deso@posteo.net>
Andrii Nakryiko Dec. 13, 2022, 11:27 p.m. UTC | #2
On Tue, Dec 13, 2022 at 3:21 PM Daniel Müller <deso@posteo.net> wrote:
>
> On Tue, Dec 13, 2022 at 02:05:00PM -0800, Song Liu wrote:
> > BPF selftests require CONFIG_FUNCTION_ERROR_INJECTION to work. However,
> > CONFIG_FUNCTION_ERROR_INJECTION is no longer 'y' by default after [1].
> > As a result, we are seeing errors like the following from BPF CI:
> >
> >    bpf_testmod_test_read() is not modifiable
> >    __x64_sys_setdomainname is not sleepable
> >    __x64_sys_getpgid is not sleepable
> >
> > Fix this by explicitly selecting CONFIG_FUNCTION_ERROR_INJECTION in the
> > selftest config.
> >
> > [1] commit a4412fdd49dc ("error-injection: Add prompt for function error injection")
> > Reported-by: Daniel Müller <deso@posteo.net>
> > Signed-off-by: Song Liu <song@kernel.org>
> > ---
> >  tools/testing/selftests/bpf/config | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
> > index 612f699dc4f7..5cbc975fd5c8 100644
> > --- a/tools/testing/selftests/bpf/config
> > +++ b/tools/testing/selftests/bpf/config
> > @@ -76,3 +76,4 @@ CONFIG_USERFAULTFD=y
> >  CONFIG_VXLAN=y
> >  CONFIG_XDP_SOCKETS=y
> >  CONFIG_XFRM_INTERFACE=y
> > +CONFIG_FUNCTION_ERROR_INJECTION=y
> > \ No newline at end of file
>
> Thanks for the fix! I believe we try to keep the file sorted (although I do see
> one violation) to make it easy to diff against arch specific configs but also to
> minimize the risk of merge conflicts (more likely if everybody appends). Would
> you mind sorting the addition in?
>
> Looks good to me otherwise.
>
> Acked-by: Daniel Müller <deso@posteo.net>

I've fixed up the patch (order, added Fixes: tag, etc) locally. But
I'm waiting for CI to confirm. Song, no need to resubmit this, but
please add a custom patch to BPF CI, so that this applies to both bpf
and bpf-next trees. Thanks!
patchwork-bot+netdevbpf@kernel.org Dec. 13, 2022, 11:50 p.m. UTC | #3
Hello:

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

On Tue, 13 Dec 2022 14:05:00 -0800 you wrote:
> BPF selftests require CONFIG_FUNCTION_ERROR_INJECTION to work. However,
> CONFIG_FUNCTION_ERROR_INJECTION is no longer 'y' by default after [1].
> As a result, we are seeing errors like the following from BPF CI:
> 
>    bpf_testmod_test_read() is not modifiable
>    __x64_sys_setdomainname is not sleepable
>    __x64_sys_getpgid is not sleepable
> 
> [...]

Here is the summary with links:
  - [bpf-next] selftests/bpf: select CONFIG_FUNCTION_ERROR_INJECTION
    https://git.kernel.org/bpf/bpf-next/c/e561fc8365da

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
index 612f699dc4f7..5cbc975fd5c8 100644
--- a/tools/testing/selftests/bpf/config
+++ b/tools/testing/selftests/bpf/config
@@ -76,3 +76,4 @@  CONFIG_USERFAULTFD=y
 CONFIG_VXLAN=y
 CONFIG_XDP_SOCKETS=y
 CONFIG_XFRM_INTERFACE=y
+CONFIG_FUNCTION_ERROR_INJECTION=y
\ No newline at end of file