From owner-svn-src-head@FreeBSD.ORG Mon Nov 23 15:40:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11D13106568B; Mon, 23 Nov 2009 15:40:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D5DBF8FC13; Mon, 23 Nov 2009 15:40:56 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 84C2446B37; Mon, 23 Nov 2009 10:40:56 -0500 (EST) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id BB4D28A01D; Mon, 23 Nov 2009 10:40:55 -0500 (EST) From: John Baldwin To: Scott Long Date: Mon, 23 Nov 2009 10:40:16 -0500 User-Agent: KMail/1.9.7 References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <200911230838.20217.jhb@freebsd.org> <2B4A2CD3-AA54-4030-9F39-3BF7DFC0434C@samsco.org> In-Reply-To: <2B4A2CD3-AA54-4030-9F39-3BF7DFC0434C@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200911231040.16597.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 23 Nov 2009 10:40:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r199670 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2009 15:40:57 -0000 On Monday 23 November 2009 10:06:08 am Scott Long wrote: > > On Nov 23, 2009, at 6:38 AM, John Baldwin wrote: > > > On Sunday 22 November 2009 6:48:18 pm Scott Long wrote: > >> By definition, PCIe can't transfer across 4GB boundaries. It's not a > >> bug specific to Broadcom. If you're loading dynamic buffers (i.e. > >> mbufs), setting an appropriate boundary value in the tag will allow > >> busdma to take care of this. If you're allocating static buffers, > >> busdma won't honor this. But what you've done here is best anyways; > >> control buffers that are going to be frequently transferred are best > >> kept in the lower 4GB of the address space. It simplifies PCIe > >> handling, and it's significantly faster on PCI/PCI-X. So I'd suggest > >> making this the rule rather than the exception in the driver. > > > > Should we enforce an implicit 4GB boundary in bus_dma then? Perhaps > > Host-PCI > > bridge drivers should create a tag with a 4GB boundary that devices > > inherit > > via bus_get_dma_tag(). For i386/PAE we might should always enforce > > a 4GB > > boundary as well? > > That was actually the point of creating bus_get_dma_tag(). I don't > recall how complete the back-end work of providing a inheritance tree > for bridges got. Note that having this wouldn't really solve Pyun's > problem, because boundaries aren't honored for static allocations. > There's been plenty of talk about multi-segment static allocations, > but I don't think that that's applicable to this either. As I said > before, it's best to restrict static allocations to the lower 4GB of > memory and not worry about the boundary at all. But having the proper > inheritance would still be nice. > > Another thing that I'd like to do is have an alternate for > bus_dma_tag_create() that takes the device_t of the device as the > first argument and figures out the parent tag and inheritance > automatically. That's a job for the mythical /sys/kern/subr_busdma.c. The inheritance thing will actually work as the default version of bus_dma_get_tag() is to just pass the request up the tree. As long as devices always use bus_dma_get_tag() when creating the tag they pass down to their children via their own bus_dma_get_tag() implementation all the various restrictions should be passed down the tree. -- John Baldwin