summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2008-11-08 07:37:07 +0000
committerderaadt <deraadt@openbsd.org>2008-11-08 07:37:07 +0000
commit8013a2019f21f180e9d5dfa2b87e2b0f8facc8fe (patch)
tree5f61a7ac03e09ca59b4ab2bda3717de238298640
parentWhen initializing the standard RX ring, do not allocate mbufs clusters for the (diff)
downloadwireguard-openbsd-8013a2019f21f180e9d5dfa2b87e2b0f8facc8fe.tar.xz
wireguard-openbsd-8013a2019f21f180e9d5dfa2b87e2b0f8facc8fe.zip
brad, noone said you could go making changes like that (doubling the
amount of memory and interrupt time each bge uses) without discussing it with other people. lots of people are complaining about the lack of communication in your process, and you are going to have to change that.
-rw-r--r--sys/dev/pci/if_bge.c12
-rw-r--r--sys/dev/pci/if_bgereg.h10
2 files changed, 18 insertions, 4 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 1bc6d6324af..98bef6d6799 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.253 2008/11/08 07:13:02 deraadt Exp $ */
+/* $OpenBSD: if_bge.c,v 1.254 2008/11/08 07:37:07 deraadt Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -982,6 +982,12 @@ bge_newbuf_jumbo(struct bge_softc *sc, int i, struct mbuf *m)
return (0);
}
+/*
+ * The standard receive ring has 512 entries in it. At 2K per mbuf cluster,
+ * that's 1MB or memory, which is a lot. For now, we fill only the first
+ * 256 ring entries and hope that our CPU is fast enough to keep up with
+ * the NIC.
+ */
int
bge_init_rx_ring_std(struct bge_softc *sc)
{
@@ -2709,7 +2715,7 @@ bge_tick(void *xsc)
/*
* Do not touch PHY if we have link up. This could break
* IPMI/ASF mode or produce extra input errors.
- * (extra input errors was reported for BCM5701 & BCM5704).
+ * (extra input errors was reported for bcm5701 & bcm5704).
*/
if (!BGE_STS_BIT(sc, BGE_STS_LINK))
mii_tick(mii);
@@ -3571,6 +3577,8 @@ bge_link_upd(struct bge_softc *sc)
}
/*
* Discard link events for MII/GMII cards if MI auto-polling disabled.
+ * This should not happen since mii callouts are locked now, but
+ * we keep this check for debug.
*/
} else if (BGE_STS_BIT(sc, BGE_STS_AUTOPOLL)) {
/*
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index 4e734df7f49..3d6ff3ce7b0 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.87 2008/11/08 07:10:13 brad Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.88 2008/11/08 07:37:07 deraadt Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -2318,9 +2318,15 @@ struct bge_gib {
pci_conf_write(pc, tag, reg, (pci_conf_read(pc, tag, reg) & ~(x)))
/*
- * Jumbo buffer stuff.
+ * Memory management stuff. Note: the SSLOTS, MSLOTS and JSLOTS
+ * values are tuneable. They control the actual amount of buffers
+ * allocated for the standard, mini and jumbo receive rings.
*/
+
+#define BGE_SSLOTS 256
+#define BGE_MSLOTS 256
#define BGE_JSLOTS 384
+
#define BGE_JRAWLEN (BGE_JUMBO_FRAMELEN + ETHER_ALIGN)
#define BGE_JLEN (BGE_JRAWLEN + (sizeof(u_int64_t) - \
(BGE_JRAWLEN % sizeof(u_int64_t))))