Date: Thu, 27 Apr 2006 18:40:23 +0400 From: Yuri Pankov <yuri.pankov@gmail.com> To: Nathan Whitehorn <nathanw@uchicago.edu> Cc: freebsd-amd64@freebsd.org Subject: Re: nve(4) timeout fix Message-ID: <4450D7D7.9070108@gmail.com> In-Reply-To: <4450D0E8.4000403@uchicago.edu> References: <20060427120035.D7FA016A43B@hub.freebsd.org> <4450D0E8.4000403@uchicago.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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); > Indeed, it seems to solve timeout() messages. Haven't got any so far. Thank you! one small correction - this patch doesn't apply cleanly to -current source, so I've patched source by hand and here's patch for -current: --- if_nve.c.orig Mon Dec 12 09:23:43 2005 +++ if_nve.c Thu Apr 27 18:23:48 2006 @@ -1277,6 +1277,18 @@ { 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", c->pending_txs); NVE_LOCK(sc); Yuri
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4450D7D7.9070108>