FreeBSD em ether driver lockup

ming fu fming at borderware.com
Wed Jun 16 13:36:27 GMT 2004


Hi,

I have experienced em driver lockup. One of a port on a multi-port Intel 
Gigbit card would lockup. It can be unlocked by
    #ifconfig em2 down
    #ifconfig em2 up

I beleive I have been hit by the same bug reported as kern/66634

Looking through the em driver code, I noticed the watchdog function is 
somewhat strange:

static void
em_watchdog(struct ifnet *ifp)
{
    struct adapter * adapter;
    adapter = ifp->if_softc;

    /* If we are in this routine because of pause frames, then
     * don't reset the hardware.
     */
    if (E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_TXOFF) {
        ifp->if_timer = EM_TX_TIMEOUT;
        return;
    }

    if (em_check_for_link(&adapter->hw))
        printf("em%d: watchdog timeout -- resetting\n", adapter->unit);

    ifp->if_flags &= ~IFF_RUNNING;

    em_stop(adapter);
    em_init(adapter);

    ifp->if_oerrors++;
    return;
}


Would the
    if (E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_TXOFF)
ever be false on a configured device? I checked several other watchdog 
function of different ether device drivers (fxp, bge). All pretty much 
go straight to stop / init the device.

I think the watchdog is the last attempt the kernel try to bring back an 
interface, why subject this desperate action to a bit on the device's 
hardware? The hardware could be insane at the moment.

Is there a suggestion on how to trigger the watchdog to be called. It is 
really time consuming to diagnose this as it takes hours or dates for 
the em to lockup once.

Regards,
Ming




More information about the freebsd-net mailing list