[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: splnet() and such
> On Wed, 31 Mar 2004 14:58:50 -0500 (EST)
> Michael Shalayeff <mickey@lucifier.net> wrote:
>
> > > I was going over some network drivers (sf, xe, dc, fxp & xl) this
> > > week and saw that most of them used splimp() instead of splnet(). Is
> > > there any reason why splimp() is used instead of splnet()? I've seen
> > > in the i386/intr.h file that splimp is a macro for splvm(), but
> > > haven't found the actual source (.c or .s files) of either function.
>
> > lots of networking code uses a convention that packets
> > can be safely queued/dequeued only at splimp() thus this
> > is not what really drivers do wrong but rather what they
> > have to do due to the MI code. theoretically only splnet()
> > and splsoftnet() shall be used in there...
>
> So, does this mean that certain arches don't handle splnet() correctly
> but instead require splvm()/splimp() or are these legacy assumptions?
> I guess what puzzles me most is why some drivers can get away with
> splnet (such as txp) yet most don't.
No, it means that some drivers do mbuf and memory management tricks
which require them to gain extra spl protection. Most do not. The
some that do might be in error in doing so, but for at least some I am
sure it is by design.