summaryrefslogtreecommitdiffstats
path: root/samples/bpf/xdp_rxq_info_kern.c
diff options
context:
space:
mode:
authorDaniel T. Lee <danieltimlee@gmail.com>2020-11-24 10:03:05 +0100
committerAndrii Nakryiko <andrii@kernel.org>2020-11-27 04:33:35 +0100
commitd89af13c92056c46dfc4bcb3d90efe88937c3381 (patch)
treec4563673da85cde8dde280a53c94fae4591c8fde /samples/bpf/xdp_rxq_info_kern.c
parentsamples: bpf: Refactor hbm program with libbpf (diff)
downloadlinux-d89af13c92056c46dfc4bcb3d90efe88937c3381.tar.xz
linux-d89af13c92056c46dfc4bcb3d90efe88937c3381.zip
samples: bpf: Refactor test_cgrp2_sock2 program with libbpf
This commit refactors the existing cgroup program with libbpf bpf loader. The original test_cgrp2_sock2 has keeped the bpf program attached to the cgroup hierarchy even after the exit of user program. To implement the same functionality with libbpf, this commit uses the BPF_LINK_PINNING to pin the link attachment even after it is closed. Since this uses LINK instead of ATTACH, detach of bpf program from cgroup with 'test_cgrp2_sock' is not used anymore. The code to mount the bpf was added to the .sh file in case the bpff was not mounted on /sys/fs/bpf. Additionally, to fix the problem that shell script cannot find the binary object from the current path, relative path './' has been added in front of binary. Fixes: 554ae6e792ef3 ("samples/bpf: add userspace example for prohibiting sockets") Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20201124090310.24374-3-danieltimlee@gmail.com
Diffstat (limited to 'samples/bpf/xdp_rxq_info_kern.c')
0 files changed, 0 insertions, 0 deletions