On Thu, Oct 16, 2025 at 11:31:28PM +0200, Stefano Brivio wrote:
On Thu, 9 Oct 2025 15:04:05 +0200 Laurent Vivier
wrote: [snip] + union { + uint32_t flow; + flow_sidx_t flowside; + union tcp_listen_epoll_ref tcp_listen; + union udp_listen_epoll_ref udp; + uint32_t data; + int nsdir_fd; + int queue; + }; + }; + uint64_t u64; +}; +static_assert(sizeof(union epoll_ref) <= sizeof(union epoll_data), + "epoll_ref must have same size as epoll_data");
Either the comment is misleading, or it should be sizeof(...) != ...
I believe <= is correct, but the comment is misleading. What we care about here is that our custom structure/union fits in space available in the epoll_event structure. In practice it will have equal size, but <= is what we care about.
The rest of the patch looks good to me, I didn't finish reviewing the series though.
-- Stefano
-- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson