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=202412 header.b=mmd+bVGA; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 5B8FB5A026F for ; Wed, 29 Jan 2025 05:00:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202412; t=1738123240; bh=YYHQUhaqWy+9nbuX9mCoxM0jVfesVojd+BkFA9NL3Ys=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mmd+bVGAEyr0eY40Srm9yZx0668n+jPUHixXJhMA/i0I+ABGTtgQ9QApdadX+9Yb/ 8qCMHgP06TdXIKtklPUuPfFZdPieUNJEOH+ipwo7Cv9/Miq57oDgoHWkO8AnfUir6/ xCIIEaOD9rl0kN502tXUXwV2GnHmkagXGYVLNNz48ENC3aZYhWABCPnPkDPGTB7Xi4 76i9x/TwRd0hDWwwqHplrGjfRx3JYTfs6ErHdNoYGNUauLefvg+nsWNtLw6SCBT+5v i4DdVhaObeKQK6mwUaDEwSX6FGI3Ajuo6glOVqLnp2osh1LMf6AkAzshyz2elvKyFM RJRAQcE05XXGw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YjT2w4RWzz4wxx; Wed, 29 Jan 2025 15:00:40 +1100 (AEDT) Date: Wed, 29 Jan 2025 12:34:48 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v2 1/8] icmp, udp: Pad time_t timestamp to 64-bit to ease state migration Message-ID: References: <20250128233940.1235855-1-sbrivio@redhat.com> <20250128233940.1235855-2-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Oxh6WW69Yks0kaWB" Content-Disposition: inline In-Reply-To: <20250128233940.1235855-2-sbrivio@redhat.com> Message-ID-Hash: 6PS55EI3ESPPFTZE7XMIXS2KHZCHFX6W X-Message-ID-Hash: 6PS55EI3ESPPFTZE7XMIXS2KHZCHFX6W 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, Laurent Vivier 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: --Oxh6WW69Yks0kaWB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 29, 2025 at 12:39:33AM +0100, Stefano Brivio wrote: > That's the only field in flows with different storage sizes depending > on the architecture: it's usually 4-byte wide on 32-bit architectures, > except for arc and x32 where it's 8 bytes, and 8-byte wide on 64-bit > machines. >=20 > By keeping flow entries the same size across architectures, we avoid > having to expand or shrink table entries upon migration. >=20 > Signed-off-by: Stefano Brivio Ugly, but necessary for this v1 approach. > --- > icmp_flow.h | 6 +++++- > udp_flow.h | 6 +++++- > 2 files changed, 10 insertions(+), 2 deletions(-) >=20 > diff --git a/icmp_flow.h b/icmp_flow.h > index fb93801..da7e255 100644 > --- a/icmp_flow.h > +++ b/icmp_flow.h > @@ -13,6 +13,7 @@ > * @seq: Last sequence number sent to tap, host order, -1: not sent yet > * @sock: "ping" socket > * @ts: Last associated activity from tap, seconds > + * @ts_storage: Pad @ts to 64-bit storage to keep state migration sane > */ > struct icmp_ping_flow { > /* Must be first element */ > @@ -20,7 +21,10 @@ struct icmp_ping_flow { > =20 > int seq; > int sock; > - time_t ts; > + union { > + time_t ts; > + uint64_t ts_storage; > + }; > }; > =20 > bool icmp_ping_timer(const struct ctx *c, const struct icmp_ping_flow *p= ingf, > diff --git a/udp_flow.h b/udp_flow.h > index 9a1b059..9cb79a0 100644 > --- a/udp_flow.h > +++ b/udp_flow.h > @@ -12,6 +12,7 @@ > * @f: Generic flow information > * @closed: Flow is already closed > * @ts: Activity timestamp > + * @ts_storage: Pad @ts to 64-bit storage to keep state migration sane > * @s: Socket fd (or -1) for each side of the flow > */ > struct udp_flow { > @@ -19,7 +20,10 @@ struct udp_flow { > struct flow_common f; > =20 > bool closed :1; > - time_t ts; > + union { > + time_t ts; > + uint64_t ts_storage; > + }; > int s[SIDES]; > }; > =20 --=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 --Oxh6WW69Yks0kaWB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmeZhbcACgkQzQJF27ox 2GfDTQ/8DRYX+I2u9yZGBIPXE0ePNySI8/MoKQQzCZYv94ch7Zxt6OeDwySgPrys kegvtdzEZ+D5njNmKGGw3G0h3jhQSEQfhQX7a4xVxwIXO5vmr/wUsdMZ1ulK/pdH 8QPaGlw+oIbYwf8eR35hd32O2vZd2duxzEOsc72PH1g8T2lJxiz/uppkxFVQdGIu ZUrJVHn+RjoqsNSL7X2jaN1X/lSOSZDoiVxHm3Fgt9Kp1FOyjhrLgN67TTFBz+AQ UDarguBmMCktQ9IC3asnFZv4UfDN+TOr1NiKC6BtAPtRhOekmXC4zUOtfq5kypc4 U60w6TawoU/t1LH3GMhWLxfRDCcBaGFk2pXFQ9pSVBDeZdfV2DzsLPP00D+3nb/L dfg4WF61h5TS/zfdOPdvIIl0pmNI1ExcUSXnnKGTdXZbgQzz1f0DQnSl9vKrBHjD V9jc12QAdljDyKo/yOg/pflfrposLlCiCYi5sN6SUOdiDqSkEswPW21FhR8irDeO e7xMfj43O2iqCrOwomW2GO41r/V9dsSsl6RPF17L1aNNrfF65uakQfsRqjQGs9o0 nG3d7IevzMttjn5Awf6+FwhQt/pe5k7qYxt1NjImWYHtRugXYEfycn6ht6DwRyhh 3YzDze2qQIRJXmlGCL9GBVAWYU+cynFxKqDanMN0TmxSyFmYfsg= =a+r8 -----END PGP SIGNATURE----- --Oxh6WW69Yks0kaWB--