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] RTL8139 support

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] RTL8139 support
From: Sean Atkinson <sean@xxxxxxxxxxxxxx>
Date: Thu, 11 Mar 2004 10:27:33 +0100
Cc: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 11 Mar 2004 09:29:44 +0000
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: <E1B0o8F-0007Bt-00@xxxxxxxxxxxxxxxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Organization: Netproject
References: <E1B0o8F-0007Bt-00@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
Hi,

> Accesses to the skb->data on the receive path must be wrapped with
> map_domain_mem()/unmap_domain_mem(). 
> 
> eg. 
>  char *vdata = map_domain_mem(__pa(skb->data));
>  <use vdata as you would normally use skb->data>
>  unmap_domain_mem(vdata);
> 
> I've taken a brief look at the driver and you may get away with just
> replacing wth_copy_and_sum() in include/xeno/etherdevice.h with the
> following:
> 
> static inline void eth_copy_and_sum(struct sk_buff *dest, 
>        unsigned char *src, int len, int base)
> {
>     char *vdata = map_domain_mem(__pa(dest->data));
>     memcpy(vdata, src, len);
>     unmap_domain_mem(vdata);
> }
> 
> (You may need to #include <asm/domain_page.h>).

Success!  Your suggestions worked first time, and my RTL8139 NIC now
appears to be working fine.

I tested the performance between my regular Linux kernel on Fedora and
Xen 1.3.  An NFS (using default UDP) copy of a large file was almost 5%
slower on Xen than Linux, and a scp (TCP) took just over 13% longer. 
Presumably these are reasonable results given the driver's having to
make extra copies in Xen?

The only unusual result was that Xen's time to flood ping 1000 packets
over 100 Mbps Ethernet was 10306ms, less than Fedora's 19503ms for the
same test.  For comparison an nVidia nForce in another machine achieved
only 861ms, which makes both results for the RTL8139 look slow.

Many thanks for your time and help in fixing this so promptly.

Cheers,

Sean.

-- 
Sean Atkinson <sean@xxxxxxxxxxxxxx>
Netproject

Attachment: xeno-8139too.patch
Description: Text document