Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Dec 2006 09:29:12 +0800
From:      "Adrian Chadd" <adrian@freebsd.org>
To:        "David Gilbert" <dgilbert@dclg.ca>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Detecting buffer space with UDP.
Message-ID:  <d763ac660612151729l56da6ec4pc3e3efea399568c8@mail.gmail.com>
In-Reply-To: <17795.4696.998145.337454@canoe.dclg.ca>
References:  <17795.4696.998145.337454@canoe.dclg.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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@daveg.ca                    |  equal if and only if they |
> |http://daveg.ca                              |   are precisely opposite.  |
> =========================================================GLO================
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>


-- 
Adrian Chadd - adrian@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d763ac660612151729l56da6ec4pc3e3efea399568c8>