From: David Vrabel <david.vrabel@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Ian Campbell <Ian.Campbell@citrix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Jan Beulich <jbeulich@suse.com>,
"Wei Liu (3P)" <wei.liu@citrix.com>
Subject: Re: [Xen-devel] [PATCH 2/2] xen-netback: cancel the credit timer when taking the vif down
Date: Thu, 14 Feb 2013 13:56:24 +0000 [thread overview]
Message-ID: <511CED08.9080902@citrix.com> (raw)
In-Reply-To: <1360849999.16636.135.camel@zion.uk.xensource.com>
On 14/02/13 13:53, Wei Liu wrote:
> On Thu, 2013-02-14 at 13:18 +0000, David Vrabel wrote:
>> From: David Vrabel <david.vrabel@citrix.com>
>>
>> If the credit timer is left armed after calling
>> xen_netbk_remove_xenvif(), then it may fire and attempt to schedule
>> the vif which will then oops as vif->netbk == NULL.
>>
>> This may happen both in the fatal error path and during normal
>> disconnection from the front end.
>>
>> The sequencing during shutdown is critical to ensure that: a)
>> vif->netbk doesn't become unexpectedly NULL; and b) the net device/vif
>> is not freed.
>>
>> 1. Mark as unschedulable (netif_carrier_off()).
>> 2. Synchronously cancel the timer.
>> 3. Remove the vif from the schedule list.
>> 4. Remove it from it netback thread group.
>> 5. Wait for vif->refcnt to become 0.
>>
>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
>
> You would need to reinitialize the timer in xenvif_up, given that user
> might `ifconfig vifX.X down; ifconfig vifX.X up`.
No. Deleted timers do not need to be reinitialized. The timer will be
armed as usual with mod_timer() when credit is next exhausted.
David
next prev parent reply other threads:[~2013-02-14 13:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-14 13:18 xen-netback: fix oopes during shutdown and error handling David Vrabel
2013-02-14 13:18 ` [PATCH 1/2] xen-netback: correctly return errors from netbk_count_requests() David Vrabel
2013-02-14 13:18 ` David Vrabel
2013-02-14 16:39 ` Ian Campbell
2013-02-14 16:39 ` Ian Campbell
2013-02-14 13:18 ` [PATCH 2/2] xen-netback: cancel the credit timer when taking the vif down David Vrabel
2013-02-14 13:53 ` [Xen-devel] " Wei Liu
2013-02-14 13:56 ` David Vrabel [this message]
2013-02-14 14:10 ` Wei Liu
2013-02-14 14:10 ` Wei Liu
2013-02-14 13:56 ` David Vrabel
2013-02-14 14:15 ` Jan Beulich
2013-02-14 14:15 ` [Xen-devel] " Jan Beulich
2013-02-14 14:21 ` Wei Liu
2013-02-14 14:21 ` [Xen-devel] " Wei Liu
2013-02-14 13:53 ` Wei Liu
2013-02-14 16:39 ` Ian Campbell
2013-02-14 16:39 ` Ian Campbell
2013-02-14 16:48 ` Wei Liu
2013-02-14 16:48 ` [Xen-devel] " Wei Liu
2013-02-14 13:18 ` David Vrabel
2013-02-14 18:21 ` xen-netback: fix oopes during shutdown and error handling David Miller
2013-02-14 18:21 ` David Miller
2013-02-14 21:57 ` Christopher S. Aker
2013-02-15 8:45 ` Ian Campbell
2013-02-15 8:45 ` [Xen-devel] " Ian Campbell
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=511CED08.9080902@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=wei.liu2@citrix.com \
--cc=wei.liu@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 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.