From owner-svn-src-all@FreeBSD.ORG Mon Nov 23 15:06:13 2009 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 8C8381065692; Mon, 23 Nov 2009 15:06:13 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id AD56C8FC12; Mon, 23 Nov 2009 15:06:12 +0000 (UTC) Received: from ydesk.samsco.home (ydesk.samsco.home [192.168.254.15]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id nANF68Wk014274; Mon, 23 Nov 2009 08:06:08 -0700 (MST) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Scott Long In-Reply-To: <200911230838.20217.jhb@freebsd.org> Date: Mon, 23 Nov 2009 08:06:08 -0700 Content-Transfer-Encoding: 7bit Message-Id: <2B4A2CD3-AA54-4030-9F39-3BF7DFC0434C@samsco.org> References: <200911222050.nAMKoRYh029141@svn.freebsd.org> <0298EC7E-26D5-460A-9EBE-5ABEAE8B21BD@samsco.org> <200911230838.20217.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1076) X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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: Mon, 23 Nov 2009 15:06:13 -0000 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. Scott