[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20141216.152217.15156261870362937.davem@davemloft.net>
Date: Tue, 16 Dec 2014 15:22:17 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: david.vrabel@...rix.com
Cc: netdev@...r.kernel.org, xen-devel@...ts.xenproject.org,
konrad.wilk@...cle.com, boris.ostrovsky@...cle.com,
edumazet@...gle.com
Subject: Re: [PATCHv1 net] xen-netfront: use napi_complete() correctly to
prevent Rx stalling
From: David Vrabel <david.vrabel@...rix.com>
Date: Tue, 16 Dec 2014 18:59:46 +0000
> After d75b1ade567ffab085e8adbbdacf0092d10cd09c (net: less interrupt
> masking in NAPI) the napi instance is removed from the per-cpu list
> prior to calling the n->poll(), and is only requeued if all of the
> budget was used. This inadvertently broke netfront because netfront
> does not use NAPI correctly.
>
> If netfront had not used all of its budget it would do a final check
> for any Rx responses and avoid calling napi_complete() if there were
> more responses. It would still return under budget so it would never
> be rescheduled. The final check would also not re-enable the Rx
> interrupt.
>
> Additionally, xenvif_poll() would also 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 both of these by always calling napi_compete() if the budget was
> not all used, and then calling napi_schedule() if the final checks
> says there's more work.
>
> Signed-off-by: David Vrabel <david.vrabel@...rix.com>
Applied, thanks.
--
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