From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202508 header.b=o/sgfFCy; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 856015A0279 for ; Wed, 10 Sep 2025 03:53:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1757469228; bh=q4EFSNgxjiLOs93DjJRgD67slAQEGW6znpBQngV/hBQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=o/sgfFCylwPhWx4ZifsV6LKz61t5fh9p+9AWmgSiWE2Y0ShMNWVpJOgP7lC5FDbmS bSJ0d4eJzSSkAtouc3I0xfuUCt4voAa3KJn+AHI9xlutpO8Esn3ojLFg5dPpS4YHw4 gsc6cQaLti6qY/ATUCdpNosDbWKa6dO3HjQ/ET6VD5Oa3tn7osqRACWHsFClsGjSGO 4h1pyJki2G4kw3kMqvufbtfuWPbrwvpqlxqp9cEDbdNTXkb8KfvNeBnbzLhj17oAlt jZYSMemyhoMzswbmBMw8BeXwRaD1GB11c1xInl4mTOD6PpWKkgBGwgM40dA71PHTNz DqVcG0EwZ2a8A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cM3d85p1Kz4w9v; Wed, 10 Sep 2025 11:53:48 +1000 (AEST) Date: Wed, 10 Sep 2025 11:49:40 +1000 From: David Gibson To: Jon Maloy Subject: Re: [PATCH v5 02/10] fwd: Added cache table for ARP/NDP contents Message-ID: References: <20250906021154.2760611-1-jmaloy@redhat.com> <20250906021154.2760611-3-jmaloy@redhat.com> <491cd702-ddf6-4a9a-b44e-9385155266c5@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2RabcUQ4te3sHyuO" Content-Disposition: inline In-Reply-To: <491cd702-ddf6-4a9a-b44e-9385155266c5@redhat.com> Message-ID-Hash: 5PD4T7TTRJRWLMIWH7WI5HKQCSMT2XZV X-Message-ID-Hash: 5PD4T7TTRJRWLMIWH7WI5HKQCSMT2XZV 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: sbrivio@redhat.com, dgibson@redhat.com, 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: --2RabcUQ4te3sHyuO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 09, 2025 at 11:02:36AM -0400, Jon Maloy wrote: >=20 >=20 > On 2025-09-07 22:42, David Gibson wrote: > > On Fri, Sep 05, 2025 at 10:11:46PM -0400, Jon Maloy wrote: > > > We add a cache table to keep partial contents of the kernel ARP/NDP >=20 > [...] >=20 > > > + return mac_undefined(e->mac); > > > +} > > > + > > > +/** > > > + * mac_entry_expired() - Check if a cache entry has expired > > > + * @e: Cache entry > > > + * > > > + * Return: True if the entry has expired, false otherwise > > > + */ > > > +static bool mac_entry_expired(const struct mac_cache_entry *e) > > > +{ > > > + struct timespec now; > > > + > > > + clock_gettime(CLOCK_MONOTONIC, &now); > >=20 > > Mostly we try to keep to a single clock_gettime() call per epoll > > cycle, passing 'now' down to the things we call there. > >=20 > > > + return timespec_before(&e->expiry, &now); > > > +} >=20 > Passing this value along the whole call chain just for the unlikely case > that we may need it here seems like a bad idea, especially since the > performance gain is minimal. >=20 > It would make some sense if we add it to the context struct or even as a > global variable the set it in the main loop, and pass it along that way. > What do you think? Honestly, I prefer calling clock_gettime() again to adding another global or pseudo-global. --=20 David Gibson (he or they) | 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 --2RabcUQ4te3sHyuO Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjA2ScACgkQzQJF27ox 2Gd0ARAAkjr5AhkWcaEqDeeMR+ojWFPcMtgZLIgjnkyaAXWx9yThrW7cbAC/fw/J zex1S5Jt5EUnpUZnSf7RVWKcsuj4Kjg6QGRyAk1d1a+jXFYKI8KbVhlBFDqnIUpW oFvyFM04YI0bM+Qw1YCPksAe/GFHl4RTKYkpixqsaPDa+T+xU43odhwhjvTR9Dvy tnWdQFC2XZ4VPCkCLsoCYEgnqSyRMOQRDTmKjNFqIRadkn2j+LlkDFNIrOeIGTCK uhQiWQunZeneUYM88DU/1VcLfcwFTZauoruTddzPNLN8ef60gRPQbS3rUvdTXfhh bHZEiCr0SKD20CHO337m6+LLSwVkouBuLN2Kp+AktR3Lr4tT5eMfgd97lWNGb/l6 9qqTFZJpeeQbta1XbTuW+0ZmFOOaDLOXt9yR8lG9THh+Yf5MlawCVGFAOP8NDF0J zpuPserLN3jl0uSekf1DYrqYgBztvCfr/RIbqfXbswOIq9eQCmxNy82DLvKmha2u 6WCSEhXDYjVnPOIswy4TmEiNW6xQjHy8c1im5lAaw71Az10+eoo7wRDy4x2bwLbN PmEQdV35L+4Hw2JCaeFDXnP03D8zCmz+sR/v9i/MKIpZdBb4PV2lq0krg8Oi6DaS m6vksLC62aIJIT04ZU4f4gS3E95trg7D76ZtoM0UhgD7HRMoiSQ= =g+YL -----END PGP SIGNATURE----- --2RabcUQ4te3sHyuO--