From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 02/15] [swiotlb] Add swiotlb_engine structure for tracking multiple software IO TLBs. Date: Tue, 26 Jan 2010 11:20:43 -0500 Message-ID: <20100126162043.GA13523@phenom.dumpdata.com> References: <1263510064-16788-1-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-2-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-3-git-send-email-konrad.wilk@oracle.com> <20100122105059G.fujita.tomonori@lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20100122105059G.fujita.tomonori@lab.ntt.co.jp> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: FUJITA Tomonori Cc: Ian.Campbell@eu.citrix.com, jeremy@goop.org, xen-devel@lists.xensource.com, joerg.roedel@amd.com, chrisw@sous-sol.org, iommu@lists.linux-foundation.org, dwmw2@infradead.org, alex.williamson@hp.com List-Id: xen-devel@lists.xenproject.org > Please don't add another 'layer' to the dma path. This leads to too > many indirect function calls. Some people concern about the overhead > of even the current code. Any ideas on a good benchmarking tool for that? > > Create something like libswiotlb or whatever (as I said before) to > export functions. Then call them directly. I think what you suggesting is that that I abstract all of the address translation functions ('phys_to_dma', 'bus_to_phys', etc.) from the swiotlb.c layer. Specifically, to altogether remove the phys_to_dma, bus_to_phys, etc. calls from the swiotlb.c file. In place of them, have the results of those functions (both physical and bus address) be passed in to the map_single and unmap_single calls. The layer that calls map_single/unmap_single would then be responsible for translating the phys/bus/virtual addresses. Implementation wise, I could split the swiotlb.c in two files: a) /lib/swiotlb-core.c and b) /lib/swiotlb-default.c. The 'a)' would have the swiotlb_init_*, swiotlb_free, swiotlb_bounce, sync_single, map_single, and unmap_single. The 'b)' would contain the DMA function, such as swiotlb_sync_single_*, swiotlb_[map|unmap]_[page|sg]_* and swiotlb_[alloc|free]_coherent. Naturally it would do the phys,bus->bus,phys translations. The Xen complementary to 'b)' would be in a different library/file (/lib/swiotlb-xen.c?). Is that close to what you were thinking? > > btw, please send swiotlb patches to lkml. Once we've nailed down the structure of the changes I'll definitely send it out to LKML.