From owner-freebsd-current@FreeBSD.ORG Wed Jul 18 18:50:15 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 0421B16A402 for ; Wed, 18 Jul 2007 18:50:15 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from mms2.broadcom.com (mms2.broadcom.com [216.31.210.18]) by mx1.freebsd.org (Postfix) with ESMTP id CD7B113C4BB for ; Wed, 18 Jul 2007 18:50:14 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from [10.10.64.154] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.1)); Wed, 18 Jul 2007 11:50:06 -0700 X-Server-Uuid: A6C4E0AE-A7F0-449F-BAE7-7FA0D737AC76 Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id EA3192AF; Wed, 18 Jul 2007 11:50:05 -0700 (PDT) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.10.64.221]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id D65272AE; Wed, 18 Jul 2007 11:50:05 -0700 (PDT) Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com [10.10.64.146]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id FME60572; Wed, 18 Jul 2007 11:50:02 -0700 (PDT) Received: from NT-IRVA-0750.brcm.ad.broadcom.com ( nt-irva-0750.brcm.ad.broadcom.com [10.8.194.64]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id B0BB769CAB; Wed, 18 Jul 2007 11:50:02 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Wed, 18 Jul 2007 11:50:02 -0700 Message-ID: <09BFF2FA5EAB4A45B6655E151BBDD9030483F437@NT-IRVA-0750.brcm.ad.broadcom.com> In-Reply-To: <20070718021839.GA37935@cdnetworks.co.kr> Thread-Topic: Getting/Forcing Greater than 4KB Buffer Allocations Thread-Index: AcfI4iblUTYXTZ6IQHmw4c1o6L2ISQAieC7Q References: <09BFF2FA5EAB4A45B6655E151BBDD9030483F161@NT-IRVA-0750.brcm.ad.broadcom.com> <20070718021839.GA37935@cdnetworks.co.kr> From: "David Christensen" To: pyunyh@gmail.com X-WSS-ID: 6A80BF543DG10316636-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Cc: 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 18:50:15 -0000 > On Tue, Jul 17, 2007 at 04:54:31PM -0700, David Christensen wrote: > > I'm investigating a problem with my bce driver which=20 > occurs when I ask > > for a jumbo > > mbuf cluster (through m_cljget()). When I map the memory for DMA I > > normally=20 > > get 3 memory segments (4KB + 4KB + 1KB) on my system, but=20 > on another > > user's=20 > > system he's seeing 2 memory segments (8KB + 1KB). Is there a > > configuration > > option that allows this or some other tuning variable=20 > involved? The > > system is a=20 > > Xeon dual-core processor and has 8GB of RAM, running an=20 > AMD64 version of > > the kernel. > > =20 >=20 > 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. >=20 Thanks Pyun but I'm really just looking for a way to test that I can handle the number of segments I've advertised that I can support. I=20 believe my code is correct but when all I see are allocations of 3=20 segments I just can't prove it. I was hoping that running a utility such as "stress" would help fragment memory and force more variable responses but that hasn't happened yet. Dave