summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-08-19 15:07:20 +0000
committerpeter <peter@FreeBSD.org>1999-08-19 15:07:20 +0000
commitc6ab32300c68d1bbcbd95264cd44d344e5147c1d (patch)
treecffb494616ab043ee969f0f8329e4addbbcc70a5 /sys/dev
parent8ffe59d0bfda567fe8d56ea92c83e8b9aa261da8 (diff)
downloadFreeBSD-src-c6ab32300c68d1bbcbd95264cd44d344e5147c1d.zip
FreeBSD-src-c6ab32300c68d1bbcbd95264cd44d344e5147c1d.tar.gz
Replace the tulip_delay_300ns() with a DELAY(1). Hammering the PCI bus
to achieve a delay is pretty mean. Andrew reports: "The tulip_delay_300ns() is, well, bloody stupid on machines with a heavily loaded PCI bus. It tries to do a delay by assuming PCI reads will take a certain amount of time & issues a large amount of (expensive, 5% CPU when your PCI bus is heavily loaded) pci reads. Locally, we've replaced the calls to tulip_delay_300ns(sc) in the EMIT macros with a simple DELAY(1) and not seen any problems. Plus we've gained about 50Mb/sec throughput on our gigabit network cards because of the added PCI bus bandwidth available." Also, I do not understand why, but this change appears to stop the Transmit Fifo underrun on one of my systems (but not the Alpha PC164SX). This shouldn't make that much of a difference since the mii bus isn't touched all that often, but perhaps when it does get accessed and hence hammers the register, it was causing the chip to get upset. Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/de/if_de.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c
index e0e9d55..c1a290f 100644
--- a/sys/dev/de/if_de.c
+++ b/sys/dev/de/if_de.c
@@ -1820,16 +1820,7 @@ static const tulip_boardsw_t tulip_2114x_isv_boardsw = {
/*
* Code the read the SROM and MII bit streams (I2C)
*/
-static void
-tulip_delay_300ns(
- tulip_softc_t * const sc)
-{
- int idx;
- for (idx = (300 / 33) + 1; idx > 0; idx--)
- (void) TULIP_CSR_READ(sc, csr_busmode);
-}
-
-#define EMIT do { TULIP_CSR_WRITE(sc, csr_srom_mii, csr); tulip_delay_300ns(sc); } while (0)
+#define EMIT do { TULIP_CSR_WRITE(sc, csr_srom_mii, csr); DELAY(1); } while (0)
static void
tulip_srom_idle(
@@ -1902,7 +1893,7 @@ tulip_srom_read(
tulip_srom_idle(sc);
}
-#define MII_EMIT do { TULIP_CSR_WRITE(sc, csr_srom_mii, csr); tulip_delay_300ns(sc); } while (0)
+#define MII_EMIT do { TULIP_CSR_WRITE(sc, csr_srom_mii, csr); DELAY(1); } while (0)
static void
tulip_mii_writebits(
OpenPOWER on IntegriCloud