netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>, <netdev@vger.kernel.org>,
	<xen-devel@lists.xen.org>, Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH net-next 1/2] xen-netback: add a vif-is-connected flag
Date: Fri, 20 Sep 2013 15:28:55 +0100	[thread overview]
Message-ID: <523C5BA7.2010500@citrix.com> (raw)
In-Reply-To: <20130920133106.GB457@zion.uk.xensource.com>

On 20/09/13 14:31, Wei Liu wrote:
> On Fri, Sep 20, 2013 at 01:56:30PM +0100, Paul Durrant wrote:
>> Having applied my patch to separate vif disconnect and free, I ran into a
>> BUG when testing resume from S3 with a Windows frontend because the vif task
>> pointer was not cleared by xenvif_disconnect() and so a double call to this
>> function tries to stop the thread twice.
>> Rather than applying a point fix for that issue it seems better to introduce
>> a boolean to indicate whether the vif is connected or not such that repeated
>> calls to either xenvif_connect() or xenvif_disconnect() behave appropriately.

We already have a backend state of CONNECTED/CLOSED/etc. why do we need
an additional bit of state outside of this?

Does something like this in frontend_changed() fix it?

	case XenbusStateClosing:
                switch (dev->state) {
                case XenbusStateClosed;
                	break;
		case XenbusStateConnected:
			disconnect_backend(dev);
			/* fall through */
		default:
			xenbus_switch_state(dev, XenbusStateClosing);
			break;
		}
		break;

	case XenbusStateClosed:
                switch (dev->state) {
                case XenbusStateConnected;
			disconnect_backend(dev);
                	/* fall through */
		default:
			xenbus_switch_state(dev, XenbusStateClosed);
			break;
		}
		if (xenbus_dev_is_online(dev))
			break;
		/* fall through if not online */

Can you also remove destroy_backend()?  It's not needed any more.

I'd also recommend waiting a bit for other review feedback before
posting an updated series.

David

  reply	other threads:[~2013-09-20 14:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 12:56 [PATCH net-next 0/2] xen-netback: windows frontend compatibility fixes Paul Durrant
2013-09-20 12:56 ` [PATCH net-next 1/2] xen-netback: add a vif-is-connected flag Paul Durrant
2013-09-20 13:31   ` Wei Liu
2013-09-20 14:28     ` David Vrabel [this message]
2013-09-20 15:02       ` Paul Durrant
2013-09-20 12:56 ` [PATCH net-next 2/2] xen-netback: handle frontends that fail to transition through Closing Paul Durrant
2013-09-20 13:34   ` Wei Liu
2013-09-20 13:38     ` Paul Durrant
2013-09-20 13:38     ` David Vrabel
2013-09-20 13:40       ` Paul Durrant
2013-09-20 13:48       ` Wei Liu

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=523C5BA7.2010500@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.durrant@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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).