[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCHv2 net-next] xen-netback: fix race between napi_complete() and interrupt handler



On Fri, 2014-05-16 at 10:53 +0100, David Vrabel wrote:
> 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@xxxxxxxxxx>
> >> ---
> >> 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@xxxxxxxxxx>
> 
> Would xenvif_napi_schedule_or_enable_event() be better?

I think so, yes. (_events?)

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.