Skip to contentSkip to conversation

selftests/bpf: select CONFIG_FUNCTION_ERROR_INJECTION

PATCH Applied Song Liu 4 participants 4 messages Dec 13, 2022

Subsystems (3)
lore
Share & tools
lore

Song Liu

author reviewer
#0 lore raw

PATCH 1/1 selftests/bpf: select CONFIG_FUNCTION_ERROR_INJECTION

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")

---
 tools/testing/selftests/bpf/config | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/config +1 -0
index 612f699dc4f7..5cbc975fd5c8 100644
@@ -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
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
Quoted 23 lines · Song Liu

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")

---
 tools/testing/selftests/bpf/config | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/config +0 -0
index 612f699dc4f7..5cbc975fd5c8 100644

tools/testing/selftests/bpf/config CONFIG_USERFAULTFD=y · line 79

Quoted 5 lines
tools/testing/selftests/bpf/config +1 -0
@@ -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.

#2 lore raw
Quoted 36 lines · Daniel Müller
Quoted 23 lines · Song Liu

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")

---
 tools/testing/selftests/bpf/config | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/config +0 -0
index 612f699dc4f7..5cbc975fd5c8 100644

tools/testing/selftests/bpf/config CONFIG_USERFAULTFD=y · line 79

Quoted 5 lines
tools/testing/selftests/bpf/config +1 -0
@@ -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?

Quoted 3 lines

Looks good to me otherwise.

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!

#3 lore raw
In reply to Song Liu
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Quoted 9 lines · 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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html