diff options
author | luigi <luigi@FreeBSD.org> | 2001-02-18 07:21:28 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2001-02-18 07:21:28 +0000 |
commit | 6c741e82979e5884f209fe5a6d1b29885a01f800 (patch) | |
tree | d6154d573d6e10fdaaa886c51cd54a78b99ee278 /sys | |
parent | e8bf28f429e33f5f3e07e0a95e89aa3764976e08 (diff) | |
download | FreeBSD-src-6c741e82979e5884f209fe5a6d1b29885a01f800.zip FreeBSD-src-6c741e82979e5884f209fe5a6d1b29885a01f800.tar.gz |
Add a check in the interrupt service routine to return quickly in
case there is nothing to do. This happens normally when the card shares
the interrupt line with other devices.
This code saves a couple of microseconds per interrupt even on a
fast CPU. You normally would not care, except under heavy tinygram
traffic where you can have some 50-100.000 interrupts per second...
On passing, correct a spelling error.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/dc/if_dc.c | 5 | ||||
-rw-r--r-- | sys/pci/if_dc.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 7e57dae..9cb794f 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -2716,7 +2716,10 @@ static void dc_intr(arg) DC_LOCK(sc); ifp = &sc->arpcom.ac_if; - /* Supress unwanted interrupts */ + if ( (CSR_READ_4(sc, DC_ISR) & DC_INTRS) == 0) + return ; + + /* Suppress unwanted interrupts */ if (!(ifp->if_flags & IFF_UP)) { if (CSR_READ_4(sc, DC_ISR) & DC_INTRS) dc_stop(sc); diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index 7e57dae..9cb794f 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -2716,7 +2716,10 @@ static void dc_intr(arg) DC_LOCK(sc); ifp = &sc->arpcom.ac_if; - /* Supress unwanted interrupts */ + if ( (CSR_READ_4(sc, DC_ISR) & DC_INTRS) == 0) + return ; + + /* Suppress unwanted interrupts */ if (!(ifp->if_flags & IFF_UP)) { if (CSR_READ_4(sc, DC_ISR) & DC_INTRS) dc_stop(sc); |