[patch] forcedeth: fix the NAPI poll function, take #2

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeff Garzik <jgarzik@...>
Cc: David Miller <davem@...>, <linux-kernel@...>, <torvalds@...>, <shemminger@...>
Date: Wednesday, October 17, 2007 - 6:18 am

> I'll send upstream today unless people scream...

albeit you forgot to merge half of my patch :-/ The (tested) patch below 
fixes that.

	Ingo

---------------->
Subject: forcedeth: fix rx-work condition in nv_rx_process_optimized() too
From: Ingo Molnar <mingo@elte.hu>

the merge of my previous fix to forcedeth.c lots an important hunk.

this patch fixes that.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 drivers/net/forcedeth.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Index: linux/drivers/net/forcedeth.c
===================================================================
--- linux.orig/drivers/net/forcedeth.c
+++ linux/drivers/net/forcedeth.c
@@ -2408,13 +2408,13 @@ static int nv_rx_process_optimized(struc
 	struct fe_priv *np = netdev_priv(dev);
 	u32 flags;
 	u32 vlanflags = 0;
-	u32 rx_processed_cnt = 0;
+	int rx_work = 0;
 	struct sk_buff *skb;
 	int len;
 
 	while((np->get_rx.ex != np->put_rx.ex) &&
 	      !((flags = le32_to_cpu(np->get_rx.ex->flaglen)) & NV_RX2_AVAIL) &&
-	      (rx_processed_cnt++ < limit)) {
+	      (rx_work < limit)) {
 
 		dprintk(KERN_DEBUG "%s: nv_rx_process_optimized: flags 0x%x.\n",
 					dev->name, flags);
@@ -2517,9 +2517,11 @@ next_pkt:
 			np->get_rx.ex = np->first_rx.ex;
 		if (unlikely(np->get_rx_ctx++ == np->last_rx_ctx))
 			np->get_rx_ctx = np->first_rx_ctx;
+
+		rx_work++;
 	}
 
-	return rx_processed_cnt;
+	return rx_work;
 }
 
 static void set_bufsize(struct net_device *dev)
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
WARNING: at net/core/dev.c:2161 net_rx_action(), Ingo Molnar, (Mon Oct 15, 7:24 am)
Re: WARNING: at net/core/dev.c:2161 net_rx_action(), David Miller, (Mon Oct 15, 3:57 pm)
Re: WARNING: at net/core/dev.c:2161 net_rx_action(), Ingo Molnar, (Mon Oct 15, 6:03 pm)
Re: WARNING: at net/core/dev.c:2161 net_rx_action(), Jeff Garzik, (Mon Oct 15, 6:20 pm)
Re: WARNING: at net/core/dev.c:2161 net_rx_action(), David Miller, (Mon Oct 15, 6:18 pm)
Re: WARNING: at net/core/dev.c:2161 net_rx_action(), Ingo Molnar, (Mon Oct 15, 6:07 pm)
[patch] forcedeth: fix the NAPI poll function, Ingo Molnar, (Mon Oct 15, 6:30 pm)
Re: [patch] forcedeth: fix the NAPI poll function, Jeff Garzik, (Tue Oct 16, 5:20 pm)
Re: [patch] forcedeth: fix the NAPI poll function, Ingo Molnar, (Wed Oct 17, 3:25 am)
[patch] forcedeth: fix the NAPI poll function, take #2, Ingo Molnar, (Wed Oct 17, 6:18 am)
Re: [patch] forcedeth: fix the NAPI poll function, Jeff Garzik, (Mon Oct 15, 6:40 pm)
Re: [patch] forcedeth: fix the NAPI poll function, Ingo Molnar, (Tue Oct 16, 1:42 am)
Re: [patch] forcedeth: fix the NAPI poll function, Jeff Garzik, (Tue Oct 16, 1:47 am)
Re: [patch] forcedeth: fix the NAPI poll function, Ingo Molnar, (Tue Oct 16, 2:40 am)
Re: [patch] forcedeth: fix the NAPI poll function, Jeff Garzik, (Tue Oct 16, 3:17 am)
Re: [patch] forcedeth: fix the NAPI poll function, Ingo Molnar, (Tue Oct 16, 3:49 am)
Re: [patch] forcedeth: fix the NAPI poll function, Jeff Garzik, (Tue Oct 16, 12:52 pm)
Re: [patch] forcedeth: fix the NAPI poll function, Jeff Garzik, (Mon Oct 15, 6:41 pm)
Re: [patch] forcedeth: fix the NAPI poll function, David Miller, (Mon Oct 15, 6:39 pm)
Re: WARNING: at net/core/dev.c:2161 net_rx_action(), David Miller, (Mon Oct 15, 6:21 pm)
Re: WARNING: at net/core/dev.c:2161 net_rx_action(), Ingo Molnar, (Mon Oct 15, 7:27 am)
Re: WARNING: at net/core/dev.c:2161 net_rx_action(), Ingo Molnar, (Mon Oct 15, 12:18 pm)