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: [ofa-general] Re: mthca use of dma_sync_single is bogus

To: "Michael S. Tsirkin" <mst@xxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [ofa-general] Re: mthca use of dma_sync_single is bogus
From: Roland Dreier <rdreier@xxxxxxxxx>
Date: Tue, 10 Jul 2007 11:09:01 -0700
Authentication-results: sj-dkim-4; header.From=rdreier@xxxxxxxxx; dkim=pass ( sig from cisco.com/sjdkim4002 verified; );
Cc: Lukas Hejtmanek <xhejtman@xxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir@xxxxxxxxxxxxx>, general@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 17 Jul 2007 05:01:30 -0700
Dkim-signature: v=0.5; a=rsa-sha256; q=dns/txt; l=943; t=1184090947; x=1184954947; c=relaxed/simple; s=sjdkim4002; 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=20[ofa-general]=20Re=3A=20mthca=20use=20of=20dma_sync_s ingle=20is=20bogus |Sender:=20; bh=tbianXPLOXyEpbFAOt1jFTI/5dtZjL3rApfUGHxWqMU=; b=TAbbZuFNLi4jKjtJmI51fEgmnD3TDQ4IZt8K09hu2DYndy571Xp3cvnhkS7kKVdTIV+7sKOU pguk27SDvAGYeOgbtIlWaZat3LwyW0jguLJ2N7kDZj3U1bskMVIyRk0l;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070710171142.GC11320@xxxxxxxxxxxxxx> (Michael S. Tsirkin's message of "Tue, 10 Jul 2007 20:11:42 +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> <adamyy4vjo9.fsf@xxxxxxxxx> <20070710071547.GA3814@xxxxxxxxxxxxxx> <adabqekuvde.fsf@xxxxxxxxx> <20070710171142.GC11320@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.20 (linux)
 > 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.

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.

 - R.

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