On Thu, Jul 04, 2024 at 11:19:25PM +0200, Stefano Brivio wrote: > On Thu, 4 Jul 2024 14:58:25 +1000 > David Gibson wrote: > > > sock_l4() creates a socket of the given IP protocol number, and adds it to > > the epoll state. Currently it determines the correct tag for the epoll > > data based on the protocol. However, we have some future cases where we > > might want different semantics, and therefore epoll types, for sockets of > > the same protocol. So, change sock_l4() to take the epoll type as an > > explicit parameter, and determine the protocol from that. > > The interface is a bit surprising, but I guess it makes later changes > much more convenient, so be it. Yes. For the new UDP flow design, I have both "listening" and "reply" sockets which are basically the same at the kernel level, but need different epoll information. > Just one nit: > > > Signed-off-by: David Gibson > > --- > > epoll_type.h | 41 +++++++++++++++++++++++++++++++++++++++++ > > icmp.c | 2 +- > > passt.h | 32 -------------------------------- > > tcp.c | 10 +++++----- > > udp.c | 12 ++++++------ > > util.c | 48 ++++++++++++++++++++++++++---------------------- > > util.h | 3 ++- > > 7 files changed, 81 insertions(+), 67 deletions(-) > > create mode 100644 epoll_type.h > > > > diff --git a/epoll_type.h b/epoll_type.h > > new file mode 100644 > > index 00000000..42e876e5 > > --- /dev/null > > +++ b/epoll_type.h > > @@ -0,0 +1,41 @@ > > +/* SPDX-License-Identifier: GPL-2.0-or-later > > + * Copyright Red Hat > > + * Author: Davd Gibson > > I'm fairly sure it's spellt David. :) Oops, fixed :). -- 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