[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9AAE0902D5BC7E449B7C8E4E778ABCD0111C7D@AMSPEX01CL01.citrite.net>
Date: Tue, 24 Sep 2013 15:30:36 +0000
From: Paul Durrant <Paul.Durrant@...rix.com>
To: Wei Liu <wei.liu2@...rix.com>
CC: "xen-devel@...ts.xen.org" <xen-devel@...ts.xen.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Ian Campbell <Ian.Campbell@...rix.com>,
Wei Liu <wei.liu2@...rix.com>,
David Vrabel <david.vrabel@...rix.com>
Subject: RE: [PATCH net v3 1/1] xen-netback: Handle backend state
transitions in a more robust way
> -----Original Message-----
> From: Wei Liu [mailto:wei.liu2@...rix.com]
> Sent: 24 September 2013 16:26
> To: Paul Durrant
> Cc: xen-devel@...ts.xen.org; netdev@...r.kernel.org; Ian Campbell; Wei Liu;
> David Vrabel
> Subject: Re: [PATCH net v3 1/1] xen-netback: Handle backend state
> transitions in a more robust way
>
> On Tue, Sep 24, 2013 at 03:51:22PM +0100, Paul Durrant wrote:
> > When the frontend state changes metback now specifies its desired state
> to
> netback
> > a new function, set_backend_state(), which transitions through any
> [...]
> > +/* Handle backend state transitions:
> > + *
> > + * The backend state starts in InitWait and the following transtions are
> transitions
> > + * allowed.
> >
> [...]
> > @@ -363,7 +448,9 @@ static void hotplug_status_changed(struct
> xenbus_watch *watch,
> > if (IS_ERR(str))
> > return;
> > if (len == sizeof("connected")-1 && !memcmp(str, "connected", len))
> {
> > - xenbus_switch_state(be->dev, XenbusStateConnected);
> > + /* Complete any pending state change */
> > + xenbus_switch_state(be->dev, be->state);
> > +
>
> The state transition takes place iff hotplug status is "connected", is
> this desirable? What if hotplug fails?
>
The xenbus state will remain in InitWait but the backend state will be Connected.
> If it cycles through connect again it looks like it will trigger that
> BUG_ON in connect()?
>
No, I don't think so because be->state is not the same as dev->state. The frontend can go to Closing/Closed (which will take dev->state to Closing/Closed) and this should be fine.
Paul
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists