selftests/bpf: get trusted cgrp from bpf_iter__cgroup directly
authorChuyi Zhou <zhouchuyi@bytedance.com>
Tue, 7 Nov 2023 13:22:04 +0000 (21:22 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Tue, 7 Nov 2023 23:28:06 +0000 (15:28 -0800)
commit3c5864ba9cf912ff9809f315d28f296f21563cce
tree3de609f4f0ac0e64b1684ce0007776d92833b703
parent0de4f50de25af79c2a46db55d70cdbd8f985c6d1
selftests/bpf: get trusted cgrp from bpf_iter__cgroup directly

Commit f49843afde (selftests/bpf: Add tests for css_task iter combining
with cgroup iter) added a test which demonstrates how css_task iter can be
combined with cgroup iter. That test used bpf_cgroup_from_id() to convert
bpf_iter__cgroup->cgroup to a trusted ptr which is pointless now, since
with the previous fix, we can get a trusted cgroup directly from
bpf_iter__cgroup.

Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231107132204.912120-3-zhouchuyi@bytedance.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/progs/iters_css_task.c