From owner-svn-src-head@FreeBSD.ORG Tue Aug 31 17:51:03 2010 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 4A62910656A6; Tue, 31 Aug 2010 17:51:03 +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 18E778FC0C; Tue, 31 Aug 2010 17:51:03 +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 9E67A46B38; Tue, 31 Aug 2010 13:51:02 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 011F08A04E; Tue, 31 Aug 2010 13:50:57 -0400 (EDT) From: John Baldwin To: Pyun YongHyeon Date: Tue, 31 Aug 2010 13:50:16 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201008311733.o7VHXmxX037013@svn.freebsd.org> In-Reply-To: <201008311733.o7VHXmxX037013@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201008311350.17175.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 31 Aug 2010 13:50:57 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham 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 Subject: Re: svn commit: r212061 - 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: Tue, 31 Aug 2010 17:51:03 -0000 On Tuesday, August 31, 2010 1:33:48 pm Pyun YongHyeon wrote: > Author: yongari > Date: Tue Aug 31 17:33:48 2010 > New Revision: 212061 > URL: http://svn.freebsd.org/changeset/base/212061 > > Log: > Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA > tag. All controllers that are not BCM5755 or higher have 4GB > boundary DMA bug. Previously bge(4) used 32bit DMA address to > workaround the bug(r199670). However this caused the use of bounce > buffers such that it resulted in poor performance for systems which > have more than 4GB memory. Because bus_dma(9) honors boundary > restriction requirement of DMA tag for dynamic buffers, having a > separate TX/RX mbuf DMA tag will greatly reduce the possibility of > using bounce buffers. For DMA buffers allocated with > bus_dmamem_alloc(9), now bge(4) explicitly checks whether the > requested memory region crossed the boundary or not. > With this change, only the DMA buffer that crossed the boundary > will use 32bit DMA address. Other DMA buffers are not affected as > separate DMA tag is created for each DMA buffer. > Even if 32bit DMA address space is used for a buffer, the chance to > use bounce buffer is still very low as the size of buffer is small. > This change should eliminate most usage of bounce buffers on > systems that have more than 4GB memory. > > More correct fix would be teaching bus_dma(9) to honor boundary > restriction for buffers created with bus_dmamem_alloc(9) but it > seems that is not easy. > > While I'm here cleanup bge_dma_map_addr() and remove unnecessary > member variables in bge_dmamap_arg structure. Keep in mind the PAE case where you cannot effectively specify a 4GB boundary. I used a 2GB boundary for twa(4) in the PAE case to deal with the boundary issue. Probably though, bus_dma should just always enforce a 4GB boundary, at least on x86. -- John Baldwin