From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82AE9C433EF for ; Tue, 1 Mar 2022 20:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238292AbiCAU1X (ORCPT ); Tue, 1 Mar 2022 15:27:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238364AbiCAUXH (ORCPT ); Tue, 1 Mar 2022 15:23:07 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F7097ED82; Tue, 1 Mar 2022 12:20:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7270461642; Tue, 1 Mar 2022 20:19:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A399BC36AE5; Tue, 1 Mar 2022 20:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646165957; bh=C+wyaY36ujuCY8gfIRQFdcYKiGxUSMFKCf8hXyx+qjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EozefPWiZWzcsW72npT0g2LHJhq4gIduBf6TcxikRU9VRRuAmTxr6ng6Lg+9MeOw2 IIwJZTsRuEB8ECqzd9DPiKAEen8bh6oQJ6KK+4BCNnr94DPgukC1YB+VpoMmDurooC Hg/4LGLC9i0nTTE8ddQ/VyY1giiAvg0h893Mv+F6v+wAnZ+Fj1NUNGqmxrt7h1dqXH QM0hCRtQ/Vs1rnELkF3B5q6w4LPRHJSIOjuxOcawLhXjJfbFJd4wO53gt+BiS2//G2 0MrutcmGKq7vdMSkJRq31vZhYWtvpEqEBiCIZYbYj84WNF137UiwNfwrp/NnaknUSt 8OZoBc00rjCwA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Paul Durrant , Jakub Kicinski , Sasha Levin , wei.liu@kernel.org, davem@davemloft.net, xen-devel@lists.xenproject.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 09/14] Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" Date: Tue, 1 Mar 2022 15:18:21 -0500 Message-Id: <20220301201833.18841-9-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220301201833.18841-1-sashal@kernel.org> References: <20220301201833.18841-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Marczykowski-Górecki [ Upstream commit 0f4558ae91870692ce7f509c31c9d6ee721d8cdc ] This reverts commit 1f2565780e9b7218cf92c7630130e82dcc0fe9c2. The 'hotplug-status' node should not be removed as long as the vif device remains configured. Otherwise the xen-netback would wait for re-running the network script even if it was already called (in case of the frontent re-connecting). But also, it _should_ be removed when the vif device is destroyed (for example when unbinding the driver) - otherwise hotplug script would not configure the device whenever it re-appear. Moving removal of the 'hotplug-status' node was a workaround for nothing calling network script after xen-netback module is reloaded. But when vif interface is re-created (on xen-netback unbind/bind for example), the script should be called, regardless of who does that - currently this case is not handled by the toolstack, and requires manual script call. Keeping hotplug-status=connected to skip the call is wrong and leads to not configured interface. More discussion at https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Paul Durrant Link: https://lore.kernel.org/r/20220222001817.2264967-1-marmarek@invisiblethingslab.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/xen-netback/xenbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 94d19158efc18..7acf3940dc1ff 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -256,6 +256,7 @@ static void backend_disconnect(struct backend_info *be) unsigned int queue_index; xen_unregister_watchers(vif); + xenbus_rm(XBT_NIL, be->dev->nodename, "hotplug-status"); #ifdef CONFIG_DEBUG_FS xenvif_debugfs_delif(vif); #endif /* CONFIG_DEBUG_FS */ @@ -675,7 +676,6 @@ static void hotplug_status_changed(struct xenbus_watch *watch, /* Not interested in this watch anymore. */ unregister_hotplug_status_watch(be); - xenbus_rm(XBT_NIL, be->dev->nodename, "hotplug-status"); } kfree(str); } -- 2.34.1