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 linux network driver to Xen

To: Kaushik Kumar Ram <kaushik@xxxxxxxx>
Subject: Re: [Xen-devel] Porting linux network driver to Xen
From: ravi kerur <rkerur@xxxxxxxxx>
Date: Wed, 4 Nov 2009 15:33:01 -0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 04 Nov 2009 15:33:27 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=+fL17ZO6NCk55nHS4KBKxUohMLHbaFu9cazuuKAYY7o=; b=qrt5bniKup6gZeeP2GPWWg3RinCnQlYeUZ29jZRxpturowDqkJwW0enXy7vlMKvmYo leNfT6JBqhxp9QrxfOuXWGYkp2SVo4vpgOyjFA3ZAqOaJYAIYRKQOfQeRr9q1LYp6TuB EvL+dP4Hc/Jh2bvzQERLrFVlaC9kgFJbf3uNw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=QmnSS3ndz0ycQOejSeUpQ72sbpS6Hlsr2hB8pHSDcm5Qxtzm9XMpK9QrbIMjNAqdCy njeE5hLOrJyGyDKhhn2GtKFYKoYRPu6lqiOSwgKOQOcSXc3K9h/81ORWfXeeTg2Gch5P 3+CbvZ5FWJACjSIDHIL9p2C0OM2fjJdT+IzH4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <67ABFC71-865C-4D9D-96F0-9108F0F4D789@xxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <dfc283f40911040517s22fb9714l5cbea1878d0877fd@xxxxxxxxxxxxxx> <7530916A-AF60-4404-8BF2-7F9DB38BF52B@xxxxxxxx> <dfc283f40911041318o5b165202x49092dfff83459d7@xxxxxxxxxxxxxx> <4592F005-B20D-402B-8A35-D0ED5C8BED2B@xxxxxxxx> <dfc283f40911041429l2fa0213fje39f3cfd224d3652@xxxxxxxxxxxxxx> <67ABFC71-865C-4D9D-96F0-9108F0F4D789@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thank you Kaushik for your help. Very much appreciated.

Thanks
-RK

On Wed, Nov 4, 2009 at 3:07 PM, Kaushik Kumar Ram <kaushik@xxxxxxxx> wrote:

I am confused now, probably I should ask what changes are needed such that I can access NIC from guest domains(domUs) for Tx and Rx?  i.e if I compile native linux driver and run on dom0, how can I access it from domU's

are the changes just the configuration such that path is setup from domU/netfront -> dom0/netback->Bridge->NIC?

Yes. Just make sure the NIC corresponding to this driver is attached to the bridge. If this NIC is not your default
interface you may need to tweak the configuration.

-Kaushik


On Wed, Nov 4, 2009 at 1:47 PM, Kaushik Kumar Ram <kaushik@xxxxxxxx> wrote:
Again, you don't have to make any changes to the driver. Netback/netfront do not interact directly with the
NIC's driver. 

-Kaushik

On Nov 4, 2009, at 3:18 PM, ravi kerur wrote:

Thanks kaushik, How does netfront/netback interact with this driver? I believe I need netback functionality running in dom0 and netfront running in domU's for the existing driver.  One of the documents has following explanation for Tx/Rx path.

"For transmit (TX) requests the driver domain(dom0) uses a hypercall to map the guest page(domU) into its address space before sending the request through the bridge. When the physical device driver frees the page a callback function is automatically invoked to return a response to netfront which then revokes the grant.

For RX requests netfront posts I/O buffer page grants to the RX I/O channel. When netback receives a packet from the bridge it retrieves a posted grant from the I/O channel and issues a grant copy hypercall to copy the packet to the guest page(domU). Finally, netback sends a response to the guest via the RX channel indicating a packet is available."

I am not quite sure what changes or api's I need to call such that existing Tx/Rx buffers(rings) used for DMA in the native drivers starts talking via netfront/netback.

Inputs appreciated.

Thanks
-RK


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