]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
test_bpf: Rename second ALU64_SMOD_X to ALU64_SMOD_K
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 7 Dec 2023 04:08:51 +0000 (12:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:44:50 +0000 (15:44 -0800)
[ Upstream commit 5181dc08f79583c6dead80208137a97e68ff07b0 ]

Currently, there are two test cases with same name
"ALU64_SMOD_X: -7 % 2 = -1", the first one is right,
the second one should be ALU64_SMOD_K because its
code is BPF_ALU64 | BPF_MOD | BPF_K.

Before:
test_bpf: #170 ALU64_SMOD_X: -7 % 2 = -1 jited:1 4 PASS
test_bpf: #171 ALU64_SMOD_X: -7 % 2 = -1 jited:1 4 PASS

After:
test_bpf: #170 ALU64_SMOD_X: -7 % 2 = -1 jited:1 4 PASS
test_bpf: #171 ALU64_SMOD_K: -7 % 2 = -1 jited:1 4 PASS

Fixes: daabb2b098e0 ("bpf/tests: add tests for cpuv4 instructions")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231207040851.19730-1-yangtiezhu@loongson.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
lib/test_bpf.c

index 7916503e6a6ab922bc9b3f10f408e029f3d2cc01..3c5a1ca0621907445f8c7fef652edd67e811edb8 100644 (file)
@@ -6293,7 +6293,7 @@ static struct bpf_test tests[] = {
        },
        /* BPF_ALU64 | BPF_MOD | BPF_K off=1 (SMOD64) */
        {
-               "ALU64_SMOD_X: -7 % 2 = -1",
+               "ALU64_SMOD_K: -7 % 2 = -1",
                .u.insns_int = {
                        BPF_LD_IMM64(R0, -7),
                        BPF_ALU64_IMM_OFF(BPF_MOD, R0, 2, 1),