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

Re: [Xen-devel] [PATCH 1/9] Xen Share: Simplified I/O Mechanism

To: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/9] Xen Share: Simplified I/O Mechanism
From: "Mike D. Day" <ncmike@xxxxxxxxxx>
Date: Wed, 14 Jun 2006 13:46:37 -0400
Cc: Xen Mailing List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 14 Jun 2006 10:48:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1149572143.5183.25.camel@xxxxxxxxxxxxxxxxxxxxx>
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: <1149572143.5183.25.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.4 (Macintosh/20060530)
Rusty Russell wrote:
Finally, a scatter-gather list mechanism allows the domains to
associate their pages with arbitrary queue numbers in the shared
region, to transport bulk data (effectively by having the hypervisor
do "DMA" between domains).

The sg transfer mechanism avoids bounce buffers and does a straight copy from_user or to_user below. So this is an alternative to page flipping, right? It would be interesting to see how the direct copy performs compared to page flipping on various architectures. Page table updates are not free and processors are getting more efficient at bulk dma.

> +/* Copy from src to dst, return amount copied. */
+static int do_copy(const struct sg_list *sgdst, const struct sg_list *sgsrc,
+                  unsigned long (*copy)(paddr_t, paddr_t, unsigned long))
+{
+       unsigned long totlen, src, dst, srcoff, dstoff;
+       int ret = 0;
+
+       totlen = 0;
+       src = dst = 0;
+       srcoff = dstoff = 0;
+       while (src < sgsrc->num_sg) {
+               unsigned long len;
+               len = min(sgsrc->sg[src].len - srcoff,
+                         sgdst->sg[dst].len - dstoff);
+
+               len = copy(sgdst->sg[dst].addr+dstoff,
+                          sgsrc->sg[src].addr+srcoff,
+                          len);




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