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 80E115A0272 for ; Mon, 1 Jan 2024 00:19:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1704064793; bh=TxRYhJ1dRHbfKHDorz8s3dvkXozkAsLXsDyBM0lNOHA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nAKfrwH1njNvhBPmbST/EyN0GsfHBhrFr1ZJJc3yXJq2LkfAMgd4xe9SdP0rJV62K 992tXOnot3odikf3YAA8X6TBFKnoakyleePVzNmiHUOOMe5Vc3w1JFF8ITaorKvs3A 2MhcrwkRkC2jDjoMqN4o87qWGNJyGO02STmHViyliQcIHLMpYKSZw87sSMxn1wADd2 4Cgap5Iulfwgpocs4p5qEF4954uN9Ilj+YqTKyW/6MNumbHp3UQabbbxGGzgwqJ43f zPafGWA5nmUGrNc5t3EYKXEZ3mRoRovJPdq/ICT34H8jZerv0l2ZghSx/IDYH5Bn5n dP46S2Mrdyx6w== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4T3FSn2mgcz4wdD; Mon, 1 Jan 2024 10:19:53 +1100 (AEDT) Date: Sun, 31 Dec 2023 16:58:39 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v3 10/13] flow: Move flow_count from context structure to a global Message-ID: References: <20231221061549.976358-1-david@gibson.dropbear.id.au> <20231221061549.976358-11-david@gibson.dropbear.id.au> <20231228192459.312cc508@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="25lYHrE9AnOMNzTo" Content-Disposition: inline In-Reply-To: <20231228192459.312cc508@elisabeth> Message-ID-Hash: CY23UMAZTGEU3GJRDKGDO52MR2WV7NAL X-Message-ID-Hash: CY23UMAZTGEU3GJRDKGDO52MR2WV7NAL 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: --25lYHrE9AnOMNzTo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 28, 2023 at 07:25:18PM +0100, Stefano Brivio wrote: > On Thu, 21 Dec 2023 17:15:46 +1100 > David Gibson wrote: >=20 > > In general, the passt code is a bit haphazard about what's a true global > > variable and what's in the quasi-global 'context structure'. The > > flow_count field is one such example: it's in the context structure, > > although it's really part of the same data structure as flowtab[], which > > is a genuine global. >=20 > Well, the reason is that flow_tab[FLOW_MAX] might be problematically > too big to live on the stack, unlike flow_count. >=20 > But anyway, as far as thoughts of multithreading are concerned, both > should probably be global. And sure, it's more consistent this way. >=20 > > Move flow_count to be a regular global to match. For now it needs to be > > public, rather than static, but we expect to be able to change that in > > future. >=20 > If it's not static, it should be initialised, and that's not done here. Uh... what? "static" here is meaning module-global rather than global-global, which has no bearing on initialisation. AFAIK globals are zero-initialised whether they're static or not. > This becomes 'flow_first_free' in 13/13, but it's not initialised > either, and that should also start off as zero. >=20 --=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 --25lYHrE9AnOMNzTo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmWRAwEACgkQzQJF27ox 2GclWA//dpAmjVcny+B2ttvZSmbloSDJhbwcIg1rXsVlKSt/dEbpv/M1696fWIUI KG63XofeuzYu0rP+vsk2I0maQfVR5N+r7efV1s4Mjcez9UtGBJMU3HvRsF90dUcK XmPJkUNbJvG4Q0N3nwt+2LA88u4voqr07pJrkPw00YaHRhnwk9Mj2EoYKUtMvWKg QyiWcnQPi8A3VQmT1OityxxRvp7GSJkk7Iga6ZmSKCzuUHB4Sq+vZgTpzt88dDGL nzEkvhIYqbrp0euueGKq99Alko+V4PzJmleI+fOmWlYONcwZvGHzKaPRxwupwMeJ YSMQmEo6rrSzio9zDyuZI1j26zt5Uh7EZPvyXWiqFr0uJKefQMWWjrXwqtvdIST/ qtOOOIz1eGcqItISApNvH3ydMEXGg0VkLEBRlanIrHTunvpGVMtyR0KxYVde2faK 85pmad49j7ol4apWHaZNInDp3+YrpynU80sMLhz0O8a0Qkt+eJzIAEWCPmYw0qfg QLRaZaYi7iXveZ+2FL4gl7I7VYWGhxKeruEA9m1/xOnVCf2lnriOj9cJw1eI0KV5 P0kPqNNVzn3UCiTDCQIhAfBaWcE3PwRiMN83oztOQrrJ3yscP2QEYXew3lGDNyg7 eyvAqYBufdBqwZspVhyKJK9Nh6yKD/JxX3qbXcz5C4kPZLJsYYE= =7Vzt -----END PGP SIGNATURE----- --25lYHrE9AnOMNzTo--