From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 4D3375A004F for ; Fri, 05 Jul 2024 02:01:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1720137649; bh=WCweX+UdSoDrx6wq9VXR0Y+JIP2UBRR5OM+OqbHEMGc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=o1XxtQ4NHR/DpTxteTNxC1Virf2pPJDx+Ren/th7PQ/HrfyGvz97wckxYxQcSmjCH osKHPC53lPQF2p3vXM/DjGBxfOA7PyldX8HbaLfeRjQxRRPKnSVxLJIz8/oIy/vh35 f+XjlamTnEN9xGoftQkZofXk0kzQetbQ8a6kLhOGZLPQ4HquVa/16sBNPqDpZfofz+ 1va/KyJhVHJzQyc+EBJ23ftoXAbMGAqjLv7HvMHnxnzQWRCOjmZl5CZLKIH9Fq4t76 ueuvfPnBB4T5PCeo6vjK4JfrBRUAqM3GfUCRA7KlKBh28hEf6Brf/WgaUq1TdGCWwG BEMquBhMTtRBg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WFYZ939gQz4wx5; Fri, 5 Jul 2024 10:00:49 +1000 (AEST) Date: Fri, 5 Jul 2024 09:51:37 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 01/11] util: sock_l4() determine protocol from epoll type rather than the reverse Message-ID: References: <20240704045835.1149746-1-david@gibson.dropbear.id.au> <20240704045835.1149746-2-david@gibson.dropbear.id.au> <20240704231925.7f663869@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fQEXo00am0KbUoNx" Content-Disposition: inline In-Reply-To: <20240704231925.7f663869@elisabeth> Message-ID-Hash: DBDPFZ2QZE7MQVMCWWO6DBHZHN2VU3LW X-Message-ID-Hash: DBDPFZ2QZE7MQVMCWWO6DBHZHN2VU3LW X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --fQEXo00am0KbUoNx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: >=20 > > 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. >=20 > 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: >=20 > > 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 > >=20 > > 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 >=20 > I'm fairly sure it's spellt David. :) Oops, fixed :). --=20 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 --fQEXo00am0KbUoNx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmaHNXkACgkQzQJF27ox 2GfbiBAAnJgcVwm6kGHFaG6ldzXcwzb5aqBk6r42jNk6ojWTN2SjAwfQLodB8Mem fXYYpAYQQ4lnd+u2zBk0WaMesGQdDYrAKyvoG7cQa3RbUZNwnyZcR5K4zRBVdwup I7ksQEESKMFr3qNVK6J2bDsoeuFAv6WVVJF2IYU5koad9zg2WIJ5sxRf0P/Vq48H AQtNbBlLMwlXtqf19/kGEZL7vJNSSri2Z1YsN01IYJ5IjhKodapP4yyMLrFvA+2k CkGDD7J8JFrnUadvj363z9Rh6HvCexQVRbWYkhfGfwNlln6x9tZMnDEJ64xF4tiw t1qjCmxd2yG/KVYLYf8rvsV6F/Cy5N/m9sTvOjMHqCN8cfmzL+hqzB7zNDzBtrtt tw4oGRfk/wwCvAIe/tq6v6VsOIX4v8GpR7JR21logIarUrQ6woexZFt+sGuJlOEN SZJLXuOHjxOG2AmZz1W2AyNfD6yn9yt2msyI+SC3lv2zFBzbSBOLYbs3Pw9VdnhU Z6hrstsxf+1eAqU5SeIogwXYv8eW2vJSvJV4X2uYvfRxH6ywg1Xz7BrLmpG4Z+hU NIad/63JYCwBISObObATGB4/LgBjz6raa/pX/fx91ClTN19J1VAnA/BQwVkquf5M V6yW3McxyRXBDAarAEGILQFyzO8ykbq818JPSWYosBnAyr+9yeQ= =48L4 -----END PGP SIGNATURE----- --fQEXo00am0KbUoNx--