Luigi Rizzo writes: > > >if you could suggest a few modifications that would be required, i'd like > > >to pursue this further. > > > > Look at tsleep/wakeup on ifnet of if_snd. > > I am under the impression that implementing this mechanism would > not be so trivial. It is not immediate to tell back to the caller > on which interface ip_output() failed. Nor there is a common place > that i know of where you can be notified that a packet was successfully > transmitted -- i suspect you should patch all individual drivers. > Finally, there is the question on whether you do a wakeup as soon > as you get a free slot in the queue (in which case you most likely > end up paying the cost of a tsleep/wakeup pair on each transmission), > or you put some histeresys.
Along those lines, this might be a handy thing to add... int if_get_next(struct ifnet *ifp); /* runs at splimp() */ This function tries to "get" the next packet scheduled to go out interface 'ifp' and, if successful, puts it on &ifp->if_snd (the interface output queue for 'ifp') and returns 1; otherwise, it returns zero. Then, each device driver can be modified (over time) to invoke this function when it gets a transmit interrupt and it's output queue is empty. If the function returns 1, grab the new packet off the queue and schedule it for transmission. Once this is done it becomes much easier to hack together ideas for queueing and scheduling e.g., a netgraph node that does packet scheduling. I think ALTQ does something like this. It would be nice if it was generic enough that other mechanisms besides ALTQ (like netgraph) could also use it. I'm not that familiar with how ALTQ is implemented. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message