From: "Michael S. Tsirkin" Subject: Re: [ofa-general] Re: mthca use of dma_sync_single is bogus Date: Tue, 10 Jul 2007 21:30:06 +0300 Message-ID: <20070710183006.GE11320@mellanox.co.il> References: <20070709213913.GB20052@mellanox.co.il> <20070710071547.GA3814@mellanox.co.il> <20070710171142.GC11320@mellanox.co.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: general-bounces@lists.openfabrics.org Errors-To: general-bounces@lists.openfabrics.org To: Roland Dreier Cc: Keir Fraser , Lukas Hejtmanek , xen-devel@lists.xensource.com, "Michael S. Tsirkin" , general@lists.openfabrics.org List-Id: xen-devel@lists.xenproject.org > Quoting Roland Dreier : > Subject: Re: [ofa-general] Re: mthca use of dma_sync_single is bogus > > > Aha. I looked at the code a bit. > > Basically is seems that some architectures use the dma handle > > and some the virtual address to flush the cache, that's > > where the requirement that same parameters are used for > > sync single as for map single comes from. > > > > So it seems that this requirement does not apply to s/g, and that we can just > > build a scatterlist structure and do dma_sync_sg? > > The statement > > synchronise a single contiguous or scatter/gather mapping. All the > parameters must be the same as those passed into the single mapping > API. > > in DMA-API.txt also is clearly attached to dma_sync_sg(). So I don't > think it's a good idea to rely on being able to sync a different > scatterlist than the one that was originally mapped. Hmm. This means there's no way to sync a range within mapping created with map_sg? > It actually doesn't look too bad to replace our use of pci_map_sg() > with dma_map_single(), at least at first glance. I'll try to write a > patch later. Well, the reason map_sg is there is presumably because on some architectures it's worth it to try and make the region contigious in DMA space. But I agree this seems the lesser evil at this point ... -- MST