From e6f81e55788bc6ede5e98a83820263e394455ba9 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 11 Aug 2023 15:12:26 +1000 Subject: epoll: Split handling of TCP timerfds into its own handler function tcp_sock_handler() actually handles several different types of fd events. This includes timerfds that aren't sockets at all. The handling of these has essentially nothing in common with the other cases. So, give the TCP timers there own epoll_type value and dispatch directly to their handler. This also means we can remove the timer field from tcp_epoll_ref, the information it encoded is now implicit in the epoll_type value. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tcp.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tcp.h') diff --git a/tcp.h b/tcp.h index 5499127..8eb7782 100644 --- a/tcp.h +++ b/tcp.h @@ -13,6 +13,7 @@ struct ctx; +void tcp_timer_handler(struct ctx *c, union epoll_ref ref); void tcp_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events, const struct timespec *now); int tcp_tap_handler(struct ctx *c, int af, const void *addr, @@ -31,7 +32,6 @@ void tcp_update_l2_buf(const unsigned char *eth_d, const unsigned char *eth_s, * union tcp_epoll_ref - epoll reference portion for TCP connections * @listen: Set if this file descriptor is a listening socket * @outbound: Listening socket maps to outbound, spliced connection - * @timer: Reference is a timerfd descriptor for connection * @index: Index of connection in table, or port for bound sockets * @u32: Opaque u32 value of reference */ @@ -39,7 +39,6 @@ union tcp_epoll_ref { struct { uint32_t listen:1, outbound:1, - timer:1, index:20; }; uint32_t u32; -- cgit v1.2.3