summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2004-12-16 14:30:33 +0000
committerBrad Smith <brad@cvs.openbsd.org>2004-12-16 14:30:33 +0000
commit735c2392b48ffb575f6e7b782d15938d9c397569 (patch)
treea35c4ca525a0a1621b29c985de640326ffbd6731 /sys
parent2876c57e1963fc9a1c5b22dc1d87eb9c90fbab7f (diff)
rev 1.71
* Set buffer management high water marks for MTU > 1514. * Set BGE_MAX_RX_FRAME_LOWAT (from Linux driver). rev 1.25 * Update onchip buffer tunables to recommended values from Linux drivers. * Increase Tx interrupt-coalescing thresholds, to reduce Tx-done interrupts. From NetBSD ok krw@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_bge.c24
-rw-r--r--sys/dev/pci/if_bgereg.h3
2 files changed, 20 insertions, 7 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index f0470d5cd64..12a9fbe8d62 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.43 2004/12/12 19:11:26 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.44 2004/12/16 14:30:31 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2001
@@ -1132,6 +1132,7 @@ bge_blockinit(sc)
struct bge_softc *sc;
{
struct bge_rcb *rcb;
+ struct ifnet *ifp = &sc->arpcom.ac_if;
vaddr_t rcb_addr;
int i;
@@ -1168,14 +1169,23 @@ bge_blockinit(sc)
}
/* Configure mbuf pool watermarks */
+ /* new broadcom docs strongly recommend these: */
if ((sc->bge_quirks & BGE_QUIRK_5705_CORE) == 0) {
- CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x50);
- CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x20);
+ if (ifp->if_mtu > ETHER_MAX_LEN) {
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x50);
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x20);
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0x60);
+ } else {
+ /* Values from Linux driver... */
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 304);
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 152);
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 380);
+ }
} else {
CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x10);
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0x60);
}
- CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0x60);
/* Configure DMA resource watermarks */
CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_LOWAT, 5);
@@ -1895,9 +1905,9 @@ bge_attach(parent, self, aux)
/* Set default tuneable values. */
sc->bge_stat_ticks = BGE_TICKS_PER_SEC;
sc->bge_rx_coal_ticks = 150;
- sc->bge_tx_coal_ticks = 150;
sc->bge_rx_max_coal_bds = 64;
- sc->bge_tx_max_coal_bds = 128;
+ sc->bge_tx_coal_ticks = 300;
+ sc->bge_tx_max_coal_bds = 400;
/* 5705 limits RX return ring to 512 entries. */
if ((sc->bge_quirks & BGE_QUIRK_5705_CORE) == 0)
@@ -2829,6 +2839,8 @@ bge_init(xsc)
/* Turn on receiver */
BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE);
+ CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 2);
+
/* Tell firmware we're alive. */
BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index 138b04cbd50..0581a7d7ae9 100644
--- a/sys/dev/pci/if_bgereg.h
+++ b/sys/dev/pci/if_bgereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bgereg.h,v 1.15 2004/12/12 19:11:26 brad Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.16 2004/12/16 14:30:32 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2001
@@ -532,6 +532,7 @@
#define BGE_RX_BD_RULES_CTL15 0x04F8
#define BGE_RX_BD_RULES_MASKVAL15 0x04FC
#define BGE_RX_RULES_CFG 0x0500
+#define BGE_MAX_RX_FRAME_LOWAT 0x0504
#define BGE_SERDES_CFG 0x0590
#define BGE_SERDES_STS 0x0594
#define BGE_SGDIG_CFG 0x05B0