netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.6-bk8] pcnet32: limit frames received during interrupt.
@ 2004-05-22 22:22 Don Fry
  2004-05-24 18:24 ` Stephen Hemminger
  2004-05-27 17:12 ` [PATCH 2.6.6-bk8] pcnet32: limit frames received during interrupt Jeff Garzik
  0 siblings, 2 replies; 4+ messages in thread
From: Don Fry @ 2004-05-22 22:22 UTC (permalink / raw)
  To: tsbogend, jgarzik, netdev

The current code will allow an infinite number of frames to be received
during one interrupt.  Tested ia32 and ppc64.

--- linux-2.6.6-bk8/drivers/net/ltint.pcnet32.c	Fri May 21 15:09:56 2004
+++ linux-2.6.6-bk8/drivers/net/pcnet32.c	Sat May 22 13:23:24 2004
@@ -22,8 +22,8 @@
  *************************************************************************/
 
 #define DRV_NAME	"pcnet32"
-#define DRV_VERSION	"1.30"
-#define DRV_RELDATE	"05.18.2004"
+#define DRV_VERSION	"1.30a"
+#define DRV_RELDATE	"05.22.2004"
 #define PFX		DRV_NAME ": "
 
 static const char *version =
@@ -86,7 +86,7 @@
 
 static struct net_device *pcnet32_dev;
 
-static int max_interrupt_work = 80;
+static int max_interrupt_work = 2;
 static int rx_copybreak = 200;
 
 #define PCNET32_PORT_AUI      0x00
@@ -241,6 +241,7 @@
  *	   forever.
  * v1.30   18 May 2004 Don Fry removed timer and Last Transmit Interrupt
  *	   (ltint) as they added complexity and didn't give good throughput.
+ * v1.30a  22 May 2004 Don Fry limit frames received during interrupt.
  */
 
 
@@ -1860,6 +1861,7 @@
 {
     struct pcnet32_private *lp = dev->priv;
     int entry = lp->cur_rx & RX_RING_MOD_MASK;
+    int boguscnt = RX_RING_SIZE / 2;
 
     /* If we own the next entry, it's a new packet. Send it up. */
     while ((short)le16_to_cpu(lp->rx_ring[entry].status) >= 0) {
@@ -1962,6 +1964,7 @@
 	wmb(); /* Make sure owner changes after all others are visible */
 	lp->rx_ring[entry].status |= le16_to_cpu(0x8000);
 	entry = (++lp->cur_rx) & RX_RING_MOD_MASK;
+	if (--boguscnt <= 0) break;	/* don't stay in loop forever */
     }
 
     return 0;
-- 
Don Fry
brazilnut@us.ibm.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.6-bk8] pcnet32: limit frames received during interrupt.
  2004-05-22 22:22 [PATCH 2.6.6-bk8] pcnet32: limit frames received during interrupt Don Fry
@ 2004-05-24 18:24 ` Stephen Hemminger
  2004-05-24 18:30   ` [PATCH 2.6.6-bk8] pcnet32: limit frames received during Don Fry
  2004-05-27 17:12 ` [PATCH 2.6.6-bk8] pcnet32: limit frames received during interrupt Jeff Garzik
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2004-05-24 18:24 UTC (permalink / raw)
  To: Don Fry; +Cc: tsbogend, jgarzik, netdev

On Sat, 22 May 2004 15:22:19 -0700 (PDT)
Don Fry <brazilnut@us.ibm.com> wrote:

> The current code will allow an infinite number of frames to be received
> during one interrupt.  Tested ia32 and ppc64.

How about converting to support NAPI?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.6-bk8] pcnet32: limit frames received during
  2004-05-24 18:24 ` Stephen Hemminger
@ 2004-05-24 18:30   ` Don Fry
  0 siblings, 0 replies; 4+ messages in thread
From: Don Fry @ 2004-05-24 18:30 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: tsbogend, jgarzik, netdev

I'll add that to my list.

> > The current code will allow an infinite number of frames to be received
> > during one interrupt.  Tested ia32 and ppc64.
> 
> How about converting to support NAPI?
> 

-- 
Don Fry
brazilnut@us.ibm.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.6-bk8] pcnet32: limit frames received during interrupt.
  2004-05-22 22:22 [PATCH 2.6.6-bk8] pcnet32: limit frames received during interrupt Don Fry
  2004-05-24 18:24 ` Stephen Hemminger
@ 2004-05-27 17:12 ` Jeff Garzik
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2004-05-27 17:12 UTC (permalink / raw)
  To: Don Fry; +Cc: tsbogend, netdev

applied to 2.4 and 2.6

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-27 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-22 22:22 [PATCH 2.6.6-bk8] pcnet32: limit frames received during interrupt Don Fry
2004-05-24 18:24 ` Stephen Hemminger
2004-05-24 18:30   ` [PATCH 2.6.6-bk8] pcnet32: limit frames received during Don Fry
2004-05-27 17:12 ` [PATCH 2.6.6-bk8] pcnet32: limit frames received during interrupt Jeff Garzik

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).