Main difference between ebpf loaders

478 Views Asked by At

If I understood well there are different ebpf loaders:

  • bpf_load.c into the kernel source code
  • libbpf
  • bpftool
  • tc
  • ... <-- others?

Which are the main differences between them? Are they always interchangeably? Should I always prefer libbpf?

1

There are 1 best solutions below

3
On BEST ANSWER

In their last versions, bpftool, bcc, and bpf_load.c use libbpf. iproute2, and therefore tc, uses its own wrappers for BPF syscalls.

There likely are differences in APIs between libbpf and iproute2's own wrapper. You should prefer libbpf as it's becoming the standard (I think the plan it to use it in iproute2 as well).