rustix icon indicating copy to clipboard operation
rustix copied to clipboard

XDP requires null passing to sendto and recvfrom

Open timwoocker opened this issue 5 months ago • 0 comments

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.

timwoocker avatar Oct 09 '25 11:10 timwoocker