svn commit: r344162 - head/sys/net
brde at optusnet.com.au
Fri Feb 15 23:10:29 UTC 2019
On Fri, 15 Feb 2019, Stephen Hurd wrote:
> 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
- 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).
More information about the svn-src-all