Search code examples
linux-kernelbpfebpf

ebpf program loading error: unknown func bpf_l4_csum_replace#11


I am testing a nat program using ebpf. But the ebpf prog loader throws a error message:

221: (85) call bpf_l4_csum_replace#11
unknown func bpf_l4_csum_replace#11  

What does it mean ? How to solve it ? Thanks.


Solution

  • A similar message could mean that your kernel does not know the BPF helper you are trying to use, because e.g. your kernel is too old or the helper has been compiled out based on the kernel configuration options. But in those cases, you would not see the name of the function in the verifier logs.

    What is probably happening here is that your kernel does support the BPF helper, but the type of the BPF program you are trying to load is not compatible with that helper. For example, if your program is of type socket_filter, you cannot use this helper (see function sk_filter_func_proto() used for the check). If your program was a TC classifier instead, you would be able to use it.