AltQ + ng_iface
julian at elischer.org
Sat Jul 30 19:38:37 GMT 2005
Daniel O'Connor wrote:
> On Saturday 30 July 2005 19:00, Daniel O'Connor wrote:
>>I'll try my hand at the ng_iface ALTQ patch.
> Here's what I have so far..
> Haven't done much testing yet though.
small comments so far..
mbuf tags have "families" so that differetn modules can use
the same ID numbers and not clash.
here is a netgraph family for tags, using the netgraph cookies.
It's been a while since I looked at it but if you are using mbuf
tags in netgraph you should check out the netgraph tag facilities.
If you queue data to be send over a hook you must have the data hold a
reference on the hook to ensure that the hook is not removed while your
packet is in teh queue. Similarly either the packet holds a reference
on teh node as well, or the node must lock it's queue and remove all
packets when shut down.
I see that you don't actually decid eon what hook will be used until later so
teh reference to teh hook needn't be done, but you haven't added any code to
either hold a reference on the node, or to clean the queue on shutdown.
(or is that done automatically by some iface base code that is called
The calling code must always have a reference on the node to ensure that
it is not removed while it is running in it. This is sometimes
done automatically. This is why there is an ng_callout facility to ensure
that the locking andreferences are done automatically and correctly.
I would also want to have the altq optional..
in other words I'd want a control message to ng_iface that could make it
act as before.
More information about the freebsd-net