WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: mthca use of dma_sync_single is bogus

To: "Michael S. Tsirkin" <mst@xxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: mthca use of dma_sync_single is bogus
From: Roland Dreier <rdreier@xxxxxxxxx>
Date: Mon, 09 Jul 2007 23:48:06 -0700
Authentication-results: sj-dkim-1; header.From=rdreier@xxxxxxxxx; dkim=pass ( sig from cisco.com/sjdkim1004 verified; );
Cc: Lukas Hejtmanek <xhejtman@xxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir@xxxxxxxxxxxxx>, general@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 10 Jul 2007 10:14:52 -0700
Dkim-signature: v=0.5; a=rsa-sha256; q=dns/txt; l=1294; t=1184050100; x=1184914100; c=relaxed/simple; s=sjdkim1004; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=rdreier@xxxxxxxxx; z=From:=20Roland=20Dreier=20<rdreier@xxxxxxxxx> |Subject:=20Re=3A=20mthca=20use=20of=20dma_sync_single=20is=20bogus |Sender:=20; bh=hBOsdJ+2LbyqcNxUIQ+Kqo79080Kc0hAfl4TehMnq70=; b=buVyv85bQiiXqvIPAqVjOFYNSffacv0RNtbGW/o/49h4DGzDAp/mhGCPSq+gABKloGhDvAEn r0jq10P80fWnm31DYYqwWJRHnQqLCxU35wg3aIlpYtKXLdRySmUy0OXj45Jt3MtjgnDQww61j+ kYC5h/Bh3FkT5f2OnSiZ8LPoc=;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070709213913.GB20052@xxxxxxxxxxxxxx> (Michael S. Tsirkin's message of "Tue, 10 Jul 2007 00:39:13 +0300")
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <adalkdpxopo.fsf@xxxxxxxxx> <20070709213913.GB20052@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.20 (linux)
 > >     void
 > >     dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,
 > >                          unsigned long offset, size_t size,
 > >                          enum dma_data_direction direction)

 > This is under Part II - Advanced dma_ usage - I don't think it's dealing with
 > non-consistent memory only (e.g. dma_declare_coherent_memory is there), and 
 > this
 > looks like a good fit.  Most functions here work for both consistent and
 > non-consistent memory...  What makes you suspicious?

I was suspicious because it is described between the main noncoherent
API stuff and dma_cache_sync().  But I think it is probably OK.

Unfortunately it is not that good a fit for our current code, since we
use pci_map_sg() to do the DMA mapping on the MTT memory instead of
dma_map_single().

 > I'm concerned that MTTs need a fair amount of memory,
 > while the amount of coherent memory might be limited.
 > Not that non-coherent memory systems are widespread ...

Yes, for example on ppc 4xx the amount of coherent memory is quite
small by default (address space for non-cached mappings is actually
what is limited, but it amounts to the same thing).

Maybe the least bad solution is to change to using dma_map_single()
instead of pci_map_sg() in mthca_memfree.c.

 - R.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel