From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 0A0745A0278 for ; Mon, 19 Feb 2024 03:03:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1708308192; bh=acN1DAaBpdPyNsmwmC2IqLfj0pCTiRSwGO+Et27UBzQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pVBsLDS1J7QyRLvCPJR5NQwHvRSn5fiJw20rwu7Rud6f4gKNADFX1wJ5tY07Nw9o1 tRPoDnpprfNxrwBYZVOJsNwviLC29/dLXwnbIQ/VTlbga7Y9HQlL0vWvyRm0NU3mLE cqV2dWYpVNctZ4BQorgccwk9d22y57G0wK5HnFOHRB1EthXRcx5umng0eWuUXCuekK akUK5spJnOaNKJoyULUiqW8keLKFfDVP5aruiZh1OWIZBXQjoruoleDw9DmP7FRKHG vzLar7+eCAZTJOHZD/bM3FSEA+3eNienboDBGqLiFImjTCnBRtiSJh1+dVXpe/98Vb 9/l7Gpu1AzFoQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4TdQmc4SRqz4wcJ; Mon, 19 Feb 2024 13:03:12 +1100 (AEDT) Date: Mon, 19 Feb 2024 12:53:23 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v2 13/22] tcp_splice: More specific variable names in new splice path Message-ID: References: <20240206011734.884138-1-david@gibson.dropbear.id.au> <20240206011734.884138-14-david@gibson.dropbear.id.au> <20240218220055.4943925c@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9J117MJ3WkKTm9e8" Content-Disposition: inline In-Reply-To: <20240218220055.4943925c@elisabeth> Message-ID-Hash: O2CXXQXPSWSVB4WG7JRKLAFAUGZFHMGV X-Message-ID-Hash: O2CXXQXPSWSVB4WG7JRKLAFAUGZFHMGV 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: --9J117MJ3WkKTm9e8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 18, 2024 at 10:00:55PM +0100, Stefano Brivio wrote: > On Tue, 6 Feb 2024 12:17:25 +1100 > David Gibson wrote: >=20 > > In tcp_splice_conn_from_sock(), the 'port' variable stores the source p= ort > > of the connection on the originating side. In tcp_splice_new(), called > > directly from it, the 'port' parameter gives the _destination_ port of = the > > originating connection and is then updated to the destination port of t= he > > connection on the other side. > >=20 > > Similarly, in tcp_splice_conn_from_sock(), 's' is the fd of the accetped > > socket (on side 0), whereas in tcp_splice_new(), 's' is the fd of the > > connecting socket (side 1). > >=20 > > I, for one, find having the same variable name with different meanings = in > > such close proximity in the flow of control pretty confusing. >=20 > Yeah, same here, it took me a while to check that what you're changing > to 'dstport' is actually a destination port (and not just because a > comment says that). Yeah, I had a lot of confusion until I did that trace and realised these were different things with the same name. Hence the patch. --=20 David Gibson | 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 --9J117MJ3WkKTm9e8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmXStJIACgkQzQJF27ox 2GeybxAAqrNgmCNQoCKYPLGcNZQrreltarIXT47AWZsQqP8vmjmW0zeCQU5kVit0 4Igi99UdehOqiDdywZS3JbsBEwn+tUDCre5a09b2Tnzci9zq1Ys3rl6wIgkwKw4t nY1mMm2AB5WPEG5jzsa/gH1HQ1+extO6nfNvK7yvt15CfoiVm/5J763dJIgNGNpS cHeVAf0VWKj4oiwQ6r2/yY4jTNrD9/8bNswjwU8sL6N6gnYQdN1O6ekfkQiI7FJ+ S+F+NTwHOw5duS4yVsPMjG6PcWt9oHxJyt+lpUoxxr8TRjqZUUCMEHaeMEt6yE9F tc3YfnAGGspLHE8kUqTCx7OUZ5bsBcitysUkJH4+CmDJ1agSmUpY8pPKNdN2zVQN QEMP1QWwcUYCufobeBV2Kem2acZoSEH36ZrP0Lp6eIjbL+aJe21L+a7LyXbOAUkZ EkgnEjtBf5HuJFtOn/wMYuOs2Zxv4HyftQ/vvZcBqHJvxYFjqqmyzxrsNi9cJtMq 2akB/YzD3Li7XrwFGo8tbequPp8/5QxZvYJhIa5mAVMZ2Y8IIAtaka4xfoTVRUJB 7f5oMRRHR8pZVgmg3B6UAsYJih7dOrTw4ppCOdBpi6YL0C7+b6nPEpBkdX+t4UrI QW0HJ9rZB1+JENFnESleJ8rPVFo0ANuZAabIMTQvGF5JUKF8QWQ= =XXi1 -----END PGP SIGNATURE----- --9J117MJ3WkKTm9e8--