Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BPF helper functions not working with XDP offloading #73

Open
sshetty78 opened this issue Apr 19, 2022 · 5 comments
Open

BPF helper functions not working with XDP offloading #73

sshetty78 opened this issue Apr 19, 2022 · 5 comments

Comments

@sshetty78
Copy link

I am currently trying to implement XDP programs using some of the basic bpf helper functions. But basic bpf helper functions such as bpf_ktime_get_ns,
bpf_trace_printk are erroring out with error - "unsupported function".

I have attached the error screenshots, along with the NIC info. Linux version that I am using supports these bpf helper functions according to the ebpf guide found on the website.

Linux version - Linux charybdis 5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

What could be the reason for this issue? Are there any additional libraries that I am missing? Functions like bpf_map_lookup and bpf_get_prandom32 is working well

https://paste.pics/5f95e51e0bb0cb04f419c9b3af6c1150
https://paste.pics/27f2143bfe97c4f22eb9fdd3c8272778

@tohojo
Copy link
Member

tohojo commented Apr 19, 2022 via email

@sshetty78
Copy link
Author

Thanks for the clarification. Does this mean it should work on XDP-generic?

@tohojo
Copy link
Member

tohojo commented Apr 20, 2022 via email

@sshetty78
Copy link
Author

I am unable to use these functions even in XDP_FLAGS_SKB_MODE mode. I am seeing the same error even when I load XDP program using XDP_FLAGS_SKB_MODE flag. Is there anything else in the framework that could be causing the functions to be unsupported?

@tohojo
Copy link
Member

tohojo commented Apr 27, 2022

Both of those should definitely work in generic mode. Are you by any chance still setting the prog_ifindex field when loading the program? That will cause the verifier to treat the program as though it's about to be offloaded, regardless of the mode you set (you don't actually specify SKB_MODE when loading the program, only when attaching).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants