From owner-freebsd-current@FreeBSD.ORG Wed Jul 18 05:10:53 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A09516A406 for ; Wed, 18 Jul 2007 05:10:53 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by mx1.freebsd.org (Postfix) with ESMTP id 3095113C481 for ; Wed, 18 Jul 2007 05:10:52 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: by ug-out-1314.google.com with SMTP id o4so279147uge for ; Tue, 17 Jul 2007 22:10:51 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=OABT42Ja+D3GnnVFex/X9syfUd2c9B0kMOvBJ68otJw2ySibuqHisZis+Afni+Fetyq40d3ttlpi2eZXKnu9t90ScEhBHeL1xZRyzIyampXS4PE//iUS7V4DA4zdyL4bqbENh3e2zQqPwFM4t5Fa+BVaeliUVAxFCW75ZjLAm0o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ViBneCYewr6YVSUycsfqFDA/NAtc+uN3GWOltxwvTP23JQmxI3EQ//1kswvlbssVwv7yb18ZcyfbmmVuK1uhb2PT4FRHqnqXWE86MKHJEzAECSal4+U//Ifh3NTVxKwp8OaYR9h0xOrRU5AFDF0tQZcOBXb0cCgRApiCoKSFqL8= Received: by 10.78.137.7 with SMTP id k7mr328862hud.1184735451659; Tue, 17 Jul 2007 22:10:51 -0700 (PDT) Received: by 10.78.162.18 with HTTP; Tue, 17 Jul 2007 22:10:51 -0700 (PDT) Message-ID: Date: Tue, 17 Jul 2007 22:10:51 -0700 From: "Kip Macy" To: pyunyh@gmail.com In-Reply-To: <20070718021839.GA37935@cdnetworks.co.kr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <09BFF2FA5EAB4A45B6655E151BBDD9030483F161@NT-IRVA-0750.brcm.ad.broadcom.com> <20070718021839.GA37935@cdnetworks.co.kr> Cc: David Christensen , current@freebsd.org Subject: Re: Getting/Forcing Greater than 4KB Buffer Allocations X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2007 05:10:53 -0000 On 7/17/07, Pyun YongHyeon wrote: > On Tue, Jul 17, 2007 at 04:54:31PM -0700, David Christensen wrote: > > I'm investigating a problem with my bce driver which occurs when I ask > > for a jumbo > > mbuf cluster (through m_cljget()). When I map the memory for DMA I > > normally > > get 3 memory segments (4KB + 4KB + 1KB) on my system, but on another > > user's > > system he's seeing 2 memory segments (8KB + 1KB). Is there a > > configuration > > option that allows this or some other tuning variable involved? The > > system is a > > Xeon dual-core processor and has 8GB of RAM, running an AMD64 version of > > the kernel. > > > > I've briefly looked over bus_dma usage on bce(4). It seems that you > told bus_dma the the dma map could be made up of BCE_MAX_SEGMENTS > segments, where a dma segment could be MJUM9BYTES bytes. If you want > just two segments you may have to use 2 instead of BCE_MAX_SEGMENTS. > If the hardware can support up to BCE_MAX_SEGMENTS dma segments on Rx > descriptors you should be prepared to handle that number of dma > segments too(e.g. You don't know how may dma segments would be > returned by bus_dma, you just know the upper bound as you specified > in bus_dma_tag_create()). > If the hardware can handle just up to 4KB for a dma segment you > should tell bus_dma the restriction of the dma segment. > If you have to get a single dma segment that covers MJUM9BYTES bytes > due to the limitation of the hardware you may have to use local > allocator. I have a patch to make jumbo frames contiguous that will go into HEAD after 7 branches. -Kip