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

[Xen-devel]How does xen-4.0.0 net backend work

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel]How does xen-4.0.0 net backend work
From: cc Luit <universalbillow@xxxxxxxxx>
Date: Thu, 24 Feb 2011 21:48:16 +0800
Delivery-date: Thu, 24 Feb 2011 05:49:12 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=kREOwSlccKDAWt8bX/VK/3D7J+zXiWsvLu9iTMSqCSo=; b=PGRMb3mkMCM2Pf+TpxClMHo/IpwBFtV8ivuCaJIETAzu4Ew1kE3uxjqOVNUP0v8CvK LAk7Lq5m2wgToKY4O96PXCGCeZ1R+6BaK1WaLGttUmkHqP28rMnMdF0R5s1Gseff+bBu LNKZUU8xqOn+d7FC/EGMXXxb/WlQwByw3a5qo=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=n2v3k2fcC+PlJmJM+QB64AOQwXjCbINAGbkgUGKyRW/bhn1svfRAF/krZ0Ekr6mUIM L4spOEK5APQGwvZb+ySd9AhGePNWVocFZqsB/cJGuWHxd944gi1TSab1Xcg/lY463/GW Jx1uT22ycBaZChtE9WTWyHMLbfeer76NYbzCk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, everyone.
These days I was reading the code of xen/linux/drivers/xen/netback/netback.c and xen/linux/drivers/net/xen-netfront.c 
in order to understand the control flow like how the domU transmit the packets from frontend to backend and then to the dom0 net-driver, but I came across some questions in netback.c.
    after the frontend transmitted the packets, dom0 schedule to the net_tx_tasklet, which goes to the net_tx_action() function:
1409 static void net_tx_action(unsigned long unused)
1410 {
1411         unsigned nr_mops;
1412         int ret;
1413
1414         if (dealloc_cons != dealloc_prod)
1415                 net_tx_action_dealloc();
1416
1417         nr_mops = net_tx_build_mops();
1418
1419         if (nr_mops == 0)
1420                 return;
1421
1422         ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref,
1423                                         tx_map_ops, nr_mops);
1424         BUG_ON(ret);
1425
1426         net_tx_submit();
1427 }

in the net_tx_submit() function, it finally goes to a code:

1394                 netif_rx(skb);

so I'm curious why in the tx_submit there is a rx function? is the parameter skb the buffer that has been sent to the network? or it is the buffer that has not yet been sent? what is the netif_rx() function used to ?

Another question is: how the backend interact with the real dom0 driver? I cannot actually find the path    like what I speculate: backend push the packet to a buffer where linux driver will poll and send it to the real DMA ring...(it is just what I guess the interactive path is@@), can anyone explain the detail of it?

I'm not sure if I have expressed my questions clearly, it not, please tell me, I appreciate your help.

Thanks in advance:)

--
- Luit @ Parallel Processing Institute, Fudan University 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>