[SRU][jammy/linux-aws][kinetic/linux-aws][PATCH 19/20] UBUNTU: SAUCE: xen-netfront: call netif_device_attach on resume
Gerald Yang
gerald.yang at canonical.com
Wed Aug 17 08:51:49 UTC 2022
From: Frank van der Linden <fllinden at amazon.com>
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 <fllinden at amazon.com>
Reviewed-by: Alakesh Haloi <alakeshh at amazon.com>
Reviewed-by: Vallish Vaidyeshwara <vallish at amazon.com>
(cherry picked from commit d1b942fd87e869b26a5aa1abac29347dbff6ba43 amazon-5.15.y/mainline)
Signed-off-by: Gerald Yang <gerald.yang at canonical.com>
Signed-off-by: Matthew Ruffell <matthew.ruffell at canonical.com>
---
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();
--
2.34.1
More information about the kernel-team
mailing list