mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Because bfe(4) knows interrupt mask value there is no need to read
interrupt mask register again. This saves one register access per each interrupt. Also don't try to process frames when driver is not running. Tested by: kib, Gleb Kurtsou gleb.kurtsou at gmail dot com Ulrich Spoerlein uspoerlein at gmail dot com
This commit is contained in:
parent
5d5624c080
commit
2be30c0d91
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181992
|
@ -1373,26 +1373,25 @@ bfe_intr(void *xsc)
|
|||
{
|
||||
struct bfe_softc *sc = xsc;
|
||||
struct ifnet *ifp;
|
||||
u_int32_t istat, imask, flag;
|
||||
u_int32_t istat, flag;
|
||||
|
||||
ifp = sc->bfe_ifp;
|
||||
|
||||
BFE_LOCK(sc);
|
||||
|
||||
istat = CSR_READ_4(sc, BFE_ISTAT);
|
||||
imask = CSR_READ_4(sc, BFE_IMASK);
|
||||
|
||||
/*
|
||||
* Defer unsolicited interrupts - This is necessary because setting the
|
||||
* chips interrupt mask register to 0 doesn't actually stop the
|
||||
* interrupts
|
||||
*/
|
||||
istat &= imask;
|
||||
istat &= BFE_IMASK_DEF;
|
||||
CSR_WRITE_4(sc, BFE_ISTAT, istat);
|
||||
CSR_READ_4(sc, BFE_ISTAT);
|
||||
|
||||
/* not expecting this interrupt, disregard it */
|
||||
if (istat == 0) {
|
||||
if (istat == 0 || (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
|
||||
BFE_UNLOCK(sc);
|
||||
return;
|
||||
}
|
||||
|
@ -1435,8 +1434,7 @@ bfe_intr(void *xsc)
|
|||
bfe_txeof(sc);
|
||||
|
||||
/* We have packets pending, fire them out */
|
||||
if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
|
||||
!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
|
||||
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
|
||||
bfe_start_locked(ifp);
|
||||
|
||||
BFE_UNLOCK(sc);
|
||||
|
|
Loading…
Reference in a new issue