From 1fa9c9919b3cb5c00bf6ea2012e95aabe9a19b2c Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 13 Feb 2011 19:45:55 +0000 Subject: Do not compile statistics counters code if defined(SMALL_KERNEL). Makes i386 RAMDISKA breathe a bit better. --- sys/dev/pci/if_em.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 1caaf589c08..e2b210494da 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,18 +31,20 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.248 2010/09/19 13:10:21 yasuoka Exp $ */ +/* $OpenBSD: if_em.c,v 1.249 2011/02/13 19:45:54 miod Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include #include +#ifndef SMALL_KERNEL #ifdef EM_DEBUG /********************************************************************* * Set this to one to display debug statistics *********************************************************************/ int em_display_debug_stats = 0; #endif +#endif /********************************************************************* * Driver version @@ -481,7 +483,9 @@ em_attach(struct device *parent, struct device *self, void *aux) /* Initialize statistics */ em_clear_hw_cntrs(&sc->hw); +#ifndef SMALL_KERNEL em_update_stats_counters(sc); +#endif sc->hw.get_link_status = 1; if (!defer) em_update_link_status(sc); @@ -1411,10 +1415,12 @@ em_local_timer(void *arg) em_check_for_link(&sc->hw); em_update_link_status(sc); +#ifndef SMALL_KERNEL em_update_stats_counters(sc); #ifdef EM_DEBUG if (em_display_debug_stats && ifp->if_flags & IFF_RUNNING) em_print_hw_stats(sc); +#endif #endif em_smartspeed(sc); @@ -2824,8 +2830,10 @@ em_rxeof(struct em_softc *sc, int count) last_byte = *(mtod(m, caddr_t) + desc_len - 1); if (TBI_ACCEPT(&sc->hw, status, desc->errors, pkt_len, last_byte)) { +#ifndef SMALL_KERNEL em_tbi_adjust_stats(&sc->hw, &sc->stats, pkt_len, sc->hw.mac_addr); +#endif if (len > 0) len--; } else @@ -3094,6 +3102,7 @@ em_fill_descriptors(u_int64_t address, u_int32_t length, return desc_array->elements; } +#ifndef SMALL_KERNEL /********************************************************************** * * Update the board statistics counters. @@ -3258,3 +3267,4 @@ em_print_hw_stats(struct em_softc *sc) (long long)sc->stats.gptc); } #endif +#endif /* !SMALL_KERNEL */ -- cgit v1.2.3