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/
Home Products Support Community News


Re: [Xen-devel] Porting network drivers to Xen?

To: "Paul K. Fisher" <pfisher@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Porting network drivers to Xen?
From: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>
Date: Sun, 05 Oct 2003 22:11:16 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxxx, Ian.Pratt@xxxxxxxxxxxx
Delivery-date: Sun, 05 Oct 2003 22:12:08 +0100
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: Your message of "Sun, 05 Oct 2003 14:44:36 CDT." <DEEKLMFOILALDEICNAAPEECECAAA.pfisher@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
> Is there any written guidance available giving the basic steps to port other
> linux network drivers to Xen?  I did look around a little in the source tree
> and didn't find it, so the pointer would be appreciated.

Apologies -- no such file currently exists, but we were
discussing the need to write one just a couple of days ago.
We'll try and get around to this soon.

Porting network drivers is generally very straight forward. Our
device drivers use the traditional Linux API rather than the new
Linux NAPI API. (Most decent Gig Ethernet cards have hardware
interrupt hold-off, which works at least as well as NAPI anyway).

In many cases, just copying the driver into the tree and building
it will work. Getting drivers that use scatter-gather DMA working
is working is actually easier than old PIO drivers. The reason
for this is that network buffer pages are, by default, not mapped
into Xen's address space, hence you can't just read and write
them. You need to call map_domain_mem( phys addr ) first, then
remember to call unmap_domain_mem( virt addr ) when you're
done. See the e100 driver for an example.

The other thing to watch out for is that Xen is entirely event
driven -- there's no process contexts that you can use semaphores
or wait queues on. It's just possible that there's some Ethernet
driver that uses these for sleeping during media detection. In
which case, it can probably be fairly easily rewritten to use
schedule_timeout (which is supported).

What card are you wanting to get working?  


This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
Xen-devel mailing list