From patchwork Wed Aug 17 08:51:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerald Yang X-Patchwork-Id: 1667168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=ABI1VcIl; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4M71yR4Tkkz1ygF for ; Wed, 17 Aug 2022 18:53:35 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oOEnl-0003KE-V3; Wed, 17 Aug 2022 08:53:25 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oOEmn-0000lN-Ut for kernel-team@lists.ubuntu.com; Wed, 17 Aug 2022 08:52:26 +0000 Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 36C763F46B for ; Wed, 17 Aug 2022 08:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1660726343; bh=0zIjbsIDOOdPW8LRTb6q+6Xg2YPta4KM/gblbZTUX4s=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ABI1VcIl0NyR1wMcya3lnrHoIJzS91B6qIEpPTAJTpnGV3kmjP97wY7nOdF00NwKr uuuO39S9RtvA+NgkxsRlyxcuY11+BbYCL/KmaI5LRIZVqfkNAcF0iokTJWplJlVU3E 5abXCmJaOMqno4Txd3mYsfy4CN7Zqh58uuBl27tZVeFbAGZldN+cMx4+g9H58Nlo7W EMosw8Vyb3qDCkrNJs4sPT5wkWUUz6rpmlZQGcB3hcuofIghRS29XYdUdOUMYXG14s QT7nv7xHkjoTLei25dEPw9TA5GI2UNjgcJS/guC+ObArMy7xxdrVkG2UDLtw5SDLsx 9f9sesz7IcbiA== Received: by mail-pf1-f197.google.com with SMTP id s22-20020a056a00195600b0052ece6c829fso4744663pfk.6 for ; Wed, 17 Aug 2022 01:52:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=0zIjbsIDOOdPW8LRTb6q+6Xg2YPta4KM/gblbZTUX4s=; b=17Ng6/hKdbfRZggWaw7wCsHS/KvkZTAjlo6SBVDyggiij3BDBbtMuWW323O6X1Cm7K 2mmYE1z40ylGpzneDdFFz9xR+WH9y+eRAy0SEMIw6LSXpjAO3NHtVhApELUryxbwealJ PrLmP6skm+Psk1J/6JQoZp9VDSazTAMJpCNjle5T54Mq/LnpkxZtwrxTOtEwb5kH7V4o crunTx9cj4wyzazEni0WzeP1wKXrrgZqT5H6xiOCy6ju/NtIWT5FGtvDM8f+fAWPxfnC BNV1z7tLdEw3UDvJAfLVptz8Y15C58XWEgJVtzWBlCqYa8rBbNVo7bzxdDoH5Y00eTXe NT1A== X-Gm-Message-State: ACgBeo3KXYpif7F8Oa7aQmsFcPAzylHq3fPyai3dKWiuD1VCoos1Njyz QAbYChLBePATrpxPccJqtv6lCYObnrULnoXmERQIXm8opzTrS0SQKw+utcCpKH1iSePPZ1w0cyk l8oy15XLmwP+6/9+XCvEUuvb2Uv4SuoSvjs1jWk66Gg== X-Received: by 2002:a17:90b:4c07:b0:1f5:40a:8040 with SMTP id na7-20020a17090b4c0700b001f5040a8040mr2692973pjb.121.1660726341428; Wed, 17 Aug 2022 01:52:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR60OuqUfcdMUAjKQNkIRMeO6zps0Pzo1e88Wj8ZpU0MvTE6+p/luzrjcLUo9Qhp7byj+UBNNw== X-Received: by 2002:a17:90b:4c07:b0:1f5:40a:8040 with SMTP id na7-20020a17090b4c0700b001f5040a8040mr2692958pjb.121.1660726341048; Wed, 17 Aug 2022 01:52:21 -0700 (PDT) Received: from localhost.localdomain (220-135-31-21.hinet-ip.hinet.net. [220.135.31.21]) by smtp.gmail.com with ESMTPSA id s90-20020a17090a69e300b001f522180d46sm1001033pjj.8.2022.08.17.01.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 01:52:20 -0700 (PDT) From: Gerald Yang To: kernel-team@lists.ubuntu.com Subject: [SRU][jammy/linux-aws][kinetic/linux-aws][PATCH 19/20] UBUNTU: SAUCE: xen-netfront: call netif_device_attach on resume Date: Wed, 17 Aug 2022 16:51:49 +0800 Message-Id: <20220817085150.2078055-24-gerald.yang@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220817085150.2078055-1-gerald.yang@canonical.com> References: <20220817085150.2078055-1-gerald.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Frank van der Linden BugLink: https://bugs.launchpad.net/bugs/1968062 When xennet_connect is called in the resume path, it needs to re-attach the netif, otherwise it will no longer be found by various operations (such as ethtool ioctls, etc). Signed-off-by: Frank van der Linden Reviewed-by: Alakesh Haloi Reviewed-by: Vallish Vaidyeshwara (cherry picked from commit d1b942fd87e869b26a5aa1abac29347dbff6ba43 amazon-5.15.y/mainline) Signed-off-by: Gerald Yang Signed-off-by: Matthew Ruffell --- drivers/net/xen-netfront.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 0304fa9f40dc..8a0829aee3af 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -2501,6 +2501,13 @@ static int xennet_connect(struct net_device *dev) device_unregister(&np->xbdev->dev); return err; } + } else { + /* + * In the resume / thaw case, the netif needs to be + * reattached, as it was detached in netfront_freeze(). + */ + if (np->freeze_state == NETIF_FREEZE_STATE_FROZEN) + netif_device_attach(dev); } rtnl_lock();