diff options
author | Daniel T. Lee <danieltimlee@gmail.com> | 2020-05-16 13:06:06 +0900 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-05-19 17:12:56 +0200 |
commit | bc1a85977b950407d67cd1e5b74f261a4bee3284 (patch) | |
tree | e4c5283ae3815b08fe2a09a34576a7ebf7931ecf /samples/bpf/tcp_clamp_kern.c | |
parent | 63841bc0833623ecd4f758ec055b543cf1bc56ba (diff) | |
download | linux-bc1a85977b950407d67cd1e5b74f261a4bee3284.tar.gz linux-bc1a85977b950407d67cd1e5b74f261a4bee3284.tar.bz2 linux-bc1a85977b950407d67cd1e5b74f261a4bee3284.zip |
samples, bpf: Refactor tail call user progs with libbpf
BPF tail call uses the BPF_MAP_TYPE_PROG_ARRAY type map for calling
into other BPF programs and this PROG_ARRAY should be filled prior to
use. Currently, samples with the PROG_ARRAY type MAP fill this program
array with bpf_load. For bpf_load to fill this map, kernel BPF program
must specify the section with specific format of <prog_type>/<array_idx>
(e.g. SEC("socket/0"))
But by using libbpf instead of bpf_load, user program can specify which
programs should be added to PROG_ARRAY. The advantage of this approach
is that you can selectively add only the programs you want, rather than
adding all of them to PROG_ARRAY, and it's much more intuitive than the
traditional approach.
This commit refactors user programs with the PROG_ARRAY type MAP with
libbpf instead of using bpf_load.
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200516040608.1377876-4-danieltimlee@gmail.com
Diffstat (limited to 'samples/bpf/tcp_clamp_kern.c')
0 files changed, 0 insertions, 0 deletions