summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_em.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-04-26 07:27:53 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-04-26 07:27:53 +0000
commitcd8147213a6ac10c8913b5f0ca0cd2be792603f3 (patch)
tree8225bf13614c13b62f96a56e2c4186b0badfd93b /sys/dev/pci/if_em.c
parent50d7ddf906efcdad549794f593a82c1c795a2100 (diff)
this driver had 256 clusters for receive buffers. move to 512, to increase
performance, if the interface is up. at boot time, allocate only 12 though ... though we note that em_stop() frees them all. perhaps some are used to talk to other parts of the engine though at runtime... tested by mcbride and beck
Diffstat (limited to 'sys/dev/pci/if_em.c')
-rw-r--r--sys/dev/pci/if_em.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index e0fcaf25d41..43c94480101 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
/*$FreeBSD: if_em.c,v 1.38 2004/03/17 17:50:31 njl Exp $*/
-/* $OpenBSD: if_em.c,v 1.19 2004/04/18 04:15:00 henric Exp $ */
+/* $OpenBSD: if_em.c,v 1.20 2004/04/26 07:27:52 deraadt Exp $ */
#include "bpfilter.h"
#include "vlan.h"
@@ -513,8 +513,8 @@ em_attach(struct device *parent, struct device *self, void *aux)
#endif /* __FreeBSD__ */
/* Parameters (to be read from user) */
- sc->num_tx_desc = EM_MAX_TXD;
- sc->num_rx_desc = EM_MAX_RXD;
+ sc->num_tx_desc = EM_MIN_TXD;
+ sc->num_rx_desc = EM_MIN_RXD;
sc->hw.autoneg = DO_AUTO_NEG;
sc->hw.wait_autoneg_complete = WAIT_FOR_AUTO_NEG_DEFAULT;
sc->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT;
@@ -1003,7 +1003,7 @@ em_watchdog(struct ifnet *ifp)
void
em_init_locked(struct em_softc *sc)
{
- struct ifnet *ifp;
+ struct ifnet *ifp = &sc->interface_data.ac_if;
INIT_DEBUGOUT("em_init: begin");
@@ -1011,6 +1011,15 @@ em_init_locked(struct em_softc *sc)
em_stop(sc);
+ if (ifp->if_flags & IFF_UP) {
+ sc->num_tx_desc = EM_MAX_TXD;
+ sc->num_rx_desc = EM_MAX_RXD;
+ } else {
+ sc->num_tx_desc = EM_MIN_TXD;
+ sc->num_rx_desc = EM_MIN_RXD;
+ }
+
+
#ifdef __FreeBSD__
/* Get the latest mac address, User can use a LAA */
bcopy(sc->interface_data.ac_enaddr, sc->hw.mac_addr,
@@ -1050,7 +1059,6 @@ em_init_locked(struct em_softc *sc)
/* Don't loose promiscuous settings */
em_set_promisc(sc);
- ifp = &sc->interface_data.ac_if;
ifp->if_flags |= IFF_RUNNING;
ifp->if_flags &= ~IFF_OACTIVE;