From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 10/11] contrib: Add program to document and test assumptions about SO_REUSEADDR
Date: Fri, 5 Jul 2024 10:33:43 +0200 [thread overview]
Message-ID: <20240705103334.7f55b4a2@elisabeth> (raw)
In-Reply-To: <Zoc49KKSDgpZ2oAc@zatzit>
On Fri, 5 Jul 2024 10:06:12 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:
> On Thu, Jul 04, 2024 at 11:21:21PM +0200, Stefano Brivio wrote:
> > On Thu, 4 Jul 2024 14:58:34 +1000
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> >
> > > For the approach we intend to use for handling UDP flows, we have some
> > > 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 receive
> > > the same datagram. Which one will actually receive it is important to us.
> > >
> > > Add a test program which verifies things work the way we expect, which
> > > documents what those expectations are in the process.
> > >
> > > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > > ---
> > > 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(+)
> >
> > 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)?
>
> 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.
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.
> 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.
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.
Or test/kernel/? But it's not something we want to check regularly,
it's really an example to help with development.
All in all, I don't have a strong preference, doc/ looks like a better
fit to me, but contrib/ isn't problematic either.
--
Stefano
next prev parent reply other threads:[~2024-07-05 8:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 4:58 [PATCH 00/11] Preliminaries for UDP flow support David Gibson
2024-07-04 4:58 ` [PATCH 01/11] util: sock_l4() determine protocol from epoll type rather than the reverse David Gibson
2024-07-04 21:19 ` Stefano Brivio
2024-07-04 23:51 ` David Gibson
2024-07-04 4:58 ` [PATCH 02/11] flow: Add flow_sidx_valid() helper David Gibson
2024-07-04 4:58 ` [PATCH 03/11] udp: Pass full epoll reference through more of sock handler path David Gibson
2024-07-04 21:20 ` Stefano Brivio
2024-07-04 23:54 ` David Gibson
2024-07-04 4:58 ` [PATCH 04/11] udp: Rename IOV and mmsghdr arrays David Gibson
2024-07-04 21:20 ` Stefano Brivio
2024-07-05 0:00 ` David Gibson
2024-07-04 4:58 ` [PATCH 05/11] udp: Unify udp[46]_mh_splice David Gibson
2024-07-04 4:58 ` [PATCH 06/11] udp: Unify udp[46]_l2_iov David Gibson
2024-07-04 4:58 ` [PATCH 07/11] udp: Don't repeatedly initialise udp[46]_eth_hdr David Gibson
2024-07-04 4:58 ` [PATCH 08/11] udp: Move some more of sock_handler tasks into sub-functions David Gibson
2024-07-04 4:58 ` [PATCH 09/11] udp: Consolidate datagram batching David Gibson
2024-07-05 9:10 ` Stefano Brivio
2024-07-05 9:36 ` David Gibson
2024-07-04 4:58 ` [PATCH 10/11] contrib: Add program to document and test assumptions about SO_REUSEADDR David Gibson
2024-07-04 21:21 ` Stefano Brivio
2024-07-05 0:06 ` David Gibson
2024-07-05 8:33 ` Stefano Brivio [this message]
2024-07-05 9:49 ` David Gibson
2024-07-04 4:58 ` [PATCH 11/11] contrib: Test behaviour of zero length datagram recv()s David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240705103334.7f55b4a2@elisabeth \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).