From owner-svn-src-all@FreeBSD.ORG Fri Jun 11 18:05:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 030451065679; Fri, 11 Jun 2010 18:05:42 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id A94228FC13; Fri, 11 Jun 2010 18:05:41 +0000 (UTC) Received: by pwj1 with SMTP id 1so949866pwj.13 for ; Fri, 11 Jun 2010 11:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=cGkdzfGoDoljGSfLrNiQnBh0ZozF6OseBw6rFXRscg4=; b=NY7CW2X0391dPawOgOAAOpl6FEPLF5FZHJhpHkwQARzxrm4rIHDqVSCw7MOAXORZ2z d3BsrILb0tErBEPzB9I3TZHkU0pDgm8xnp9HiB98G42WUgOwWZJ7xuTatawUrdBz8Xyw oAGf0DBwOK/thqZWQwY7XmiDmiQuzHUzJH3Uw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=cLxCOoJ0qfGVt+apfW6svqtQWEsqFWNO6qaVQQtn+GbKkC/IoTFaOkJ8QB+m41yMOc P7WFARMsFKRJ4/DTNHq4jR481Q7td8rnD4Zwoqv1+8E9JKk+by4shfYzwcPynDLWg1BX jgkooUQE/2xnyq1s2p6XjyyCai/Zc/qUHNhn8= Received: by 10.115.81.33 with SMTP id i33mr1754233wal.46.1276279540786; Fri, 11 Jun 2010 11:05:40 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id n29sm16248732wae.4.2010.06.11.11.05.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 11:05:40 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 11 Jun 2010 11:04:19 -0700 From: Pyun YongHyeon Date: Fri, 11 Jun 2010 11:04:19 -0700 To: Scott Long Message-ID: <20100611180419.GF13776@michelle.cdnetworks.com> References: <201006110751.40735.jhb@freebsd.org> <853068F6-D736-4DA3-859F-D946D096843D@samsco.org> <19B0DF11-5998-40F5-8095-8D2521B1C597@mac.com> <291D17F7-F387-4A13-8ED9-2898A9F7E018@mac.com> <028BA7D4-90C8-4D2D-B9A5-C1C3CF9B6D7D@samsco.org> <53158C9B-C9E1-4C47-B361-83C76181721A@mac.com> <896621F6-4BAF-43D4-9D97-29B4EF34C080@samsco.org> <648FCAFD-6264-4613-BBCB-F813A7C0A849@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <648FCAFD-6264-4613-BBCB-F813A7C0A849@samsco.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r209026 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2010 18:05:42 -0000 On Fri, Jun 11, 2010 at 11:55:07AM -0600, Scott Long wrote: > On Jun 11, 2010, at 11:53 AM, Marcel Moolenaar wrote: > > > > On Jun 11, 2010, at 10:47 AM, Scott Long wrote: > > > >> On Jun 11, 2010, at 11:44 AM, Marcel Moolenaar wrote: > >>> > >>> On Jun 11, 2010, at 10:37 AM, Scott Long wrote: > >>>> > >>>> I'm not clear why you even need bounce buffers for RX. The chip supports 64bit addresses with no boundary or alignment restrictions. > >>> > >>> As per: > >>> /* > >>> * All controllers that are not 5755 or higher have 4GB > >>> * boundary DMA bug. > >>> * Whenever an address crosses a multiple of the 4GB boundary > >>> * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition > >>> * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA > >>> * state machine will lockup and cause the device to hang. > >>> */ > >>> if (BGE_IS_5755_PLUS(sc) == 0) > >>> sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; > >>> > >>> and: > >>> lowaddr = BUS_SPACE_MAXADDR; > >>> if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) > >>> lowaddr = BGE_DMA_MAXADDR; > >>> if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) > >>> lowaddr = BUS_SPACE_MAXADDR_32BIT; > >>> /* > >>> * Allocate the parent bus DMA tag appropriate for PCI. > >>> */ > >>> error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), > >>> 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, > >>> NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, > >>> 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); > >>> > >>> > >> > >> Noted in previous email. If this restriction is put in the boundary attribute, then you'll only bounce the very rare case of an mbuf straddling a 4G boundary. > > > > I agree with you, but I was just giving the facts. I don't even > > know if we attempted to use the boundary argument before but > > problems forced us to resort to this. > > > > Thanks to the design limitation of PCIe, the 4GB boundary is a common restriction and should work fine in FreeBSD. I guess many PCIe drivers in tree do not explicitly set 4GB boundary restriction. Isn't it better to set it automatically with bus_get_dma_tag(9)? > > Scott > >