-
Notifications
You must be signed in to change notification settings - Fork 4
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
will xxh64 work in ebpf? #8
Comments
xxHash is portable with the basic C90+long long ISA, so it will always work. However, whether it is performant is a different story. eBPF seems to have a lack of unaligned access so there may be a significant overhead on unaligned loads. All xxHash functions will work fine, but XXH3 will run rather inefficiently since there is no aligned path (and a lack of SIMD). XXH32 and XXH64 will run at full speed if the pointer is sufficiently aligned though. |
I take that back, Clang eBPF doesn't support struct returns. Therefore XXH3 will not work, but XXH32 and XXH64 should compile with @Cyan4973 perhaps should we try to work on this? Perhaps having |
Update: Clang supports returning structs with extern void XXH3_128bits_noStructReturn(XXH128_hash_t *XXH_RESTRICT output, const void *XXH_RESTRICT ptr, size_t n);
__attribute__((always_inline, unused))
static __inline__ XXH128_hash_t XXH3_128bits(const void *ptr, size_t n)
{
XXH128_hash_t ret;
XXH3_128bits_noStructReturn(&ret, ptr, n);
return ret;
} |
it was at this moment I realized this was my own repo. I'm dumb. XXH64 will definitely work, but I would recommend using Cyan4973/xxHash as that has a lot of low level optimizations. |
@easyaspi314 thx for the prompt feedback trying to make sure ebpf will be portable. so not very sure if you can confirm this. thx do hope u can come up with an ebpf compatible one. performance-wise is secondary. just need it working in ebpf |
@easyaspi314 do you know if there's a version of yours that's available in ebpf, a lot of people will use it? waiting for your feedback! p.s. : i have working cityhash using ebpf but it's extremely exciting if one of the xxhash line is available for use in ebpf. |
great work!
will xxh64 work in ebpf?
otherwise, which version will work 100% in ebpf?
The text was updated successfully, but these errors were encountered: