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] Porting network drivers to Xen?

To: "Paul K. Fisher" <pfisher@xxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] Porting network drivers to Xen?
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Mon, 06 Oct 2003 08:25:01 +0100
Delivery-date: Mon, 06 Oct 2003 08:26:12 +0100
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: Your message of "Mon, 06 Oct 2003 08:16:29 BST." <E1A6PbZ-0004p3-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>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
> > RealTek 8139C.  Just what I have on an extra machine I was using to poke
> > around with Xen.  Network card didn't work, so I figure that was a good a
> > place as any to start learning to hack.
> 
> 'diffing' the Xen e100 driver against the stock Linux one will be
> very instructive. The patch is very short.
> 
> What's the recommended Linux driver for your card, 8139cp.c or 8139too.c ?
> 
> A quick glance reveals that the 8139too driver contains a `watch
> thread' (interruptible_sleep_on_timeout). This will have to be
> transformed into an event call back that uses schedule_timeout.

There are two key issues when porting 8139.

First, there's the timer issue. That is fixed either by removing the
watch thread altogether (maybe risky) or by using add_ac_timer() to
get yourself an event callback sometime later. The end of the handler
should call add_ac_timer() again if the event is periodic.

Second, there's the issue that 8139 doesn't do DMA. On transmit this
is not a problem if you don't specify NETIF_F_SG in the NIC flags --
in that case Xen will provide you with a linearized skbuff which is
directly readable/writeable by the NIC driver. Receive is harder,
since the data page does not have a mapping in Xen's address space. To
read out of the NIC buffer you will have to do something like:
 vdata = map_domain_mem(skb->data);
 copy 'len' bytes to 'vdata' from NIC buffer
 unmap_domain_mem(vdata);
 skb_put(len);

 -- Keir


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>