Re: Revert "gro: Fix legacy path napi_complete crash",

David Miller
2009-03-26T03:21:21Z

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 26 Mar 2009 10:41:29 +0800

> On Wed, Mar 25, 2009 at 11:54:56PM +0100, Jarek Poplawski wrote:
> >
> > Of course it's too late for verifying this now, but (for the future)
> > I think, this scenario could be considered:
> >
> > process_backlog() netif_rx()
> >
> > if (!skb)
> > local_irq_enable()
> > if (queue.qlen) //NO
> > napi_schedule() //NOTHING
> > __skb_queue_tail() //qlen > 0
> > napi_complete()
> > ... ...
> > Every next netif_rx() sees
> > qlen > 0, so napi is never
> > scheduled again.
> >
> > Then, something like this might work...
>
> Yes this is why my original patch that started all this is broken.
> However, this doesn't apply to my patch that open-codes __napi_complete.

There is still a difference compared to your fix Herbert. Jarek's
patch flushes GRO first before the unlink.

I still believe that's critical, although like you I can't pinpoint
why.

I know that GRO ought to be disabled here, but what if for some reason
it isn't? :-)

Adam Richter has successfully tested Jarek's variant, and if Ingo's
tests show that it makes his problem go away too then I'm definitely
going with Jarek's patch.