Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Feb 2019 10:10:21 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Stephen Hurd <shurd@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r344162 - head/sys/net
Message-ID:  <20190216085932.H4743@besplex.bde.org>
In-Reply-To: <201902151851.x1FIpi5O090646@repo.freebsd.org>
References:  <201902151851.x1FIpi5O090646@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 15 Feb 2019, Stephen Hurd wrote:

> Log:
>  iflib: Improve return values of interrupt handlers.
>
>  iflib was returning FILTER_HANDLED, in cases where FILTER_STRAY was more
>  correct. This potentially caused issues with shared legacy interrupts.
>
>  Driver filters returning FILTER_STRAY are now properly handled.

INTR_FILTER was a mistake that was backed out in r334170.  Except it
added hundreds if not thousands of FILTER_XXX returns from drivers,
some apparently wrong so thee return values can't be checked much,
and this wasn't backed out.

There were a lot of uses under INTR_FILTER.  Now the only uses seem
to be:

- a few in a KASSERT() in kern_intr.c
- 1 in kern_intr.c for wrappers like in pccard and pccbb
- 1 in subr_intr.c under INTR_SOLO.

I intentionally left out return values from interrupt handlers when I
unpessimized the interrupt system in ~1992 in 386BSD.  They were rarely
useful then since i386 interrupts were mostly unshareable due to being
edge-triggered.  Edge triggering requires every driver to check all
interrupt sources for devices that it handles, since the interrupt won't
repeat unless it is fully handled.  This also makes sharing difficult.
Sharing for PCI level-triggered interrupts was more common a few years
later.  INTR_FILTER was committed much later.  I think it was committed
just in time to rarely be useful, since MSI was fairly old then.

It is only a minor optimization for shared interrupts to return from
all interrupt handlers when one handler claims FILTER_HANDLED.  This
pessimizes all the non-shared interrupts (more in 1992 than now since
CPUs are relatively much faster than i/o).

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190216085932.H4743>