From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 5CBE05A004E for ; Fri, 05 Jul 2024 10:34:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720168463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=01Qnv2jCZfBf6oEXD/JgNae3HsaAibFAFrsFL8ght9M=; b=O1HJZPETYz7NGCGPC/f2uuzXC8daEJrvZBhtXuDSOpQ1ojZnWVy8x7GZDhzvuC1ELhkgdX 2/RFR8H0z+DKjxSVwnndo+/jypWpDgZ+uxujzj9ppQaP86WqfyEv8n5vhxvVv9BjGmBS1c 5l94adqXt//PLKq8Q7IdqpyxnDdgtjs= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-77-16WyO5DINQWmXj34sxQ2gA-1; Fri, 05 Jul 2024 04:34:20 -0400 X-MC-Unique: 16WyO5DINQWmXj34sxQ2gA-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-79efb113fddso21365085a.0 for ; Fri, 05 Jul 2024 01:34:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720168459; x=1720773259; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=01Qnv2jCZfBf6oEXD/JgNae3HsaAibFAFrsFL8ght9M=; b=Fp/i/y+G/f9VyII3mm4HY3Cg/BOLjYG27L99JCVgk8sRwQrFJP//FOIE2fKqC7BCFK 0mrsK/MHw68kgQq8fsLV5LvgK/CC3eil/shRzPvRNtomiCm5/sklByZMrA/4UlNGuHo+ UG1HOgzaeCAIWavY0CU8VDNWrq41lwHb1i6sCanSeHzjgKjFKJ5InB3Edb15Z+RP753N 5ozqAKhVVl7QBJzRwSBSgVdG0tm7uqsvXxBAJw++qQJiP5KrVfuIGJksjTpuWOd1g6bB dIiyS1fEh3HmQXI1oXuzvYJ2RQgERXuox7RgaUkxfmpNlEGHOoAFObGvgfKYJQI+Bkyv U4/w== X-Gm-Message-State: AOJu0Yyr+ofACqlEEyq2isojfc7jJZQFK4Y6KizaGceylLMJqrjGRwpy 0E0M0UDRyeRrnHyvVe7XuIh5kKCP1c3iEuB7bUMf4Qo3+LafjPurneDPxjMnxJeZZOPmB9CLgsz 9pbuhc0TH4nhf/WXzRe0WpjMr35Brh/EGRhxipXNlyy1ze1v+fikFbRkCZcut X-Received: by 2002:a05:620a:d5a:b0:79e:fbab:4762 with SMTP id af79cd13be357-79efbab4891mr25774085a.50.1720168459290; Fri, 05 Jul 2024 01:34:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5KKrWCAu2VDlWB7ipC7c1fXdAjxAKKiMnOfWFZbjPXbxIY1SqYowF7m5Jy2sJAy6H/+ZpqQ== X-Received: by 2002:a05:620a:d5a:b0:79e:fbab:4762 with SMTP id af79cd13be357-79efbab4891mr25771885a.50.1720168458883; Fri, 05 Jul 2024 01:34:18 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79d692f255esm752373685a.87.2024.07.05.01.34.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2024 01:34:17 -0700 (PDT) Date: Fri, 5 Jul 2024 10:33:43 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 10/11] contrib: Add program to document and test assumptions about SO_REUSEADDR Message-ID: <20240705103334.7f55b4a2@elisabeth> In-Reply-To: References: <20240704045835.1149746-1-david@gibson.dropbear.id.au> <20240704045835.1149746-11-david@gibson.dropbear.id.au> <20240704232121.60bcebee@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: PQAVUIWK5ICQVRBWWNQHGROLHOELC7DJ X-Message-ID-Hash: PQAVUIWK5ICQVRBWWNQHGROLHOELC7DJ X-MailFrom: sbrivio@redhat.com 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: On Fri, 5 Jul 2024 10:06:12 +1000 David Gibson 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 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 > > > --- > > > 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