lkml.org 
[lkml]   [2008]   [Mar]   [8]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromMarin Mitov <>
Subjectguard against buggy poll() return value
DateSat, 8 Mar 2008 11:10:51 +0200
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


\
 
 \ /
  Last update: 2008-03-08 10:11    [W:0.311 / U:0.030 seconds]
©2003-2008 Jasper Spaans