netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: netdev@vger.kernel.org, xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org, jgross@suse.com,
	boris.ostrovsky@oracle.com, sstabellini@kernel.org,
	davem@davemloft.net
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Subject: Re: [Xen-devel][PATCH] xen/netfront: Remove unneeded .resume callback
Date: Thu, 14 Mar 2019 15:50:10 +0200	[thread overview]
Message-ID: <5c8dd6fa-7173-6618-ef4e-018c0be20028@gmail.com> (raw)
In-Reply-To: <20190314131749.25706-1-andr2000@gmail.com>

I am still confused about suspend/resume for the front drivers,
for instance, block front [1] does implement full/proper reconnect
on .resume, but net front only does this partially.

Could anyone please shed some light on suspend/resume design?

Thank you,
Oleksandr

On 3/14/19 3:17 PM, Oleksandr Andrushchenko wrote:
> 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,
>   };
>   

[1] 
https://elixir.bootlin.com/linux/v5.0.2/source/drivers/block/xen-blkfront.c#L2072

  reply	other threads:[~2019-03-14 13:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 13:17 [Xen-devel][PATCH] xen/netfront: Remove unneeded .resume callback Oleksandr Andrushchenko
2019-03-14 13:50 ` Oleksandr Andrushchenko [this message]
2019-03-14 14:47 ` Boris Ostrovsky
2019-03-14 14:52   ` Oleksandr Andrushchenko
2019-03-14 15:02     ` Boris Ostrovsky
2019-03-14 15:10       ` 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 19:00           ` [Xen-devel] [PATCH] " Julien Grall
2019-03-18 10:02             ` Oleksandr Andrushchenko
2019-03-20  3:50               ` Munehisa Kamata
2019-03-22 10:44                 ` Oleksandr Andrushchenko
     [not found]                   ` <20190325173011.GA20277@kaos-source-ops-60001.pdx1.amazon.com>
2019-03-27  6:40                     ` Oleksandr Andrushchenko
     [not found]                       ` <20190328231928.GA5172@kaos-source-ops-60001.pdx1.amazon.com>
2019-05-16  6:26                         ` Oleksandr Andrushchenko
2019-05-30 12:32                           ` Agarwal, Anchal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c8dd6fa-7173-6618-ef4e-018c0be20028@gmail.com \
    --to=andr2000@gmail.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=davem@davemloft.net \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).