Re: NE2000 slow interrupts safe?

Richard Gooch (Richard.Gooch@atnf.CSIRO.AU)
Thu, 16 Apr 1998 22:49:22 +1000


Richard B. Johnson writes:
> On Thu, 16 Apr 1998, Richard Gooch wrote:
>
> > Hi, all. Looking at the code for the NE2000 driver, I note that the
> > interrupt is registered as a fast interrupt. I'm trying to convince
> > people here to change from pSOS to Linux. A problem they have is
> > that the NE2000 interrupt service routine takes up to 2
> > milliseconds. This blocks another interrupt from a custom card for too
> > long (it interrupts every millisecond), causing them to loose
> > interrupts.

OK, I should say again that on further reading of the code, I note
that other interrupts are indeed enabled during the NE2000 interrupt
handler. So actually it's not an issue for us, I expect. That said,
however...

> I don't think this is correct. The NE2000 driver just can't take that
> much time. To really test it, set a bit in the printer port when the
> ISR gets control, then reset the bit just before the return. There is
> a relatively fixed overhead from the top-level kernel ISR code that
> will not be shown. Check the bit with a scope.

I don't think I need to, since I'm pretty confident that
do_gettimeofday() is pretty accurate.

> I have a NE2 clone on a ISA (slow) bus on this machine (Pentium 166).
> The ISR time is 320 to 540 microseconds, depending upon what it is
> doing. This information was important to me, because I have a custom
> board (DSP) that interrupts 1440 times per second. I don't lose any
> interrupts although I don't do serial I/O at the same time.

On my tests I noticed quite a spread of times. When I send short
packets, then yes, the times are around a few hundred
microseconds. However, for longer packets, I was getting up to 2
milliseconds. And my measurements were consistent with the results
other were getting with pSOS.
I first instrumented almost the whole interrupt handler, then later
just instrumented the block transfer routine and got the same
results.

Have you tried this with long packets, such as 1500 bytes?

> > So my question is whether it is safe to re-enable other interrupts in
> > the Linux NE2000 interrupt handler?
> >
>
> Even if it is safe, you end up with the interrupt events being stale.
> Handling the new hardware state when the ISR eventually gets the CPU
> back basically changes the ISR into a polling routine which will seriously
> impact performance.

Sorry, I don't get what you're saying here. I'll point out that the
NE2000 driver in fact will get interrupted by other ISRs, and this
doesn't seem to have caused anybody any problems.

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu