On Fri, Oct 17, 2025 at 12:31:28PM +0200, Laurent Vivier wrote: > Store the thread number in the flow_common structure for UDP > flows using flow_epollfd_set() and retrieve the corresponding epoll > file descriptor with flow_epollfd_get() instead of passing c->epollfd > directly. This makes UDP consistent with the recent TCP and ICMP > changes. > > Signed-off-by: Laurent Vivier > --- > udp_flow.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/udp_flow.c b/udp_flow.c > index caaf3dababb1..ea89a14775a4 100644 > --- a/udp_flow.c > +++ b/udp_flow.c > @@ -52,7 +52,7 @@ void udp_flow_close(const struct ctx *c, struct udp_flow *uflow) > flow_foreach_sidei(sidei) { > flow_hash_remove(c, FLOW_SIDX(uflow, sidei)); > if (uflow->s[sidei] >= 0) { > - epoll_del(c->epollfd, uflow->s[sidei]); > + epoll_del(flow_epollfd(&uflow->f), uflow->s[sidei]); > close(uflow->s[sidei]); > uflow->s[sidei] = -1; Hm. I guess it *probably* doesn't matter since the flow's about to go away. But just as we clear the socket fields, here we should probably clear the threadnb field when we remove ourselves from the epoll. > } > @@ -92,7 +92,9 @@ static int udp_flow_sock(const struct ctx *c, > ref.data = fref.data; > ref.fd = s; > > - rc = epoll_add(c->epollfd, EPOLLIN, &ref); > + flow_thread_set(&uflow->f, 0); > + > + rc = epoll_add(flow_epollfd(&uflow->f), EPOLLIN, &ref); > if (rc < 0) { > close(s); > return rc; > @@ -101,7 +103,7 @@ static int udp_flow_sock(const struct ctx *c, > if (flowside_connect(c, s, pif, side) < 0) { > rc = -errno; > > - epoll_del(c->epollfd, s); > + epoll_del(flow_epollfd(&uflow->f), s); > close(s); > > flow_dbg_perror(uflow, "Couldn't connect flow socket"); > -- > 2.51.0 > -- 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