netgraph: why does ng_ether bother enqueuing packets?

Dave Dolson ddolson at sandvine.com
Thu May 22 06:05:27 PDT 2003


Julian Elischer wrote:
> On Wed, 21 May 2003, Vincent Jardin wrote:
> 
> > Le Mercredi 21 Mai 2003 23:03, Dave Dolson a =E9crit :
> > > For reasons of performance, I tried the following modification to
> > > ng_ether.c in FreeBSD 4.7, and it seemed to work fine.
> > > The change is to call ng_send_data() vs. ng_queue_data().
> 
> The change is ok as long as you know that you are at splnet.

I was trying to understand why it would be wrong to call ng_send_data from
an interrupt running at splimp().

Is this the correct explanation:
The netgraph (and most of net) code protects its data structures at splnet()
under the assumption that no routine capable of interrupting it will affect
those data structures.  And the ether device interrupt routine can interrupt
code at splnet().


BTW, in FreeBSD how does one determine the spl level at which a device's
interrupt routines execute?


Thanks for the feedback,
David Dolson (ddolson at sandvine.com, www.sandvine.com)



More information about the freebsd-net mailing list