Commit b066abb
bpf, tests: Add module parameter test_suite to test_bpf module
After commit 9298e63 ("bpf/tests: Add exhaustive tests of ALU
operand magnitudes"), when modprobe test_bpf.ko with JIT on mips64,
there exists segment fault due to the following reason:
[...]
ALU64_MOV_X: all register value magnitudes jited:1
Break instruction in kernel code[Rust-for-Linux#1]
[...]
It seems that the related JIT implementations of some test cases
in test_bpf() have problems. At this moment, I do not care about
the segment fault while I just want to verify the test cases of
tail calls.
Based on the above background and motivation, add the following
module parameter test_suite to the test_bpf.ko:
test_suite=<string>: only the specified test suite will be run, the
string can be "test_bpf", "test_tail_calls" or "test_skb_segment".
If test_suite is not specified, but test_id, test_name or test_range
is specified, set 'test_bpf' as the default test suite. This is useful
to only test the corresponding test suite when specifying the valid
test_suite string.
Any invalid test suite will result in -EINVAL being returned and no
tests being run. If the test_suite is not specified or specified as
empty string, it does not change the current logic, all of the test
cases will be run.
Here are some test results:
# dmesg -c
# modprobe test_bpf
# dmesg | grep Summary
test_bpf: Summary: 1009 PASSED, 0 FAILED, [0/997 JIT'ed]
test_bpf: test_tail_calls: Summary: 8 PASSED, 0 FAILED, [0/8 JIT'ed]
test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED
# rmmod test_bpf
# dmesg -c
# modprobe test_bpf test_suite=test_bpf
# dmesg | tail -1
test_bpf: Summary: 1009 PASSED, 0 FAILED, [0/997 JIT'ed]
# rmmod test_bpf
# dmesg -c
# modprobe test_bpf test_suite=test_tail_calls
# dmesg
test_bpf: #0 Tail call leaf jited:0 21 PASS
[...]
test_bpf: Rust-for-Linux#7 Tail call error path, index out of range jited:0 32 PASS
test_bpf: test_tail_calls: Summary: 8 PASSED, 0 FAILED, [0/8 JIT'ed]
# rmmod test_bpf
# dmesg -c
# modprobe test_bpf test_suite=test_skb_segment
# dmesg
test_bpf: #0 gso_with_rx_frags PASS
test_bpf: Rust-for-Linux#1 gso_linear_no_head_frag PASS
test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED
# rmmod test_bpf
# dmesg -c
# modprobe test_bpf test_id=1
# dmesg
test_bpf: test_bpf: set 'test_bpf' as the default test_suite.
test_bpf: Rust-for-Linux#1 TXA jited:0 54 51 50 PASS
test_bpf: Summary: 1 PASSED, 0 FAILED, [0/1 JIT'ed]
# rmmod test_bpf
# dmesg -c
# modprobe test_bpf test_suite=test_bpf test_name=TXA
# dmesg
test_bpf: Rust-for-Linux#1 TXA jited:0 54 50 51 PASS
test_bpf: Summary: 1 PASSED, 0 FAILED, [0/1 JIT'ed]
# rmmod test_bpf
# dmesg -c
# modprobe test_bpf test_suite=test_tail_calls test_range=6,7
# dmesg
test_bpf: Rust-for-Linux#6 Tail call error path, NULL target jited:0 41 PASS
test_bpf: Rust-for-Linux#7 Tail call error path, index out of range jited:0 32 PASS
test_bpf: test_tail_calls: Summary: 2 PASSED, 0 FAILED, [0/2 JIT'ed]
# rmmod test_bpf
# dmesg -c
# modprobe test_bpf test_suite=test_skb_segment test_id=1
# dmesg
test_bpf: Rust-for-Linux#1 gso_linear_no_head_frag PASS
test_bpf: test_skb_segment: Summary: 1 PASSED, 0 FAILED
By the way, the above segment fault has been fixed in the latest bpf-next
tree which contains the mips64 JIT rework.
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Acked-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Link: https://lore.kernel.org/bpf/1635384321-28128-1-git-send-email-yangtiezhu@loongson.cn1 parent 252c765 commit b066abb
1 file changed
Lines changed: 135 additions & 77 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14316 | 14316 | | |
14317 | 14317 | | |
14318 | 14318 | | |
14319 | | - | |
| 14319 | + | |
14320 | 14320 | | |
14321 | 14321 | | |
14322 | | - | |
14323 | | - | |
14324 | | - | |
14325 | | - | |
14326 | | - | |
14327 | | - | |
14328 | | - | |
14329 | | - | |
14330 | | - | |
14331 | | - | |
14332 | | - | |
14333 | | - | |
14334 | | - | |
14335 | | - | |
14336 | | - | |
14337 | | - | |
14338 | | - | |
14339 | | - | |
14340 | | - | |
14341 | | - | |
14342 | | - | |
14343 | | - | |
14344 | | - | |
14345 | | - | |
14346 | | - | |
14347 | | - | |
14348 | | - | |
14349 | | - | |
14350 | | - | |
14351 | | - | |
14352 | | - | |
14353 | | - | |
14354 | | - | |
14355 | | - | |
14356 | | - | |
14357 | | - | |
14358 | | - | |
14359 | | - | |
14360 | | - | |
14361 | | - | |
14362 | | - | |
14363 | | - | |
14364 | | - | |
14365 | | - | |
14366 | | - | |
14367 | | - | |
14368 | | - | |
14369 | | - | |
14370 | | - | |
14371 | | - | |
14372 | | - | |
14373 | | - | |
14374 | | - | |
14375 | | - | |
14376 | | - | |
14377 | | - | |
14378 | | - | |
14379 | | - | |
14380 | | - | |
14381 | | - | |
14382 | | - | |
14383 | | - | |
14384 | | - | |
14385 | 14322 | | |
14386 | 14323 | | |
14387 | 14324 | | |
| |||
14553 | 14490 | | |
14554 | 14491 | | |
14555 | 14492 | | |
| 14493 | + | |
| 14494 | + | |
| 14495 | + | |
| 14496 | + | |
14556 | 14497 | | |
14557 | 14498 | | |
14558 | 14499 | | |
| |||
14934 | 14875 | | |
14935 | 14876 | | |
14936 | 14877 | | |
| 14878 | + | |
| 14879 | + | |
14937 | 14880 | | |
14938 | 14881 | | |
14939 | 14882 | | |
| |||
14966 | 14909 | | |
14967 | 14910 | | |
14968 | 14911 | | |
| 14912 | + | |
| 14913 | + | |
| 14914 | + | |
| 14915 | + | |
| 14916 | + | |
| 14917 | + | |
| 14918 | + | |
| 14919 | + | |
| 14920 | + | |
| 14921 | + | |
| 14922 | + | |
| 14923 | + | |
| 14924 | + | |
| 14925 | + | |
| 14926 | + | |
| 14927 | + | |
| 14928 | + | |
| 14929 | + | |
| 14930 | + | |
| 14931 | + | |
| 14932 | + | |
| 14933 | + | |
| 14934 | + | |
| 14935 | + | |
| 14936 | + | |
| 14937 | + | |
| 14938 | + | |
| 14939 | + | |
| 14940 | + | |
| 14941 | + | |
| 14942 | + | |
| 14943 | + | |
| 14944 | + | |
| 14945 | + | |
| 14946 | + | |
| 14947 | + | |
| 14948 | + | |
| 14949 | + | |
| 14950 | + | |
| 14951 | + | |
| 14952 | + | |
| 14953 | + | |
| 14954 | + | |
| 14955 | + | |
| 14956 | + | |
| 14957 | + | |
| 14958 | + | |
| 14959 | + | |
| 14960 | + | |
| 14961 | + | |
| 14962 | + | |
| 14963 | + | |
| 14964 | + | |
| 14965 | + | |
| 14966 | + | |
| 14967 | + | |
| 14968 | + | |
| 14969 | + | |
| 14970 | + | |
| 14971 | + | |
| 14972 | + | |
| 14973 | + | |
| 14974 | + | |
| 14975 | + | |
| 14976 | + | |
| 14977 | + | |
| 14978 | + | |
| 14979 | + | |
| 14980 | + | |
| 14981 | + | |
| 14982 | + | |
| 14983 | + | |
| 14984 | + | |
| 14985 | + | |
| 14986 | + | |
| 14987 | + | |
| 14988 | + | |
| 14989 | + | |
| 14990 | + | |
| 14991 | + | |
| 14992 | + | |
| 14993 | + | |
| 14994 | + | |
| 14995 | + | |
| 14996 | + | |
| 14997 | + | |
| 14998 | + | |
| 14999 | + | |
| 15000 | + | |
| 15001 | + | |
14969 | 15002 | | |
14970 | 15003 | | |
14971 | 15004 | | |
14972 | 15005 | | |
14973 | 15006 | | |
14974 | | - | |
| 15007 | + | |
| 15008 | + | |
| 15009 | + | |
| 15010 | + | |
| 15011 | + | |
| 15012 | + | |
| 15013 | + | |
| 15014 | + | |
| 15015 | + | |
| 15016 | + | |
| 15017 | + | |
| 15018 | + | |
| 15019 | + | |
| 15020 | + | |
| 15021 | + | |
| 15022 | + | |
| 15023 | + | |
| 15024 | + | |
| 15025 | + | |
| 15026 | + | |
14975 | 15027 | | |
14976 | 15028 | | |
14977 | 15029 | | |
14978 | | - | |
14979 | | - | |
14980 | | - | |
14981 | | - | |
| 15030 | + | |
| 15031 | + | |
| 15032 | + | |
| 15033 | + | |
| 15034 | + | |
14982 | 15035 | | |
14983 | | - | |
14984 | | - | |
14985 | | - | |
14986 | | - | |
14987 | | - | |
14988 | | - | |
14989 | | - | |
| 15036 | + | |
| 15037 | + | |
| 15038 | + | |
| 15039 | + | |
| 15040 | + | |
| 15041 | + | |
| 15042 | + | |
| 15043 | + | |
| 15044 | + | |
14990 | 15045 | | |
14991 | | - | |
| 15046 | + | |
| 15047 | + | |
| 15048 | + | |
| 15049 | + | |
14992 | 15050 | | |
14993 | 15051 | | |
14994 | 15052 | | |
| |||
0 commit comments