On 2017/9/25 17:25, Jesper Dangaard Brouer wrote:
On Sun, 24 Sep 2017 20:07:11 +0200 Eric Leblond <eric@xxxxxxxxx> wrote:Hello, bpf_load is implementing the set_link_xdp_fd() function and it seems this function is not available in libbpf.I also ran into this problem, when I wanted to switch my XDP programs into using tools/lib/bpf/. E.g.: https://github.com/netoptimizer/prototype-kernel/commit/5397e596c30416763Should it be the case or should it be part of another library ?I'm not sure... maybe Alexei, Daniel or Wang have an opinion?
tools/lib/bpf is aiming at provide a better way to parse bpf object file, load bpf program and maps. It doesn't operate link layer. set_link_xdp_fd() and other socket and link related functions are better to be implement separately. Two choices: 1. Move them into a library in samples/bpf. 2. make libbpf support XDP. The second choice looks good, but I'm not familiar with XDP API and don't know how to give a good abstraction. In my opinion it should be part of another library. Thank you.