Re: [PATCH bpf-next v2 1/3] samples: bpf: Refactor xdp_monitor with libbpf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 10, 2020 at 11:17 AM Daniel T. Lee <danieltimlee@xxxxxxxxx> wrote:
>
> To avoid confusion caused by the increasing fragmentation of the BPF
> Loader program, this commit would like to change to the libbpf loader
> instead of using the bpf_load.
>
> 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.
>
> This commit refactors xdp_monitor with using this libbpf API, and the
> bpf_load is removed and migrated to libbpf.
>
> Signed-off-by: Daniel T. Lee <danieltimlee@xxxxxxxxx>
>
> ---

Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx>

> Changes in v2:
>  - added cleanup logic for bpf_link and bpf_object
>  - split increment into seperate satement
>  - refactor pointer array initialization
>
>  samples/bpf/Makefile           |   2 +-
>  samples/bpf/xdp_monitor_user.c | 159 +++++++++++++++++++++++++--------
>  2 files changed, 121 insertions(+), 40 deletions(-)
>

[...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux