aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_global_data.c
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen <toke@redhat.com>2020-03-29 15:22:53 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2020-03-30 01:17:35 +0200
commite5fb60ee4c958b92686830ecfaf5e60bbd139130 (patch)
treed347b0b3979feee72d5b4a87edd55fb03a1fc0e8 /tools/testing/selftests/bpf/progs/test_global_data.c
parentlibbpf: Add setter for initial value for internal maps (diff)
downloadlinux-e5fb60ee4c958b92686830ecfaf5e60bbd139130.tar.gz
linux-e5fb60ee4c958b92686830ecfaf5e60bbd139130.zip
selftests: Add test for overriding global data value before load
This adds a test to exercise the new bpf_map__set_initial_value() function. The test simply overrides the global data section with all zeroes, and checks that the new value makes it into the kernel map on load. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/20200329132253.232541-2-toke@redhat.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_global_data.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_global_data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_global_data.c b/tools/testing/selftests/bpf/progs/test_global_data.c
index dd7a4d3dbc0d..1319be1c54ba 100644
--- a/tools/testing/selftests/bpf/progs/test_global_data.c
+++ b/tools/testing/selftests/bpf/progs/test_global_data.c
@@ -68,7 +68,7 @@ static struct foo struct3 = {
bpf_map_update_elem(&result_##map, &key, var, 0); \
} while (0)
-SEC("static_data_load")
+SEC("classifier/static_data_load")
int load_static_data(struct __sk_buff *skb)
{
static const __u64 bar = ~0;