From owner-freebsd-current@FreeBSD.ORG Thu Jul 19 03:09:31 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 26BF816A402 for ; Thu, 19 Jul 2007 03:09:31 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from MMS3.broadcom.com (mms3.broadcom.com [216.31.210.19]) by mx1.freebsd.org (Postfix) with ESMTP id 02A2413C478 for ; Thu, 19 Jul 2007 03:09:30 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from [10.10.64.154] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.1)); Wed, 18 Jul 2007 20:09:22 -0700 X-Server-Uuid: 20144BB6-FB76-4F11-80B6-E6B2900CA0D7 Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id ED9A32AF; Wed, 18 Jul 2007 20:09:21 -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 DA06E2AE; Wed, 18 Jul 2007 20:09:21 -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 FMF46459; Wed, 18 Jul 2007 20:09:17 -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 7E14769CA3; Wed, 18 Jul 2007 20:09:17 -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 20:09:15 -0700 Message-ID: <09BFF2FA5EAB4A45B6655E151BBDD9030483F5D2@NT-IRVA-0750.brcm.ad.broadcom.com> In-Reply-To: <20070719002218.GA42405@cdnetworks.co.kr> Thread-Topic: Getting/Forcing Greater than 4KB Buffer Allocations Thread-Index: AcfJmulby8HPAC3YS9iSdY35bDx/dQAFmwQQ References: <09BFF2FA5EAB4A45B6655E151BBDD9030483F161@NT-IRVA-0750.brcm.ad.broadcom.com> <20070718021839.GA37935@cdnetworks.co.kr> <09BFF2FA5EAB4A45B6655E151BBDD9030483F437@NT-IRVA-0750.brcm.ad.broadcom.com> <20070719002218.GA42405@cdnetworks.co.kr> From: "David Christensen" To: pyunyh@gmail.com X-WSS-ID: 6A800A683AC26372199-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: Thu, 19 Jul 2007 03:09:31 -0000 > > Thanks Pyun but I'm really just looking for a way to test=20 > that I can > > handle the number of segments I've advertised that I can=20 > 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=20 > a utility > > such as "stress" would help fragment memory and force more variable > > responses but that hasn't happened yet. > >=20 >=20 > It seems you've used the following code to create jumbo dma tag. > /* > * Create a DMA tag for RX mbufs. > */ > if (bus_dma_tag_create(sc->parent_tag, > 1, > BCE_DMA_BOUNDARY, > sc->max_bus_addr, > BUS_SPACE_MAXADDR, > NULL, NULL, > MJUM9BYTES, > BCE_MAX_SEGMENTS, > MJUM9BYTES, > ^^^^^^^^^^ > 0, > NULL, NULL, > &sc->rx_mbuf_tag)) { > BCE_PRINTF("%s(%d): Could not allocate RX=20 > mbuf DMA tag!\n", > __FILE__, __LINE__); > rc =3D ENOMEM; > goto bce_dma_alloc_exit; > } > If you want to have > 9 dma segements change maxsegsz(MJUM9BYTES) to > 1024. bus_dma honors maxsegsz argument so you wouldn't get a dma > segments larger than maxsegsz. With MJUM9BYTES maxsegsz you would get > up to 4 dma segments on systems with 4K PAGE_SIZE.(You would have > got up to 3 dma segements if you used PAGE_SIZE alignment argument.) I don't want more segments, I just want to get a distribution of segments up to the max size I specified. For example, since my BCE_MAX_SEGMENTS=20 size is 8, I want to make sure I get mbufs that are spread over 1, 2, 3, 4, 5, 6, 7, and 8 segments. =20 It turns out if I reduce the amount of memory in the system (from 8GB to 2GB) I will get more mbufs coalesced into 2 segments, rather than the more typical 3 segments, but that's good enough for my testing now. Dave