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 4100D5A026D for ; Sat, 6 Jan 2024 11:16:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1704536209; bh=4zAfpNoamZL31PxdbNqTmm7AN3mrOSCf/JTDf9PDfbc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Yv1/xcFBBA0H7y98uSeaia3tvYkVzAAMlcc7CV8kz2nWJ07MqRKhitqJdJrGbVqiY SGuBLZfAuxQfmO2f3zTffhpZ4gEqJv0QBgdU9xXebObKoWTKRPk23pv2qkFL4kAdkT DeQHzqWGwY9ed4DiaKs7Dtwgwprg7a/53kC5ykFB/gPe9iVSqPXRjtubqUzuB4OrLZ GVNwNFnYJ1nlTpSZG2XIhRiC9MIvah4xjFl7f4cTSN02y+8jr47ypkm+vweFmU6Isa R16LuAo4SQPupJ4iwHRIVtLe6zFuT1KHs4DaArZGrsZ0/8ZN2bQ3CQhiwsbwJ4wozu jzV/mweDuQdXQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4T6bpT4cwVz4wny; Sat, 6 Jan 2024 21:16:49 +1100 (AEDT) Date: Fri, 5 Jan 2024 20:45:13 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v3 13/13] flow: Avoid moving flow entries to compact table Message-ID: References: <20231221061549.976358-1-david@gibson.dropbear.id.au> <20231221061549.976358-14-david@gibson.dropbear.id.au> <20231228192525.7ba1ee48@elisabeth> <20240102191348.199c2f8d@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="D+fcsBiBpKtbCaWI" Content-Disposition: inline In-Reply-To: <20240102191348.199c2f8d@elisabeth> Message-ID-Hash: QWON4SYUNFHQV5QZHQGNOGII2GPNO5WL X-Message-ID-Hash: QWON4SYUNFHQV5QZHQGNOGII2GPNO5WL 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: --D+fcsBiBpKtbCaWI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 02, 2024 at 07:13:48PM +0100, Stefano Brivio wrote: > On Mon, 1 Jan 2024 21:44:54 +1100 > David Gibson wrote: >=20 > > On Thu, Dec 28, 2023 at 07:25:25PM +0100, Stefano Brivio wrote: > > > On Thu, 21 Dec 2023 17:15:49 +1100 > > > David Gibson wrote: > > > =20 > > > [...] > > > > > > > void flow_defer_handler(const struct ctx *c, const struct timespec= *now) > > > > { > > > > + struct flow_free_block *free_head =3D NULL; > > > > + unsigned *last_next =3D &flow_first_free; > > > > bool timer =3D false; > > > > - union flow *flow; > > > > + unsigned idx; > > > > =20 > > > > if (timespec_diff_ms(now, &flow_timer_run) >=3D FLOW_TIMER_INTERV= AL) { > > > > timer =3D true; > > > > flow_timer_run =3D *now; > > > > } > > > > =20 > > > > - for (flow =3D flowtab + flow_count - 1; flow >=3D flowtab; flow--= ) { > > > > + for (idx =3D 0; idx < FLOW_MAX; idx++) { > > > > + union flow *flow =3D &flowtab[idx]; > > > > bool closed =3D false; > > > > =20 > > > > + if (flow->f.type =3D=3D FLOW_TYPE_NONE) { > > > > + /* Start of a free block */ > > > > + free_head =3D &flow->free; > > > > + *last_next =3D idx; > > > > + last_next =3D &free_head->next; > > > > + /* Skip the rest of the block */ > > > > + idx +=3D free_head->n - 1; > > > > + continue; > > > > + } > > > > + > > > > + =20 > > >=20 > > > Stray tabs. Fixed. > > > > switch (flow->f.type) { > > > > + case FLOW_TYPE_NONE: > > > > + closed =3D true; > > > > + break; >=20 > ...more important than stray tabs, I noticed only now: how would we ever > hit this switch case, if you're checking for this in the if clause just > before? Ah.. it can't.. but fixing it is a bit more complex. The intention here is that if there are multiple contiguous free clusters we'll merge them together, which this currently won't do. I'll have to take another look at that. >=20 > > > > case FLOW_TCP: > > > > closed =3D tcp_flow_defer(flow); > > > > break; >=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 --D+fcsBiBpKtbCaWI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmWXz5wACgkQzQJF27ox 2GcqsA/9HUV6cXnIuCTxn/1OKuZcTzEtCghAZG5C9ADH+PvLshk/5p2l63R7RIUD TSoehD2xcW8DzyyeElQb4ml4OLyS5ABWBsU9zZEpYj3eAKKG14wPBFB6wVfTf6fq TZqsLlWotOtSBpJ/NmKnZhdt7KqdqW6oahUtiTMuj+pRruUnR8zEfsQDO0OAtHV9 agG72x5BOJ8a1jcL4btfvVm4WO6zU/lkZr2K9UJYYvdBtmMA32DXj72BsyOZMAdD +u/EogO6dHh3UCdHtRcbe3GD7gcZ5C0SA7WoBZAp5qTO0p9kzEGnaWkuByIZKSqK OXI+GoHCkRpXUb98e85j0KdoU/BnP7F39+28OyQghpuc7L56x+xFbZHahuY6x29T oT6+m5dHg0xmgfLIOBkcF3FbJ+UlJo3Qlj+q5RGN8JC9IPT5wPamvCyoMaEzet+J 80HPEWd8Oua/vAs+LhbWD+dTAAG8S2urEZN7qtgYaCmDN/K+1JrPibGv9pe2RS+K dbmhxSAeT5DU6Sm4Ada+Yon1fEPm3diUKTSe0ei8b4WruyflYQgAFSWDcAHVjIt4 tUQxBjiLgNK4JrX5isXiceNZVuEv2chtTljTFyu1oXmeCNc7tf/gQLZq8pjNz47V jVEETT/TKC4SkxyIxDOlqyo/pkg8Ev0jA0wl9hr5ZhGGzZO+Pi4= =wJkV -----END PGP SIGNATURE----- --D+fcsBiBpKtbCaWI--