On Fri, 9 Jan 2026 17:54:32 +0100
Laurent Vivier
Currently, each protocol handler (TCP, TCP splice, ICMP/ping, UDP) has its own code to add or modify file descriptors in epoll. This leads to duplicated boilerplate across icmp.c, tcp.c, tcp_splice.c, and udp_flow.c, with each setting up epoll_ref unions and calling epoll_ctl() with flow-type-specific details.
This series introduces flow_epoll_set() in flow.c to handle epoll operations for all flow types in a unified way. The function derives the epoll type from the flow type via a mapping array, providing a simpler interface where the caller only needs to pass the flow, command, events, file descriptor, and side index.
The API is:
int flow_epoll_set(const struct flow_common *f, int command, uint32_t events, int fd, unsigned int sidei);
This centralized approach will be essential for queue pair migration in the upcoming multithreading work, where flows need to be moved between different epoll instances owned by different threads.
Applied. -- Stefano