Subject: Interrupt priority levels
To: None <port-mac68k@NetBSD.ORG>
From: Dave Huang <khym@bga.com>
List: port-mac68k
Date: 10/31/1997 22:14:06
Cool, the MACE driver is much happier now... I was able to ftp a 1MB
kernel from my Pentium to my Mac, and got a transfer rate of 300KB/s. Not
as fast as it could be, but it sure beats the 57.6kbps PPP connection I
was using before! :)

Seems that the problem is in /usr/include/machine/intr.h... one problem is
that splnet() is defined as spl2(). That's probably cool on most Macs, but
on the AVs, the MACE chip interrupts at IPL 3, and the PSC's DMA
completion interrupts occur at IPL 4. The other (probably more serious)
problem is that all of the spl*() macros, except for spltty(), are defined
as absolute settings, instead of something like _splraise(whatever). The
problem was that ether_input() eventually got around to doing a
splsoftnet(), i.e. spl1(), and reenabled ethernet interrupts before I was
done processing the first one.

I've changed most of the spl*() things to _splraise(), except for
splsoftclock(), which is an spllower() on the i386. I left splhigh() as
spl7() since there's nothing higher than 7. I also made splnet() IPL 4,
instead of the 2 that it used to be. So... that seems to work for me, but
I don't know how it'll affect other Macs.

Comments? Suggestions?

The driver's still not working completely correctly though... it's fairly
easy to overrun its ring buffer or something, and get it confused.
"ifconfig mc0 down", followed by "ifconfig mc0 up" resets it and makes it
happy again :)

A new kernel will be up at http://www.bga.com/~khym/netbsd/ shortly, BTW.

Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 22 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++