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 6D6955A031B for ; Fri, 05 Jul 2024 12:44:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1720176251; bh=AS7oJIlR3dGl1aVj55++41dU4mI0F5K+3lYqsnQPpzM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RXLHpRAWJaljPEvq0+MRQBW/0PT3h8DXZJSXeWVG3qqIq5+dR3ddN0w6oLd1IyXB4 lRNgTr8LUzL3nAL9NVFXfrMkX/wDn9bhEU2wZQISGjUmZ6KlUqroFC8gOEpLaOazR2 ZmQowJY0G93o6lNRASN1bqGPNKckS2FsZSQ6ZGTjWDd/6hX4tYam2xI0z1R9gwqegn UpXf0YOx1eAkEy+rZaqhmweA8HKMMK8ieJM+xfyXJ4qrqTQH6vrhj5IbDr5Pi9ydEv 2DFPhkJQHGqVlTKFX9hVLb7hdP91kYUuveGd4LgaiKLyGZbJRyIsAUSs0B8Mgde3mM uHMXnXFZM/9hA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WFqrW63RVz4w2K; Fri, 5 Jul 2024 20:44:11 +1000 (AEST) Date: Fri, 5 Jul 2024 19:49:21 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 10/11] contrib: Add program to document and test assumptions about SO_REUSEADDR Message-ID: References: <20240704045835.1149746-1-david@gibson.dropbear.id.au> <20240704045835.1149746-11-david@gibson.dropbear.id.au> <20240704232121.60bcebee@elisabeth> <20240705103334.7f55b4a2@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="/VQgpQD0biic3YQs" Content-Disposition: inline In-Reply-To: <20240705103334.7f55b4a2@elisabeth> Message-ID-Hash: J3H2FTRGAHITJGR5ZJJEYPOOARRGPYGD X-Message-ID-Hash: J3H2FTRGAHITJGR5ZJJEYPOOARRGPYGD 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: --/VQgpQD0biic3YQs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 05, 2024 at 10:33:43AM +0200, Stefano Brivio wrote: > On Fri, 5 Jul 2024 10:06:12 +1000 > David Gibson wrote: >=20 > > On Thu, Jul 04, 2024 at 11:21:21PM +0200, Stefano Brivio wrote: > > > On Thu, 4 Jul 2024 14:58:34 +1000 > > > David Gibson wrote: > > > =20 > > > > For the approach we intend to use for handling UDP flows, we have s= ome > > > > pretty specific requirements about how SO_REUSEADDR works with UDP = sockets. > > > > Specifically SO_REUSEADDR allows multiple sockets with overlapping = bind()s, > > > > and therefore there can be multiple sockets which are eligible to r= eceive > > > > the same datagram. Which one will actually receive it is important= to us. > > > >=20 > > > > Add a test program which verifies things work the way we expect, wh= ich > > > > documents what those expectations are in the process. > > > >=20 > > > > Signed-off-by: David Gibson > > > > --- > > > > contrib/udp-behaviour/.gitignore | 1 + > > > > contrib/udp-behaviour/Makefile | 45 ++++ > > > > contrib/udp-behaviour/common.c | 66 ++++++ > > > > contrib/udp-behaviour/common.h | 47 ++++ > > > > contrib/udp-behaviour/reuseaddr-priority.c | 240 +++++++++++++++++= ++++ > > > > 5 files changed, 399 insertions(+) =20 > > >=20 > > > I reviewed these (10/11 and 11/11) a bit lightly, but they look sane = to > > > me. I just wonder: wouldn't it be better to have > > > contrib/linux/udp-behaviour instead, so that it's consistent with the > > > other stuff unter contrib/ (project names, kind of)? =20 > >=20 > > Well.. if we ever port to something non-Linux, we'll need the same > > socket behaviour there. Indeed, that's one reason I think having > > these test programs is valuable. So I don't think 'linux/' is a great > > pick. >=20 > Oh, oops, I thought SO_REUSEADDR were specific to Linux, that's why I > was suggesting linux/, but it's actually supported by all the BSDs. RIght. I believe SO_REUSEPORT is Linux specific, but the weaker SO_REUSEADDR is much older, and is all I need for the things I have planned. > > In some ways contrib/ isn't really the right place for this. Maybe > > it would be better under doc/? But at the moment that's more user > > facing than developer facing documentation. >=20 > I would still say it's documentation and it can happily fit under doc/. > Distribution packages don't copy the whole doc/ (to /usr/share/doc/) > anyway. Ok, I'm going with doc/platform-requirements/ in the next spin. >=20 > Or test/kernel/? But it's not something we want to check regularly, > it's really an example to help with development. >=20 > All in all, I don't have a strong preference, doc/ looks like a better > fit to me, but contrib/ isn't problematic either. >=20 --=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 --/VQgpQD0biic3YQs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmaHwZQACgkQzQJF27ox 2GfJBQ//Q9fpIPMDXT0HElicmke+17Dm53BRAmC9J2QVCmulcO7YvINobS83L6xa csLnVvXhzaMzPW8focHseuifawzYwf20rOuLJ8s0vrGGdgoUsBxWw4QSHlCVW6In fvow2Ko/VoH4qmBKPpEqqrHW3p+/s0EBhJ9P86zNRG3hFrs4Q1iK4f5OO0VFU0Px 5/IhA59n5iSlr+SYMExTL/pK3GfRkdMKV5IzGDcUdnQSOz/tEBz08LPFriVh8Rl0 piZQpZKGqI4o7xRZSh3tK9/B6CwkPaNh/vedL6wLgtomq6+9n41XdbSRTuR2F52r 5LiZ+pUUMIZo79cV8DWXgn/lvxtjnXeUEWx2mURESdVy8+nq6I7okuXiyE1ahD4w gVfk6i/zOmHkugeYgWwtiIxu2/PDXCG8oWcKhPw3igK1Ez49OHVULSR9/infitR8 iYH7pR+CxxZxzL7WkZlt7R5KfJigRFP9s2ZIIQkMJuMXENg5J1nYcJRYxMIKG9hl rbeQTH64LPyjd66lxDJeOXpnGKH0ca8Nvw4Yp9nBOzOmr1sIIAa7LCxy+jqB60X6 cKDciPIxb+41D5Hjuts1C+MRvHiC3kKWe/WOPXzHoAyufxa0HfwawhGvOJ8LgTRV 4w4VBJ7nvtQ25unkOPNoqNHysTc3qMAe8i0/PHIvf9cAqv3veVE= =zobo -----END PGP SIGNATURE----- --/VQgpQD0biic3YQs--