-
Notifications
You must be signed in to change notification settings - Fork 129
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
uBPF should support > 64 helper_id #66
Comments
Might be nice if we can set this via |
I was leaning towards a callout. Something like:
The consumer of this library can then control the resolution of helper_id -> address of helper function. |
Isn't that just a more complicated form of Line 85 in c7c019c
|
Fair enough. We would then need some form of sparse storage for the helper-id -> address mapping. The issue is that we might need to store: For an EBPF_PROGRAM_TYPE_XDP
Or for EBPF_PROGRAM_TYPE_BIND
Note: These are currently made up examples (we haven't added anything like this yet). The current storage assumes helper_id is the position in the array, which won't work well with disjointed helper-id space. We can either have the complexity of storing the mapping in ubpf or in the caller. In my case the caller needs to store it anyway, so duplicating it in ubpf doesn't make sense for my scenario, but if you think it is something that would be more generally usable, I am happy to add it. |
I think I'm in favor of having an optional callback to do this mapping at runtime/JIT time. I still think |
Doing this at JIT time is redundant. We can perform the translation on the byte code prior to JIT / interpret and update the eBPF byte code. So, the only limitation then is if there are > 64 unique helper functions being called by the eBPF program, which seems unlikely. |
ubpf/vm/ubpf_vm.c
Line 27 in 6492b7a
The ebpf-for-windows uses a disjointed helper-id space, allowing for both global helper functions and program type specific helper functions, with the following mapping:
0x1-0xFFFF - Global helper functions usable by any program type
0x1000 - 0x1FFF - Program type specific helper functions
The text was updated successfully, but these errors were encountered: