[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



> 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?  

Best,
Ian


-------------------------------------------------------
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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.