RE: [uCsimm] CS8900 Chip Selection

From: Alex Holden (alex@linuxhacker.org)
Date: Tue Sep 05 2000 - 06:28:30 EDT


On Mon, 4 Sep 2000, Steffen Plotner wrote:
> I have to ask this question again. If someone uses the CS8900 chip on an
> ISA PC card and a ping flood occurs then how can the system to anything but
> receive packets? The CS8900 pdf file clearly states that once the
> interrupts occurs all data must be read the matter what.

What happens if you use this patch? It causes the driver to drop packets
if they're arriving too fast for it to process them...

--- uCcs8900.c.old Fri Aug 25 09:43:21 2000
+++ uCcs8900.c Fri Aug 25 10:14:45 2000
@@ -40,6 +40,14 @@
 #define NET_DEBUG 2
 #endif
 
+/*
+ * Maximum number of receive packets to handle in interrupt handler before
+ * starting to drop them (to prevent lock-up under ping flood conditions).
+ */
+#ifndef MAX_RX_WORK
+#define MAX_RX_WORK 32
+#endif
+
 /* ======================= end of configuration ======================= */
 
 
@@ -610,7 +618,7 @@
 {
         struct device *dev = (struct device *)(irq2dev_map[/* FIXME */0]);
         struct net_local *lp;
- int ioaddr, status;
+ int ioaddr, status, rx_pkts = 0;
 
         dev = irq2dev_map[0];
         if (dev == NULL) {
@@ -636,7 +644,8 @@
                 switch(status & ISQ_EVENT_MASK) {
                 case ISQ_RECEIVER_EVENT:
                         /* Got a packet(s). */
- net_rx(dev);
+ if (++rx_pkts > MAX_RX_WORK) lp->rx_dropped++;
+ else net_rx(dev);
                         break;
                 case ISQ_TRANSMITTER_EVENT:
                         lp->stats.tx_packets++;

-- 
--------------- Linux- the choice of a GNU generation. --------------
: Alex Holden (M1CJD)- Caver, Programmer, Land Rover nut, Radio Ham :
-------------------- http://www.linuxhacker.org/ --------------------

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:38 EST