Detecting buffer space with UDP.
Adrian Chadd
adrian at freebsd.org
Fri Dec 15 17:29:14 PST 2006
Well, the FD will always be ready for write (and it can tell you how
much data you -can- write as part of the message.)
The standard way around it is to register w/ EV_ONESHOT and only get
one event back when its ready for writing; but then you have to
re-register after you've filled the TX queue. It could be wasteful of
kqueue events; see how much CPU time you spend re-registering for
events beforehand. I forget how to coax the write-side into reporting
once per transition (EV_CLEAR maybe?)
adrian
On 12/16/06, David Gilbert <dgilbert at dclg.ca> wrote:
> I'm using kqueue() with a EVFILT_WRITE to send udp packets over a
> gigabit interface (the job here is to stress test DNS servers). I'd
> like to send packets at wire rates, but somehow the EVFILT_WRITE is
> always triggered and I'm dropping a lot of packets on the floor.
>
> Is there a way (preferably with kqueue()) to wait on the bandwidth
> available on the card?
>
> Dave.
>
> --
> ============================================================================
> |David Gilbert, Independent Contractor. | Two things can be |
> |Mail: dave at daveg.ca | equal if and only if they |
> |http://daveg.ca | are precisely opposite. |
> =========================================================GLO================
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>
--
Adrian Chadd - adrian at freebsd.org
More information about the freebsd-hackers
mailing list