bytecodealliance / bytecodealliance/rustix
XDP requires null passing to sendto and recvfrom
Open
enhancement
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 294
- Avg merge
- 4h 7m
- Merged PRs (30d)
- 2
Description
When using XDP with `XDP_USE_NEED_WAKEUP`, the kernel needs to be woken up by calling either `sendto` or `recvfrom` depending on the ring using the fd.
According to the docs (https://docs.ebpf.io/linux/concepts/af_xdp/#xdp_use_need_wakeup), since the buffers are handled separately in the rings and not actually passed to sendto/recvfrom, you need to pass null for the buffers as well as the socket addresses.
I guess for the buffers we could pass an empty slice to rustix (which still wouldn't be optimal) - but the sockaddr can't be passed as null under any circumstances right now.
Contributor guide
Assessment
This issue has not been assessed yet.