xdp-project / xdp-tools

Utilities and example programs for use with XDP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loading of XDP program fails with `prog 'xdp_prog1': missing BPF prog type, check ELF section name 'xdp-prog1'`

Simonacb opened this issue · comments

I need to load 2 prog in my xdp program and here is my defintion:

SEC("xdp-prog1") 
int xdp_prog1(struct xdp_md *ctx) {
    ...
    return XDP_PASS;
}
SEC("xdp-prog2")
int xdp_prog2(struct xdp_md *ctx) {
    ...
    return XDP_PASS;
}

and the error log is here:

libbpf: prog 'xdp_prog1': missing BPF prog type, check ELF section name 'xdp-prog1'
libbpf: prog 'xdp_prog1': failed to load: -22

and I'm using the latest libxdp.
How can I fixed the problem? Thanks!