From nobody Sun May 5 12:43:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@amazon.de; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=amazon.de ARC-Seal: i=1; a=rsa-sha256; t=1671464274; cv=none; d=zohomail.com; s=zohoarc; b=CYeGeDUFUjKsj3yFQkrGRC+8yd6OpTYE59rG7Zk1K/FkrrJI70lcroL8IyNQpcYKbxnPAGi1+UB1+FJGAqfYfRM0/IsNOyT80TtrkqL2pRdHfXfeeJXU+HojMHe/kjvZ1JPeJFtGNftF7X7Ts0OF8/WIvs/2HzaXVnbOPBn/sU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671464274; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=9p+mxbd5kh6SOfLyESUFNEms88GQjCAKJPms8yWVsvk=; b=EggblEWO+uHrf5TrQYHzv0y1GzpSHagzC7z15lYg42zdsHdfX/Q11neg4E7bhuyWP+i3coM/N5h0OH1ul+MJ/frcXtmkvCHIZSGSg0oxXsGpUCpkLdnD8DIQB0jvKCoC1lc6cnsgp/KPoz9rGK41Wc4H26UxFBUWlfTIAqt0mxk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@amazon.de; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1671464274542932.0228189367675; Mon, 19 Dec 2022 07:37:54 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.466224.725085 (Exim 4.92) (envelope-from ) id 1p7ICi-0007hd-W0; Mon, 19 Dec 2022 15:37:24 +0000 Received: by outflank-mailman (output) from mailman id 466224.725085; Mon, 19 Dec 2022 15:37:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7ICi-0007hW-TK; Mon, 19 Dec 2022 15:37:24 +0000 Received: by outflank-mailman (input) for mailman id 466224; Mon, 19 Dec 2022 15:37:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7ICh-0007hQ-B9 for xen-devel@lists.xenproject.org; Mon, 19 Dec 2022 15:37:23 +0000 Received: from smtp-fw-6001.amazon.com (smtp-fw-6001.amazon.com [52.95.48.154]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 06c38a81-7fb3-11ed-8fd4-01056ac49cbb; Mon, 19 Dec 2022 16:37:22 +0100 (CET) Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-pdx-2b-m6i4x-0ec33b60.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 15:37:16 +0000 Received: from EX13D31EUA004.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2b-m6i4x-0ec33b60.us-west-2.amazon.com (Postfix) with ESMTPS id 3DFD6A2BBC; Mon, 19 Dec 2022 15:37:15 +0000 (UTC) Received: from EX19D008EUA004.ant.amazon.com (10.252.50.158) by EX13D31EUA004.ant.amazon.com (10.43.165.161) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 19 Dec 2022 15:37:14 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX19D008EUA004.ant.amazon.com (10.252.50.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.20; Mon, 19 Dec 2022 15:37:13 +0000 Received: from dev-dsk-ptyadav-1c-37607b33.eu-west-1.amazon.com (10.15.11.255) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Mon, 19 Dec 2022 15:37:12 +0000 Received: by dev-dsk-ptyadav-1c-37607b33.eu-west-1.amazon.com (Postfix, from userid 23027615) id A716920D70; Mon, 19 Dec 2022 16:37:11 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Inumbo-ID: 06c38a81-7fb3-11ed-8fd4-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1671464242; x=1703000242; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=9p+mxbd5kh6SOfLyESUFNEms88GQjCAKJPms8yWVsvk=; b=M+kHiWP0gtF7w4GQfFUWZ8fcdje43sTRzeeIFWcMwscaKG9ZRLFv3Lcu RXy3aOfqCQl2Pr3SIwqZONBklRlsxgVwCPr2ByZPf7GROAfXJW/2LWnO2 Wgr7IO0svXfvRu+f02JwM7ipOuOpQxY+Ih6J23m9nfgVblclozc08kHnt E=; X-IronPort-AV: E=Sophos;i="5.96,255,1665446400"; d="scan'208";a="280451857" From: Pratyush Yadav To: CC: Pratyush Yadav , Greg Kroah-Hartman , Wei Liu , Paul Durrant , "David S. Miller" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jakub Kicinski , "Sasha Levin" , Puranjay Mohan , Maximilian Heyne , Julien Grall , , , Subject: [PATCH 5.4] xen-netback: move removal of "hotplug-status" to the right place Date: Mon, 19 Dec 2022 16:37:10 +0100 Message-ID: <20221219153710.23782-1-ptyadav@amazon.de> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: Bulk X-ZohoMail-DKIM: pass (identity @amazon.de) X-ZM-MESSAGEID: 1671464276188100001 Content-Type: text/plain; charset="utf-8" The removal of "hotplug-status" has moved around a bit. First it was moved from netback_remove() to hotplug_status_changed() in upstream commit 1f2565780e9b ("xen-netback: remove 'hotplug-status' once it has served its purpose"). Then the change was reverted in upstream commit 0f4558ae9187 ("Revert "xen-netback: remove 'hotplug-status' once it has served its purpose""), but it moved the removal to backend_disconnect(). Then the upstream commit c55f34b6aec2 ("xen-netback: only remove 'hotplug-status' when the vif is actually destroyed") moved it finally back to netback_remove(). The thing to note being it is removed unconditionally this time around. The story on v5.4.y adds to this confusion. Commit 60e4e3198ce8 ("Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"") is backported to v5.4.y but the original commit that it tries to revert was never present on 5.4. So the backport incorrectly ends up just adding another xenbus_rm() of "hotplug-status" in backend_disconnect(). Now in v5.4.y it is removed in both backend_disconnect() and netback_remove(). But it should only be removed in netback_remove(), as the upstream version does. Removing "hotplug-status" in backend_disconnect() causes problems when the frontend unilaterally disconnects, as explained in c55f34b6aec2 ("xen-netback: only remove 'hotplug-status' when the vif is actually destroyed"). Remove "hotplug-status" in the same place as it is done on the upstream version to ensure unilateral re-connection of frontend continues to work. Fixes: 60e4e3198ce8 ("Revert "xen-netback: remove 'hotplug-status' once it = has served its purpose"") Signed-off-by: Pratyush Yadav --- drivers/net/xen-netback/xenbus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xen= bus.c index 44e353dd2ba1..43bd881ab3dd 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -202,10 +202,10 @@ static int netback_remove(struct xenbus_device *dev) set_backend_state(be, XenbusStateClosed); unregister_hotplug_status_watch(be); + xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); if (be->vif) { kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); xen_unregister_watchers(be->vif); - xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); xenvif_free(be->vif); be->vif =3D NULL; } @@ -435,7 +435,6 @@ 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 */ -- 2.38.1