selftests/bpf: Use value with enough-size when updating per-cpu map
authorHou Tao <houtao1@huawei.com>
Wed, 1 Nov 2023 03:24:53 +0000 (11:24 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 10 Nov 2023 02:58:40 +0000 (18:58 -0800)
commitd79924ca579c647d5dc55f605899c98f7ea04d0f
treecebfdf98a2a67fd0a9dc9150db3e723e0c8dfa70
parentcd9c127069c040d6b022f1ff32fed4b52b9a4017
selftests/bpf: Use value with enough-size when updating per-cpu map

When updating per-cpu map in map_percpu_stats test, patch_map_thread()
only passes 4-bytes-sized value to bpf_map_update_elem(). The expected
size of the value is 8 * num_possible_cpus(), so fix it by passing a
value with enough-size for per-cpu map update.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231101032455.3808547-2-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/map_tests/map_percpu_stats.c