From: David Vrabel <david.vrabel@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>,
David Vrabel <david.vrabel@citrix.com>
Cc: <netdev@vger.kernel.org>, Wei Liu <wei.liu2@citrix.com>,
<xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCHv2 net-next] xen-netback: fix race between napi_complete() and interrupt handler
Date: Fri, 16 May 2014 10:53:59 +0100 [thread overview]
Message-ID: <5375E037.1050103@citrix.com> (raw)
In-Reply-To: <1400229009.883.37.camel@kazak.uk.xensource.com>
On 16/05/14 09:30, Ian Campbell wrote:
> On Thu, 2014-05-15 at 18:17 +0100, David Vrabel wrote:
>> When the NAPI budget was not all used, xenvif_poll() would call
>> napi_complete() /after/ enabling the interrupt. This resulted in a
>> race between the napi_complete() and the napi_schedule() in the
>> interrupt handler. The use of local_irq_save/restore() avoided by
>> race iff the handler is running on the same CPU but not if it was
>> running on a different CPU.
>>
>> Fix this properly by calling napi_complete() before reenabling
>> interrupts (in the xenvif_napi_schedule_or_enable_irq() call).
>>
>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
>> ---
>> v2:
>> - Rename xenvif_check_rx_xenvif() to
>> xenvif_napi_schedule_or_enable_irq() to make it more obvious what it
>> does.
>
> Which is to update the event pointer such that IRQs are generated again
> rather than enabling IRQs as such (enable_irq makes me think of
> EFLAGS.IF). But given that I can't think of a better way to describe it:
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Would xenvif_napi_schedule_or_enable_event() be better?
David
next prev parent reply other threads:[~2014-05-16 9:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 17:17 [PATCHv2 net-next] xen-netback: fix race between napi_complete() and interrupt handler David Vrabel
2014-05-15 18:07 ` Wei Liu
2014-05-15 18:07 ` Wei Liu
2014-05-16 8:30 ` Ian Campbell
2014-05-16 8:39 ` Wei Liu
2014-05-16 8:39 ` Wei Liu
2014-05-16 9:53 ` David Vrabel [this message]
2014-05-16 9:58 ` [Xen-devel] " Ian Campbell
2014-05-16 9:58 ` Ian Campbell
2014-05-16 9:53 ` David Vrabel
2014-05-16 8:30 ` Ian Campbell
2014-05-16 9:01 ` Wei Liu
2014-05-16 9:01 ` 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=5375E037.1050103@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=netdev@vger.kernel.org \
--cc=wei.liu2@citrix.com \
--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 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.