[net.unix-wizards] difference btw splnet & splimp

chris@umcp-cs.UUCP (Chris Torek) (04/27/85)

> What is the difference between "splnet" and "splimp"?   

splimp is about halfway between spl5 and spl6, and blocks IMP
interrupts (and thus redirects et al., which is why you find it in
routing code).  splnet is between spl1 and spl4 (there is no spl2 or
spl3) and blocks only software interrupts (net input is generally
queued first, then processed via software interrupts).

> I had a look at machine instructions of them in /sys/machine/asm.sed,
> but I could not understand their roles completely becuase there is no
> description for register 0x16 in /sys/machine/mtpr.h. 

There isn't any reference to register 0x16; both splimp and splnet read
register 18 (IPL, the current interrupt priority level) and then stick
a new value in it.  "mtpr $0x16,$18" means put 16 in IPL, not put 18 in
register 0x16....
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland

dmlee@cheviot.UUCP (Dongman Lee) (04/30/85)

What is the difference between "splnet" and "splimp"?   
I had a look at machine instructions of them in /sys/machine/asm.sed, but
I could not understand their roles completely becuase there is no description
for register 0x16 in /sys/machine/mtpr.h. 
What is the function of Reg.0x16?
For the record, I am using VAX750/4.2BSD.
Please mail me.
Thanx in advance.

T. A. D. Lee

Arpa: dmlee%cheviot%newcastle.mailnet@mit-multics.arpa
Uucp: UK!ukc!cheviot!dmlee

terryl@tekcrl.UUCP () (04/30/85)

>What is the difference between "splnet" and "splimp"?   
>I had a look at machine instructions of them in /sys/machine/asm.sed, but
>I could not understand their roles completely becuase there is no description
>for register 0x16 in /sys/machine/mtpr.h. 
>What is the function of Reg.0x16?
>For the record, I am using VAX750/4.2BSD.

     splnet() and splimp() set the processor priority to different values,
and looking at the asm.sed, it looks like splnet() is between a spl1() and
spl4(), and splimp is between a spl5 and a spl6(), approx. Note I say approx.
`cause the VAX has 32(or is it 16?My reference books are all at work...)
different processor priority levels, and I'm trying to relate them to the
8 levels on a PDP.

ron@BRL (Ron Natalie) (05/02/85)

>What is the difference between "splnet" and "splimp"?   
>I had a look at machine instructions of them in /sys/machine/asm.sed, but
>I could not understand their roles completely becuase there is no description
>for register 0x16 in /sys/machine/mtpr.h. 
>What is the function of Reg.0x16?
>For the record, I am using VAX750/4.

Splnet is just a flag that locks the net queues.   Splimp turns off
the imp interface temporarily to lock the imp tables.  Splnet is
implemented by setting a very low but non-zero priority (spl1), since
there are no UNIBUS levels less than four, this does not stop any device
interrupts.  It's just a flag that can be tested for.  Splimp sets
priority five so that the hardware IMP interface won't interrupt
anymore.

lwa@mit-mrclean.ARPA (Larry Allen) (05/02/85)

Not quite.  The network input code called from device interrupt handlers
requests a software interrupt at the net ipl.  Raising priority to splnet()
blocks the software interrupt from occurring until the ipl is lowered
again.  This is important in synchronizing access to the network data
structures (like the queues of mbufs on the send and receive sides of
sockets).

There is some relatively tricky synchronization going on here among the
device interrupts, network software interrupt, and process-level code.
I would recommend not messing with it unless you completely understand it.
					-Larry Allen