From patchwork Mon Dec 19 15:37:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Yadav X-Patchwork-Id: 34616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2461149wrn; Mon, 19 Dec 2022 07:43:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf53sV3TxvRONHR2utyKe+CQLRe30hCM9h/fRRB8Og7SFH2S+oLzu2q1AEulMIk2DVhnr+CA X-Received: by 2002:a62:1bd1:0:b0:575:fc29:90b9 with SMTP id b200-20020a621bd1000000b00575fc2990b9mr42061981pfb.22.1671464579870; Mon, 19 Dec 2022 07:42:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671464579; cv=none; d=google.com; s=arc-20160816; b=EcBE9Dd1crb+0+p9vu+74EhZ9RiYMw1dR0DtMuatQo7rmlOH/rVIgfQpnYSBrVL1OO hRaFpLYbVYIDvvHcSH0Tz0TY4Hu3IEhtfbHrZH2rmQlEOCJH2ma8Y61YvCRu0s6B5Dqe m+Ac7DmWjcHjy+wculrTJzOhxnFBY7VqFy7PgyF+deNYmyDXRFc2UasERrFo0Ixe3BVU FPe1YiaG7EiBPMHK/KnnPhk75HGf4I75NK/yYrdA07AMZhdrXQL0UUg7v4QCX34D/Nsm sq+AEIV/AoTdMXyUj5GDG5hyXFONEbl2Gt7L1feacbsSyGTiEXRXgv3cVxhoOiEY+lSp KyVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9p+mxbd5kh6SOfLyESUFNEms88GQjCAKJPms8yWVsvk=; b=evlenv6hiRlRO7uo/1EOMpCVuCKOlTZhuNrzqGBz5lmDBXyHJBlZpwGdFp9asnJxpQ gMhPv1LtuuWlEvvqvRmnFG0SsVAjvV9N8LtFPDASscmgKH/cUrJD6Dtodoo1hQ3g2Ze7 8Pc1z3/v58jnqE+q6LZvk1jOmDum0TDrCs2CRQhfwu/mYB9Yxf+QqjLZuYgNdLZbImuW a6DDKkp/c/2QCH8SEnsPwiylsMU/VWKeJ0TvlhIl01XKmFhOxxTdREWAgHxdnHWlGz0X LZ9YbeA64NELbGfWxkwmvtD6IAs0saPJAPsARn8JMV7zjs+NP0b77o7V8m2nuP/ZCJYS brvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=oMQV3JCJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g195-20020a6252cc000000b00541c0da3083si10370047pfb.302.2022.12.19.07.42.46; Mon, 19 Dec 2022 07:42:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=oMQV3JCJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232171AbiLSPhZ (ORCPT + 99 others); Mon, 19 Dec 2022 10:37:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbiLSPhX (ORCPT ); Mon, 19 Dec 2022 10:37:23 -0500 Received: from smtp-fw-6001.amazon.com (smtp-fw-6001.amazon.com [52.95.48.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BA91FCE2; Mon, 19 Dec 2022 07:37:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1671464241; x=1703000241; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=9p+mxbd5kh6SOfLyESUFNEms88GQjCAKJPms8yWVsvk=; b=oMQV3JCJM7WJ12K6f01S4tuvmp5Z6DYNPivvPll4s4vCaM542QfpRKuZ PgdUWXgJDtHvU4dtjh8+E0mf6Se1u8fsKqJrTc10X50/a/3SNm0eTCBgE 8MUWnS/aikUQmlwM8+CocSLtQSg5cwvrsvCRwQkNlHR4tFUuZ3gnxxlaA s=; X-IronPort-AV: E=Sophos;i="5.96,255,1665446400"; d="scan'208";a="280451857" 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) From: Pratyush Yadav To: CC: Pratyush Yadav , Greg Kroah-Hartman , Wei Liu , Paul Durrant , "David S. Miller" , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=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 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752657643172330296?= X-GMAIL-MSGID: =?utf-8?q?1752657643172330296?= 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(-) -- 2.38.1 diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.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 = 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 */