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=I46odwHz; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id DBA1F5A0622 for ; Tue, 28 Jan 2025 02:52:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202412; t=1738029115; bh=ddAH3mYsHi9iX+P9lNHc6yuzixEwncByEl2QegDo3Lk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I46odwHzviud2BTDeljbrKDZp5egMajaFPhYfmLRWwqDBUCSlVm9JiVPxIp7l7Q1b qC0rp9XS/1y5lJt6D+0qN1DOJPgVQqGClIR3p0yjD6V55W0kcNonwtEAw2oTANcTEd 4DiST0993CoFbb0GakAqdhQ9fumq9wHV6GDhemp7idjY19oFY0PniQGBf6HYnZHNEN pPmXNzmUKxpxoZ3JAVmzfRigWr1D9pYo6hv4RNcZAN0o3PY0O9Mp/l5oJbCk0ibpj7 5i3X0L9paTBz8kxwrRg+TV6PTyS4gtzPGxkrFxMr0KIQjrVHTn8zKGtqPcAPY4xu5a Vf3Yx7Vse0ZgQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YhpDq6nTRz4wxm; Tue, 28 Jan 2025 12:51:55 +1100 (AEDT) Date: Tue, 28 Jan 2025 11:49:16 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 1/7] icmp, udp: Pad time_t timestamp to 64-bit to ease state migration Message-ID: References: <20250127231532.672363-1-sbrivio@redhat.com> <20250127231532.672363-2-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AFJ/j0xxRXlbnpPU" Content-Disposition: inline In-Reply-To: <20250127231532.672363-2-sbrivio@redhat.com> Message-ID-Hash: 6X3MQ3SH4XWXE3Z7S2V2LH7LH3KJ5PNM X-Message-ID-Hash: 6X3MQ3SH4XWXE3Z7S2V2LH7LH3KJ5PNM 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: --AFJ/j0xxRXlbnpPU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 28, 2025 at 12:15:26AM +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. As discussed on the call, I think there are broader problems with transferring timestamps than just the structure size. So I'm hoping we can work out how to not transfer them at all and avoid this change. > 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 > --- > 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 --AFJ/j0xxRXlbnpPU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmeYKX0ACgkQzQJF27ox 2GeOsxAAgoyEFnaX/jjD3ErVXbJvArvc1uq5hxmUPag5VKuWL0RXn5Yqmiy6BB9w raLSyV4o3k2qmVyp47Dm6NASPIMxpnbg47u3GvB8jacfIbsTdneZxFIqIJ3oynAx RC9maBMts2jyVMv7pFqVpe4DHP9aknMDOLPlf9jqdkovcOBhbaPUtqKLQkNBZen3 Ddq4k5J8Nr14BD1t/qCncK4wWkYCxAm/XsK+P7mnwtRvtlZ6v72Py0AdMa8B/A9V wF2Vc9uI1tP6Yib/Wm7X/ILiZoLKXenc7XDI494wZgAglCx7Z5j+1Z10Hxk/mWOM Gkp5ckrV6QMrskAhCdsl2KDbYGrWo4NfLyVY37ipRyyYLOqi5ftrM3g0LhXxDrbI frJf/cFicyInGSIERGi0wjfpYC4Nu9bHuzZdKkoZnNtuPwQIf4u3nVl3nzx07eCr xf8CVuvpWWY1+vv457MC2WNbhPmClOPDabC8c7QVJ/ePyvWIse7v5gqbUTmgvjM9 gwB3pXHIFHxG7eD7kmHp2YV0P6HcLfeINQS75MGiDVFObItT6aCIGX/44iMZiP9E MUUwXoX07u26fx9qpNP5OPPsr5N/qJc/rX5O7ljOGp6UsDTmOaABCgQYGc11/JNH HGSjc8LSe+fN1UFEXnf8BiSqmX5wAiQHpvuVWC9bLHYm0Vps7z4= =USef -----END PGP SIGNATURE----- --AFJ/j0xxRXlbnpPU--