From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 16 01:29:14 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32DCB16A40F for ; Sat, 16 Dec 2006 01:29:14 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.233]) by mx1.FreeBSD.org (Postfix) with ESMTP id 25E9B43C9E for ; Sat, 16 Dec 2006 01:27:28 +0000 (GMT) (envelope-from adrian.chadd@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so815364wxc for ; Fri, 15 Dec 2006 17:29:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=TTsrmQvZkDAjoOlhmU5bXjxfT/uNyJ8nTRpAKQBCt5Jm2utqNPNn9tbHTvx631SrA7jEqydIPHGTu/uxyPTeHT9/dgbYGDEnwntXx0xZfNCivvqV3k0v6hOd/Qs7gD1HNklpmoqxLl+1vxqjgB2gfgIVOOPpmHuzRulod8SR+dc= Received: by 10.90.101.19 with SMTP id y19mr1555095agb.1166232552565; Fri, 15 Dec 2006 17:29:12 -0800 (PST) Received: by 10.90.31.12 with HTTP; Fri, 15 Dec 2006 17:29:12 -0800 (PST) Message-ID: Date: Sat, 16 Dec 2006 09:29:12 +0800 From: "Adrian Chadd" Sender: adrian.chadd@gmail.com To: "David Gilbert" In-Reply-To: <17795.4696.998145.337454@canoe.dclg.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <17795.4696.998145.337454@canoe.dclg.ca> X-Google-Sender-Auth: 8fe3dddd8edfd4eb Cc: freebsd-hackers@freebsd.org Subject: Re: Detecting buffer space with UDP. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Dec 2006 01:29:14 -0000 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 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