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=AolGo3vx; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id CA9CD5A0272 for ; Wed, 05 Feb 2025 12:55:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1738756509; bh=NmcJVvHBmqK/Xblo2JDNmc1DfFkKF/xgw3Ka3RQWMC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AolGo3vxn0cYC1SXGKjCz3NBHIoVkLEnO7ib/G9q8uyvuI0hWkzNXfkkcq46WkR23 IPZnVC7sH8r/R32LjOEcyQFn0XMmBadFiMgSyLwcV2ufDhDeauNBJcc5L/eR1v9EDE RRYDJtHRAlopYFJtAZgEetol9m6z2GkAJwaHDgEygKnZxYyqjJuRK2GAYFOW/nKBaA yelb4UckoIcfN6B4H82yHa3ZvbIm+EFZvckgoysp4F9ba4NW5onVhWug7uO7hv7KWJ Jj5L/Rc1GxTytDBFuE+1JALBpnei/TVil8DktGJnq2lLPa3AR2L47lB9OKnvGH79AM tOG4JTQqksgVw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YnzF90ZlDz4wyk; Wed, 5 Feb 2025 22:55:09 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v7 4/5] migrate: Hack for late migration fixups Date: Wed, 5 Feb 2025 22:55:15 +1100 Message-ID: <20250205115516.843610-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250205115516.843610-1-david@gibson.dropbear.id.au> References: <20250205115516.843610-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: VVIIFOPWKEW7EQDC22D2SXLPO7TOHHYR X-Message-ID-Hash: VVIIFOPWKEW7EQDC22D2SXLPO7TOHHYR 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: David Gibson 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: Abuse the VHOST_USER_SEND_RARP command to do operations that need to happen very late on the target side migration. Nothing is in there now and with some luck we'll be able to drop this completely before merge. Signed-off-by: Stefano Brivio Signed-off-by: David Gibson --- migrate.c | 11 +++++++++++ migrate.h | 1 + vhost_user.c | 3 +++ 3 files changed, 15 insertions(+) diff --git a/migrate.c b/migrate.c index 4f910b57..c875eb28 100644 --- a/migrate.c +++ b/migrate.c @@ -273,3 +273,14 @@ void migrate_handler(struct ctx *c) c->device_state_result = rc; } + +/** + * migrate_finish() - Hack to connect() migrated sockets from "RARP" trigger + * @c: Execution context + */ +void migrate_finish(struct ctx *c) +{ + (void)c; + + /* HACK RARP: flow_migrate_target_post(c); */ +} diff --git a/migrate.h b/migrate.h index a5861120..5311f0e0 100644 --- a/migrate.h +++ b/migrate.h @@ -52,5 +52,6 @@ void migrate_init(struct ctx *c); void migrate_close(struct ctx *c); void migrate_request(struct ctx *c, int fd, bool target); void migrate_handler(struct ctx *c); +void migrate_finish(struct ctx *c); #endif /* MIGRATE_H */ diff --git a/vhost_user.c b/vhost_user.c index 8077f1d8..afc977b8 100644 --- a/vhost_user.c +++ b/vhost_user.c @@ -995,6 +995,9 @@ static bool vu_send_rarp_exec(struct vu_dev *vdev, eth_ntop((unsigned char *)&msg->payload.u64, macstr, sizeof(macstr))); + /* Abuse this as trigger to finally connect() migrated sockets */ + migrate_finish(vdev->context); + return false; } -- 2.48.1