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 71AD25A004F for ; Fri, 12 Jul 2024 10:22:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720772539; 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=q6W3stZ7arwS4WHI/BIqKSr5KcKF5FEgKtiCgkUfNgQ=; b=RRzgEwCYrjoepIDEDNaVpi5niLB4RaU8A4lxJL6gHW4gljLJMg2YsBUKvmNTZEh+KbYKtK mZmNkMBCI0DUekxvn2GQ//D3SXazzPH4SDnR+Xza+tj53zVdoWz2O1KTpDG59VUKdiN3V6 HKrKHieYYZ+emktiP6NuKvs7II600i4= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-657-5ahsAN7CNLyb6unUdAdnnw-1; Fri, 12 Jul 2024 04:22:17 -0400 X-MC-Unique: 5ahsAN7CNLyb6unUdAdnnw-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4467f700bb4so21941031cf.0 for ; Fri, 12 Jul 2024 01:22:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720772537; x=1721377337; 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=q6W3stZ7arwS4WHI/BIqKSr5KcKF5FEgKtiCgkUfNgQ=; b=mPoaHCQ43lc76wRkvkgxME6RUuiH4mXk5/x0jUaSmrAYgJY5i/qdiJvvrqQ7IfCdAO enssVX4YRFaiZvfkd3SGH0tFqbagGknzPZqh5tH9y+8H9cCMpyyKAdBODaCPGX3y5xds jaeLG9Q//ecSftNjyQnpey7MsrOX8UqXHHBpj5eJp0UlTbbfcq10M4Ccn5poSGyniQBI 3x5mNZwqvkJHSmkTg8WYecHxDpUjh4Iv+ZqJ5u/VGM3fYaBBKwykJ6gTaLlF9J20D+wA Km1f4iS7Q51vru3VzsBjBhZJjIFS5yCZQlRRBzTtw4fOMBe+H6k5EPpUynhcCI90DynU 7iJA== X-Gm-Message-State: AOJu0Yzss9rQ6NI4NqkVIdY4kJKdQHSXozn1s+PbOyQr36a/Z+HRwzml T4HZtxcb6no/lb0XkjJux7zilaUCPAQbygpIqs0abMHc0XWDSJYX9MphbBOA+RRMjRZPEJ7r/gz BkjZZXYGg6QY0iiB3PeZMMIeX9Q97fNb9VXjkO1JZqMpdl8wsyQ== X-Received: by 2002:a05:622a:244:b0:444:f860:3b4b with SMTP id d75a77b69052e-447fa8b0049mr121118501cf.14.1720772537033; Fri, 12 Jul 2024 01:22:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyOXTG037FrjlQmGYc7RLLe4v6ktCggOGGZrIElLLE2ZrX5a7MaHnNMa4tzZGE565ogJwgYA== X-Received: by 2002:a05:622a:244:b0:444:f860:3b4b with SMTP id d75a77b69052e-447fa8b0049mr121118381cf.14.1720772536639; Fri, 12 Jul 2024 01:22:16 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-447f9b2690csm38898691cf.1.2024.07.12.01.22.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jul 2024 01:22:16 -0700 (PDT) Date: Fri, 12 Jul 2024 10:21:41 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v7 20/27] udp: Create flows for datagrams from originating sockets Message-ID: <20240712102134.35e5fa2d@elisabeth> In-Reply-To: References: <20240705020724.3447719-21-david@gibson.dropbear.id.au> <20240710003202.2909199a@elisabeth> <20240710233503.03147137@elisabeth> <20240711101937.2f7fb626@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: DBYZ7I6IWXBMJI3ARG33XV7WLTSH5V35 X-Message-ID-Hash: DBYZ7I6IWXBMJI3ARG33XV7WLTSH5V35 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, jmaloy@redhat.com 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, 12 Jul 2024 08:58:57 +1000 David Gibson wrote: > On Thu, Jul 11, 2024 at 10:20:01AM +0200, Stefano Brivio wrote: > > On Thu, 11 Jul 2024 14:26:38 +1000 > > David Gibson wrote: > > > > > On Wed, Jul 10, 2024 at 11:35:23PM +0200, Stefano Brivio wrote: > > > > On Wed, 10 Jul 2024 09:59:08 +1000 > > > > David Gibson wrote: > > > > > > > > > On Wed, Jul 10, 2024 at 12:32:02AM +0200, Stefano Brivio wrote: > > > > > > Nits only, here: > > > > > > > > > > > > On Fri, 5 Jul 2024 12:07:17 +1000 > > > > > > David Gibson wrote: > > > > > > > > > > > > > [...] > > > > > > > > > > > > > > + * @c: Execution context > > > > > > > + * @proto: Protocol of the flow (IP L4 protocol number) > > > > > > > + * @pif: Interface of the flow > > > > > > > + * @esa: Socket address of the endpoint > > > > > > > + * @fport: Forwarding port number > > > > > > > + * > > > > > > > + * Return: sidx of the matching flow & side, FLOW_SIDX_NONE if not found > > > > > > > + */ > > > > > > > +flow_sidx_t flow_lookup_sa(const struct ctx *c, uint8_t proto, uint8_t pif, > > > > > > > + const void *esa, in_port_t fport) > > > > > > > +{ > > > > > > > + struct flowside fside = { > > > > > > > > > > > > And the "f" in "fside" stands for "forwarding"... I don't have any > > > > > > quick fix in mind, and it's _kind of_ clear anyway, but this makes me > > > > > > doubt a bit about the "forwarding" / "endpoint" choice of words. > > > > > > > > > > Heh, no, here "fside" is simply short for "flowside". Every flowside > > > > > has both forwarding and endpoint elements. > > > > > > > > Oh, I thought you called it fside here because you're setting the > > > > forwarding part of it directly, or something like that. > > > > > > > > > So it is confusing, but > > > > > for a different reason. I need to find a different convention for > > > > > naming struct flowside variables. I'd say 'side', but sometimes > > > > > that's used for the 1-bit integer indicating which side in a flow. > > > > > > > > > > Hrm.. now that pif has been removed from here, maybe I could rename > > > > > struct flowside back to 'flowaddrs' or 'sideaddrs' perhaps? > > > > > > > > That's also confusing because it contains ports too (even though sure, > > > > in some sense they're part of the address). > > > > > > Right :/. > > > > > > > I would suggest keeping it > > > > like it is in for this series, but after that, if it's not too long, > > > > what about flow_addrs_ports? > > > > > > Still need a conventional name for the variables. "fap" probably > > > isn't the best look, and still has the potentially confusing "f" in > > > it. > > > > > > > Actually, I don't think flowside is that bad. What I'm struggling with > > > > is rather 'forwarding' and 'endpoint'. I don't have any good suggestion > > > > at the moment, anyway. Using 'local' and 'remote' (laddr/lport, > > > > raddr/rport) would be clearer to me and avoid the conflict with 'f' of > > > > flowside, but you had good reasons to avoid that, if I recall correctly. > > > > > > Kind of, yeah. Local and remote are great when it's clear we're > > > talking specifically from the point of view of the passt process. > > > There are a bunch of cases where it's not necessarily obvious if we're > > > talking from that point of view, the point of view of the guest, or > > > the point of view of the host (the last usually when the endpoint is > > > somewhere on an entirely different system). I wanted something that > > > wherever we were talking about it is specifically relative to the > > > passt process itself. > > > > > > I get the impression that "forwarding" is causing more trouble here > > > than "endpoint". "midpoint address"? "intercepted address"? > > > "redirected address" (probably not, that's 'r' like remote but this > > > would be the local address)? > > > > I think "forwarding" is still better than any of those. Perhaps "passt > > address" (and paddr/pport)... but I'm not sure it's much better than > > "forwarding". > > Hm. "passthrough address"? Kind of means the same thing as > "forwarding" in context, and maybe evokes the idea that this is the > address that passt itself owns? I'd still prefer "forwarding" to that... at least I almost got used to it, "passthrough" is even more confusing because not everything really passes... through? The part I'm missing (with any of those) is "here" vs. "there", that is, a reference to the "where" and to the topology instead of what that side does. Again, I would just leave that as "forwarding" in this series, and then change it everywhere if we come up with something nicer. -- Stefano