LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* guard against buggy poll() return value
@ 2008-03-08  9:10 Marin Mitov
  0 siblings, 0 replies; only message in thread
From: Marin Mitov @ 2008-03-08  9:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jeff Garzik

Hi all,

Looking in net/core/dev.c I see:

WARN_ON_ONCE(work > weight);

which is a guard against buggy net drivers returning
more work from their poll method than they should.

Few lines bellow a check is done:

if (unlikely(work == weight)) 

which excludes the buggy outcome. 
Should not it be changed to:

if (unlikely(work >= weight)) 

If you find it worth, here is a patch against 2.6.24.3.

Regards.

Marin Mitov

Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
-------------------------------------------
--- a/net/core/dev.c	2008-03-08 10:37:50.000000000 +0200
+++ b/net/core/dev.c	2008-03-08 10:39:09.000000000 +0200
@@ -2207,7 +2207,7 @@ static void net_rx_action(struct softirq
 		 * still "owns" the NAPI instance and therefore can
 		 * move the instance around on the list at-will.
 		 */
-		if (unlikely(work == weight)) {
+		if (unlikely(work >= weight)) {
 			if (unlikely(napi_disable_pending(n)))
 				__napi_complete(n);
 			else


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-08  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-08  9:10 guard against buggy poll() return value Marin Mitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).