/* * octeon_eth_tick_misc * * => collect statistics * => check link status * => called at softclock */ void octeon_eth_tick_misc(void *arg) { struct octeon_eth_softc *sc = arg; struct ifnet *ifp; u_quad_t iqdrops, delta; int s; s = splnet(); ifp = &sc->sc_arpcom.ac_if; iqdrops = ifp->if_iqdrops; cn30xxgmx_stats(sc->sc_gmx_port); #ifdef OCTEON_ETH_DEBUG delta = ifp->if_iqdrops - iqdrops; printf("%s: %qu packets dropped at GMX FIFO\n", ifp->if_xname, delta); #endif cn30xxpip_stats(sc->sc_pip, ifp, sc->sc_port); delta = ifp->if_iqdrops - iqdrops; #ifdef OCTEON_ETH_DEBUG printf("%s: %qu packets dropped at PIP + GMX FIFO\n", ifp->if_xname, delta); #endif mii_tick(&sc->sc_mii); splx(s); timeout_add_sec(&sc->sc_tick_misc_ch, 1); }
/* * octeon_eth_tick_misc * * => collect statistics * => check link status * => called at softclock */ void octeon_eth_tick_misc(void *arg) { struct octeon_eth_softc *sc = arg; struct ifnet *ifp; u_quad_t iqdrops, delta; int s; s = splnet(); ifp = &sc->sc_arpcom.ac_if; iqdrops = ifp->if_iqdrops; cn30xxgmx_stats(sc->sc_gmx_port); #ifdef OCTEON_ETH_DEBUG delta = ifp->if_iqdrops - iqdrops; printf("%s: %qu packets dropped at GMX FIFO\n", ifp->if_xname, delta); #endif cn30xxpip_stats(sc->sc_pip, ifp, sc->sc_port); delta = ifp->if_iqdrops - iqdrops; #ifdef OCTEON_ETH_DEBUG printf("%s: %qu packets dropped at PIP + GMX FIFO\n", ifp->if_xname, delta); #endif mii_tick(&sc->sc_mii); #ifdef OCTEON_ETH_FIXUP_ODD_NIBBLE_DYNAMIC if (sc->sc_gmx_port->sc_proc_nibble_by_soft && sc->sc_gmx_port->sc_even_nibble_cnt > PROC_NIBBLE_SOFT_THRESHOLD) { #ifdef OCTEON_ETH_DEBUG log(LOG_DEBUG, "%s: even nibble preamble count %d\n", sc->sc_dev.dv_xname, sc->sc_gmx_port->sc_even_nibble_cnt); #endif if (OCTEON_ETH_FIXUP_ODD_NIBBLE_MODEL_P(sc) && OCTEON_ETH_FIXUP_ODD_NIBBLE_DYNAMIC_SPEED_P(sc->sc_gmx_port, ifp)) { log(LOG_NOTICE, "%s: the preamble processing switched to hardware\n", sc->sc_dev.dv_xname); } sc->sc_gmx_port->sc_proc_nibble_by_soft = 0; octeon_eth_mii_statchg((struct device *)sc); sc->sc_gmx_port->sc_even_nibble_cnt = 0; } #endif splx(s); timeout_add_sec(&sc->sc_tick_misc_ch, 1); }