Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2003 16:44:49 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Prafulla Deuskar <pdeuskar@freebsd.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Disable/Enable Interrupts in ISR
Message-ID:  <20030405163141.T37137@gamplex.bde.org>
In-Reply-To: <20030404094628.A59969@hub.freebsd.org>
References:  <20030404094628.A59969@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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