All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel][PATCH] xen/netfront: Remove unneeded .resume callback
@ 2019-03-14 13:17 Oleksandr Andrushchenko
  2019-03-14 13:50 ` [PATCH] " Oleksandr Andrushchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 39+ messages in thread
From: Oleksandr Andrushchenko @ 2019-03-14 13:17 UTC (permalink / raw)
  To: netdev, xen-devel, linux-kernel, jgross, boris.ostrovsky,
	sstabellini, davem
  Cc: andr2000, Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Currently on driver resume we remove all the network queues and
destroy shared Tx/Rx rings leaving the driver in its current state
and never signaling the backend of this frontend's state change.
This leads to the number of consequences:
- when frontend withdraws granted references to the rings etc. it cannot
  be cleanly done as the backend still holds those (it was not told to
  free the resources)
- it is not possible to resume driver operation as all the communication
  means with the backned were destroyed by the frontend, thus
  making the frontend appear to the guest OS as functional, but
  not really.

Fix this by not destroying communication channels/rings on driver
resume.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
 drivers/net/xen-netfront.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index c914c24f880b..2ca162048da4 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1422,22 +1422,6 @@ static void xennet_disconnect_backend(struct netfront_info *info)
 	}
 }
 
-/**
- * We are reconnecting to the backend, due to a suspend/resume, or a backend
- * driver restart.  We tear down our netif structure and recreate it, but
- * leave the device-layer structures intact so that this is transparent to the
- * rest of the kernel.
- */
-static int netfront_resume(struct xenbus_device *dev)
-{
-	struct netfront_info *info = dev_get_drvdata(&dev->dev);
-
-	dev_dbg(&dev->dev, "%s\n", dev->nodename);
-
-	xennet_disconnect_backend(info);
-	return 0;
-}
-
 static int xen_net_read_mac(struct xenbus_device *dev, u8 mac[])
 {
 	char *s, *e, *macstr;
@@ -2185,7 +2169,6 @@ static struct xenbus_driver netfront_driver = {
 	.ids = netfront_ids,
 	.probe = netfront_probe,
 	.remove = xennet_remove,
-	.resume = netfront_resume,
 	.otherend_changed = netback_changed,
 };
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 39+ messages in thread
* [PATCH] xen/netfront: Remove unneeded .resume callback
@ 2019-03-14 13:17 Oleksandr Andrushchenko
  0 siblings, 0 replies; 39+ messages in thread
From: Oleksandr Andrushchenko @ 2019-03-14 13:17 UTC (permalink / raw)
  To: netdev, xen-devel, linux-kernel, jgross, boris.ostrovsky,
	sstabellini, davem
  Cc: andr2000, Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

Currently on driver resume we remove all the network queues and
destroy shared Tx/Rx rings leaving the driver in its current state
and never signaling the backend of this frontend's state change.
This leads to the number of consequences:
- when frontend withdraws granted references to the rings etc. it cannot
  be cleanly done as the backend still holds those (it was not told to
  free the resources)
- it is not possible to resume driver operation as all the communication
  means with the backned were destroyed by the frontend, thus
  making the frontend appear to the guest OS as functional, but
  not really.

Fix this by not destroying communication channels/rings on driver
resume.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
 drivers/net/xen-netfront.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index c914c24f880b..2ca162048da4 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1422,22 +1422,6 @@ static void xennet_disconnect_backend(struct netfront_info *info)
 	}
 }
 
-/**
- * We are reconnecting to the backend, due to a suspend/resume, or a backend
- * driver restart.  We tear down our netif structure and recreate it, but
- * leave the device-layer structures intact so that this is transparent to the
- * rest of the kernel.
- */
-static int netfront_resume(struct xenbus_device *dev)
-{
-	struct netfront_info *info = dev_get_drvdata(&dev->dev);
-
-	dev_dbg(&dev->dev, "%s\n", dev->nodename);
-
-	xennet_disconnect_backend(info);
-	return 0;
-}
-
 static int xen_net_read_mac(struct xenbus_device *dev, u8 mac[])
 {
 	char *s, *e, *macstr;
@@ -2185,7 +2169,6 @@ static struct xenbus_driver netfront_driver = {
 	.ids = netfront_ids,
 	.probe = netfront_probe,
 	.remove = xennet_remove,
-	.resume = netfront_resume,
 	.otherend_changed = netback_changed,
 };
 
-- 
2.21.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2019-05-30 12:32 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14 13:17 [Xen-devel][PATCH] xen/netfront: Remove unneeded .resume callback Oleksandr Andrushchenko
2019-03-14 13:50 ` [PATCH] " Oleksandr Andrushchenko
2019-03-14 13:50 ` [Xen-devel][PATCH] " Oleksandr Andrushchenko
2019-03-14 14:47 ` Boris Ostrovsky
2019-03-14 14:52   ` [PATCH] " Oleksandr Andrushchenko
2019-03-14 14:52   ` [Xen-devel][PATCH] " Oleksandr Andrushchenko
2019-03-14 15:02     ` [PATCH] " Boris Ostrovsky
2019-03-14 15:02     ` [Xen-devel][PATCH] " Boris Ostrovsky
2019-03-14 15:10       ` [PATCH] " Oleksandr Andrushchenko
2019-03-14 15:10       ` [Xen-devel][PATCH] " Oleksandr Andrushchenko
2019-03-14 15:40         ` Boris Ostrovsky
2019-03-14 16:33           ` Oleksandr Andrushchenko
2019-03-14 18:16             ` Boris Ostrovsky
2019-03-14 18:20               ` Oleksandr Andrushchenko
2019-03-14 18:20               ` [PATCH] " Oleksandr Andrushchenko
2019-03-14 18:16             ` Boris Ostrovsky
2019-03-14 16:33           ` Oleksandr Andrushchenko
2019-03-14 19:00           ` [Xen-devel] " Julien Grall
2019-03-18 10:02             ` Oleksandr Andrushchenko
2019-03-18 10:02             ` [Xen-devel] " Oleksandr Andrushchenko
2019-03-20  3:50               ` Munehisa Kamata
2019-03-20  3:50               ` [Xen-devel] " Munehisa Kamata
2019-03-21 19:25                 ` Anchal Agarwal
2019-03-22 10:44                 ` Oleksandr Andrushchenko
2019-03-22 10:44                 ` [Xen-devel] " Oleksandr Andrushchenko
2019-03-25 17:30                   ` Anchal Agarwal
2019-03-27  6:40                     ` [Xen-devel] " Oleksandr Andrushchenko
2019-03-28 23:19                       ` Anchal Agarwal
2019-05-16  6:26                         ` Oleksandr Andrushchenko
2019-05-16  6:26                         ` [Xen-devel] " Oleksandr Andrushchenko
2019-05-16  6:26                           ` Oleksandr Andrushchenko
2019-05-30 12:32                           ` Agarwal, Anchal
2019-05-30 12:32                             ` Agarwal, Anchal
2019-05-30 12:32                           ` Agarwal, Anchal
2019-03-27  6:40                     ` Oleksandr Andrushchenko
2019-03-14 19:00           ` Julien Grall
2019-03-14 15:40         ` Boris Ostrovsky
2019-03-14 14:47 ` Boris Ostrovsky
2019-03-14 13:17 Oleksandr Andrushchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.