nve(4) timeout fix
John Baldwin
jhb at freebsd.org
Thu Apr 27 21:34:57 UTC 2006
On Thursday 27 April 2006 10:10, Nathan Whitehorn wrote:
> Also on the subject of nVidia NICs, I've fixed the device timeout
> problem on nve(4). It appears that some revisions of the hardware don't
> send interrupts on tx completion, which caused watchdog timeouts under
> low load. We should take this hardware quirk into account for the nfe
> port as well.
> -Nathan
>
> --- if_nve_original.c Wed Apr 26 22:23:14 2006
> +++ if_nve.c Wed Apr 26 21:52:34 2006
> @@ -1270,6 +1270,18 @@
> nve_watchdog(struct ifnet *ifp)
> {
> struct nve_softc *sc = ifp->if_softc;
> +
> + NVE_LOCK(sc);
> + /* Check for lost interrupts -- happens on nForce4 */
> + sc->hwapi->pfnDisableInterrupts(sc->hwapi->pADCX);
> + sc->hwapi->pfnHandleInterrupt(sc->hwapi->pADCX);
> + sc->hwapi->pfnEnableInterrupts(sc->hwapi->pADCX);
> +
> + if (sc->pending_txs == 0) {
> + NVE_UNLOCK(sc);
> + return; /* Problem went away */
> + }
> + NVE_UNLOCK(sc);
>
> device_printf(sc->dev, "device timeout (%d)\n", sc->pending_txs);
I would just remove the second NVE_UNLOCK and remove the NVE_LOCK
right after the device_printf() so you don't unlock the mutex
just to turn around and lock it again.
--
John Baldwin <jhb at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org
More information about the freebsd-amd64
mailing list