diff options
author | Alexei Starovoitov <ast@kernel.org> | 2020-10-11 12:14:36 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-10-11 12:14:43 -0700 |
commit | 52b07e56af6414a1623901e18bf6a217ec33c11f (patch) | |
tree | 97287b42afa877971bfa2c065438a47c9b369170 /net/nsh | |
parent | 673e3752456180de804cf4f43de26ef1d6b90a1b (diff) | |
parent | 321f6324500eb2ec75b6fcff7dcd66d64ba18529 (diff) |
Merge branch 'samples: bpf: Refactor XDP programs with libbpf'
"Daniel T. Lee" says:
====================
To avoid confusion caused by the increasing fragmentation of the BPF
Loader program, this commit would like to convert the previous bpf_load
loader with the libbpf loader.
Thanks to libbpf's bpf_link interface, managing the tracepoint BPF
program is much easier. bpf_program__attach_tracepoint manages the
enable of tracepoint event and attach of BPF programs to it with a
single interface bpf_link, so there is no need to manage event_fd and
prog_fd separately.
And due to addition of generic bpf_program__attach() to libbpf, it is
now possible to attach BPF programs with __attach() instead of
explicitly calling __attach_<type>().
This patchset refactors xdp_monitor with using this libbpf API, and the
bpf_load is removed and migrated to libbpf. Also, attach_tracepoint()
is replaced with the generic __attach() method in xdp_redirect_cpu.
Moreover, maps in kern program have been converted to BTF-defined map.
---
Changes in v2:
- added cleanup logic for bpf_link and bpf_object in xdp_monitor
- program section match with bpf_program__is_<type> instead of strncmp
- revert BTF key/val type to default of BPF_MAP_TYPE_PERF_EVENT_ARRAY
- split increment into seperate satement
- refactor pointer array initialization
- error code cleanup
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/nsh')
0 files changed, 0 insertions, 0 deletions