Disable/Enable Interrupts in ISR

Bruce Evans bde at zeta.org.au
Fri Apr 4 22:44:54 PST 2003


On Fri, 4 Apr 2003, Prafulla Deuskar wrote:

> All,
>
> foo_intr()
> {
> ...
> disable_intr;
> ...
> process data;
> ...
> enable_intr;
> }
>
> Most of the network drivers currently do something like this in the ISR.
> Is this really necessary as by the time ISR is called interrupts have already been
> disabled on APIC and disabling interrupts on network card has no effect.

What sort of interrupt disabling?  I suppose disabling at the device level
might be useful (e.g., so that the interrupt handler can be returned from,
with the actual interrupt handling mostly done in a lower priority thread),
but most drivers shouldn't need or do this.  Maybe it is needed for
DEVICE_POLLING?

> Is there an issue on non-x86 architectures?

Not AFAIK.  Not far, but SMP and FreeBSD's ithread implementation need
something like an x86 ICU to work right.  The interrupt mask must be
global, and per-cpu ipls don't (naturally) work right even in the 1-cpu
case since they are designed for masking interrupts in a nested way with
the CPU determining the prioritization, but ithreads are non-nested and
want their own prioritization.

Bruce


More information about the freebsd-net mailing list