From: Herbert Xu Date: Sat, 27 Jun 2009 02:27:04 +0000 (-0700) Subject: gro: Flush GRO packets in napi_disable_pending path X-Git-Tag: v2.6.30.5~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ba3f8ea722e86b87627c2a4efbd464674e88412;p=thirdparty%2Fkernel%2Fstable.git gro: Flush GRO packets in napi_disable_pending path [ Upstream commit ff780cd8f2fa928b193554f593b36d1243554212 ] When NAPI is disabled while we're in net_rx_action, we end up calling __napi_complete without flushing GRO packets. This is a bug as it would cause the GRO packets to linger, of course it also literally BUGs to catch error like this :) This patch changes it to napi_complete, with the obligatory IRQ reenabling. This should be safe because we've only just disabled IRQs and it does not materially affect the test conditions in between. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/dev.c b/net/core/dev.c index e2e9e4af3ace6..0b241975c71d0 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2788,9 +2788,11 @@ static void net_rx_action(struct softirq_action *h) * move the instance around on the list at-will. */ if (unlikely(work == weight)) { - if (unlikely(napi_disable_pending(n))) - __napi_complete(n); - else + if (unlikely(napi_disable_pending(n))) { + local_irq_enable(); + napi_complete(n); + local_irq_disable(); + } else list_move_tail(&n->poll_list, list); }