summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/test_maps.c
diff options
context:
space:
mode:
authorYiFei Zhu <zhuyifei@google.com>2020-07-23 23:47:41 -0500
committerAlexei Starovoitov <ast@kernel.org>2020-07-25 20:16:35 -0700
commitd4a89c1eb81431479664029bcdec593dbf23385f (patch)
tree1e46a4faa110564e441aca6bc98a6ecb75125644 /tools/testing/selftests/bpf/test_maps.c
parent90065c0647efd6e2ec8983a702c4ba813af51b93 (diff)
downloadlinux-d4a89c1eb81431479664029bcdec593dbf23385f.tar.gz
linux-d4a89c1eb81431479664029bcdec593dbf23385f.tar.bz2
linux-d4a89c1eb81431479664029bcdec593dbf23385f.zip
selftests/bpf: Add test for CGROUP_STORAGE map on multiple attaches
This test creates a parent cgroup, and a child of that cgroup. It attaches a cgroup_skb/egress program that simply counts packets, to a global variable (ARRAY map), and to a CGROUP_STORAGE map. The program is first attached to the parent cgroup only, then to parent and child. The test cases sends a message within the child cgroup, and because the program is inherited across parent / child cgroups, it will trigger the egress program for both the parent and child, if they exist. The program, when looking up a CGROUP_STORAGE map, uses the cgroup and attach type of the attachment parameters; therefore, both attaches uses different cgroup storages. We assert that all packet counts returns what we expects. Signed-off-by: YiFei Zhu <zhuyifei@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/5a20206afa4606144691c7caa0d1b997cd60dec0.1595565795.git.zhuyifei@google.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_maps.c')
0 files changed, 0 insertions, 0 deletions