Skip to content

Commit

Permalink
gro: Fix legacy path napi_complete crash
Browse files Browse the repository at this point in the history
On the legacy netif_rx path, I incorrectly tried to optimise
the napi_complete call by using __napi_complete before we reenable
IRQs.  This simply doesn't work since we need to flush the held
GRO packets first.

This patch fixes it by doing the obvious thing of reenabling
IRQs first and then calling napi_complete.

Reported-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Mar 17, 2009
1 parent ea8dbdd commit 303c6a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2588,9 +2588,9 @@ static int process_backlog(struct napi_struct *napi, int quota)
local_irq_disable();
skb = __skb_dequeue(&queue->input_pkt_queue);
if (!skb) {
__napi_complete(napi);
local_irq_enable();
break;
napi_complete(napi);
goto out;
}
local_irq_enable();

Expand All @@ -2599,6 +2599,7 @@ static int process_backlog(struct napi_struct *napi, int quota)

napi_gro_flush(napi);

out:
return work;
}

Expand Down

0 comments on commit 303c6a0

Please sign in to comment.