-
Notifications
You must be signed in to change notification settings - Fork 35
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
Comments
sshetty78 ***@***.***> writes:
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
Offloaded XDP is limited to the helper functions supported by the NIC.
Which is not a lot of them; in particular, anything relying on kernel
infrastructure (such as printk, which uses the trace pipe, and
ktime_get_ns which uses the internal kernel clock) won't work...
|
Thanks for the clarification. Does this mean it should work on XDP-generic? |
sshetty78 ***@***.***> writes:
Thanks for the clarification. Does this mean it should work on
XDP-generic?
Yes, and even in XDP driver mode (on drivers that support it). I
generally wouldn't recommend using XDP generic mode; you'll miss out of
a lot of the performance benefit of XDP, but won't gain the benefits of
having an skb. So the TC hook is most likely a better fit if all you're
using is XDP generic.
However, if you have a mixed environment where some drivers support
driver mode and some don't, XDP generic can be useful to allow you to
run the same programs on all interfaces.
|
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? |
Both of those should definitely work in generic mode. Are you by any chance still setting the |
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
The text was updated successfully, but these errors were encountered: