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=202502 header.b=UC8ug4mp; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id B728D5A004E for ; Mon, 03 Feb 2025 03:25:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1738549501; bh=zgnJUtIazlRlJdEKBI6TqK6wbYTl8ETxfJy58gwLJ8Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UC8ug4mpSFSXz5uOLkf9q1wfMh6ZNrhjH6Eeg8SXbafQVqSykiXOpycS8iautcYuY BvzizFoYoCGYXkutPF6+FZJVZd3lO7rTjwqyDaYwWqi1udy8VBZ1vuWGqLRe4aRnl7 hb3P69acBiaJTjg89DXwZNRgifVEpriZWLwceI3uEAMIh9RLNwpwGRpISgGSlbdGbI +M0PvUwQSa7eQUN4GtHTab6IptxcBjFYMlnhh4HemicWeRZqSlycFrba4862pLrn61 8TL/sgwEWS0rrfngG7v3N4nimClwI21S+nRtmvhjFSo8iqUqAcbeMnKpLeU0kkK4o0 N6gF//HqmDyaw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YmVhF0C1Vz4wj2; Mon, 3 Feb 2025 13:25:01 +1100 (AEDT) Date: Mon, 3 Feb 2025 13:18:10 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v3 00/20] Draft, incomplete series introducing state migration Message-ID: References: <20250131193953.3034031-1-sbrivio@redhat.com> <20250201084518.04689645@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xE85kejxDv31WEtx" Content-Disposition: inline In-Reply-To: <20250201084518.04689645@elisabeth> Message-ID-Hash: FZG2LSWYFMLYPJBHKOLFU4ARBQB5FPFP X-Message-ID-Hash: FZG2LSWYFMLYPJBHKOLFU4ARBQB5FPFP 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: --xE85kejxDv31WEtx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 01, 2025 at 08:45:18AM +0100, Stefano Brivio wrote: > On Fri, 31 Jan 2025 20:39:33 +0100 > Stefano Brivio wrote: >=20 > > What clearly needs changes: >=20 > Maybe something less elegant but actually functional like: >=20 > --- > static int migrate_data_v1(int fd, struct ctx *c, bool target) > { > struct iovec context[] { /* All these need to be network endian */ > c->hash_secret, sizeof(c->hash_secret), > c->ipv4.addr_seen, sizeof(c->ipv4.addr_seen), > c->ipv6.addr_seen, sizeof(c->ipv6.addr_seen), > c->ipv6.addr_ll_seen, sizeof(c->ipv6.addr_ll_seen), > /* Leave NDP's next_ra alone, start from 0 */ > &log_written /* Drop static */ sizeof(log_written), > }; > int rc; >=20 > if (target) > rc =3D read_remainder(fd, context, ARRAY_SIZE(context), 0); > else > rc =3D write_remainder(fd, context, ARRAY_SIZE(context), 0); >=20 > if (rc) > return errno; >=20 > if (target) > return flow_migrate_data_target_v1(fd, c); > return flow_migrate_data_source_v1(fd, c); > } > --- >=20 > and: >=20 > --- > struct tcp_flow_transfer_v1 { > struct flow_common f; >=20 > uint8_t retrans; >=20 > uint16_t ws_from_tap; /* All BE */ > uint16_t ws_to_tap; > uint16_t tap_mss; >=20 > ... > } __attribute__((packed)); >=20 > union flow_transfer_v1 { > struct tcp_flow_transfer_v1 tcp; > ... > }; >=20 > int flow_migrate_data_source_v1(int fd, struct ctx *c) > { > for_each_active_flow(flowtab) { > union flow_transfer_v1 d; >=20 > switch (flow->f.type) { > case FLOW_TCP: > d.tcp.f =3D flow->f; > d.tcp.retrans =3D flow->tcp.retrans; > d.tcp.ws_from_tap =3D htons(d.tcp.ws_from_tap); > ...; >=20 > /* Fetch window stuff, socket must be in repair mode */ >=20 > send(...); > } >=20 > int flow_migrate_data_target_v1(int fd, struct ctx *c) > { > ... > } >=20 > And I'm not sure about "[PATCH 0/2] Fancier version handling for > migration": perhaps we could switch to something radically easier > from the beginning. I mean, as we have to drop the declarative > approach altogether, at least let's minimise LoCs... Yeah, I think I have a better idea that kind of covers both of these. Patches shortly, I hope. --=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 --xE85kejxDv31WEtx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmegJ2EACgkQzQJF27ox 2GcxKw/+KWXAqu/AxeeLcDbRBrPONz3sv25jCLc2qeUCJo+UC9yyyrpN/sN+At0Y d/SL59CQEwDS/AmiUnznudfdxptzNzrBFfx9AY6GobAF3ktWaAcFn04JyL3HDsPa 8ezn4EKtMQ/c7SH7Dq2yvbbVfQrNZjadqgJUf6i1hEUrni8DeqkUaVtqianhr1KM qhZ/G0vcB19+x2Xr9F2XW/rlhhQzK4X7Hf001iJQlZEUoys9ru8TN9U6eXDg+KXU pVK2/YztkPShAtBulGYSeVdbCYqW8syyTzxBPQJEAvCC5KDh0SMrS1JV2jQ0lE8W LBtVWVekCHxzM4VV9RHlBnuanf7HWg4cK+0N6RqtslX8PaqpVG0TUsBiz8VDVSrh ctvHr+3mF3sCDtEfz1fVRKRri1fp+NXV2FSck+kSdkv/0M+GqwSz62m6TROuf9tV +8QEiFoQuGZYcAwCfIAANL0FQZTk3s9WnbkwBCZP8QtFiWV7TkuATj2PBltCGtWn pEnMCa61zq0tLLjvkhIv7Zm0bKjCvGxujp7DlYFXXqIkdr370MHuIRY21M1411BU jN5diLZ9d+Qo/Pas8uavNDzVZGy/y7liTh2XDCSZqfNieKnT8C20+REn/uBBdn/6 A+An7VgOdGj/4qwCmvRsujkWBhvO5E3V41/SfJqve7HDi9pXttY= =Ivuf -----END PGP SIGNATURE----- --xE85kejxDv31WEtx--