Vastly improve performance of IRQ handling on stopped interfaces with

this driver by introducing a flag saying we already stopped the device.

On my Soekris net4801, this took a ping -i 0.001 from spending 80% of
time in interrupt handling to 10% (approx numbers).

This was a particular problem for the net4801 because the tree
interfaces share the same interrupt, but it would be a problem for
any configuration where an unused if_sis interface shares an interrupt
with a busy device.

Other drivers may have similar problems.

Thanks to:	Luigi
This commit is contained in:
Poul-Henning Kamp 2003-12-25 22:14:25 +00:00
parent 8cb4c5760a
commit 8c27747768
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123833
2 changed files with 5 additions and 0 deletions

View File

@ -2044,6 +2044,7 @@ sis_init(xsc)
* Cancel pending I/O and free all RX/TX buffers.
*/
sis_stop(sc);
sc->sis_stopped = 0;
#ifdef notyet
if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr >= NS_SRR_16A) {
@ -2379,6 +2380,8 @@ sis_stop(sc)
register int i;
struct ifnet *ifp;
if (sc->sis_stopped)
return;
SIS_LOCK(sc);
ifp = &sc->arpcom.ac_if;
ifp->if_timer = 0;
@ -2431,6 +2434,7 @@ sis_stop(sc)
bzero(sc->sis_ldata.sis_tx_list,
sizeof(sc->sis_ldata.sis_tx_list));
sc->sis_stopped = 1;
SIS_UNLOCK(sc);
return;

View File

@ -470,6 +470,7 @@ struct sis_softc {
bus_dma_tag_t sis_tag;
struct sis_ring_data sis_cdata;
struct callout sis_stat_ch;
int sis_stopped;
#ifdef DEVICE_POLLING
int rxcycles;
#endif