From: Daniel Stodden Subject: Re: Frontend/Backend model Date: Sun, 18 Mar 2007 13:08:03 +0100 Message-ID: <1174219683.16028.21.camel@lapbode42.lrr.in.tum.de> References: <31436f4a0703171215m3f18a72an583b5633b6a8b66a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <31436f4a0703171215m3f18a72an583b5633b6a8b66a@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Developers List-Id: xen-devel@lists.xenproject.org On Sat, 2007-03-17 at 21:15 +0200, David Shwatrz wrote: > Hello, hi. > A question about frontend/backend model: >=20 > I had looked in the code of netfront (and blockfront) and I wonder=20 > : do these modules operate in soft_irq or interrupt context?=20 > For exmaple, methods like network_start_xmit() (for trasmitting > frames=20 > in nerfront ) or network_tx_buf_gc() (for receiving frames in > netfront) ? > I see that the netif_int() calls network_tx_buf_gc(). But is domU > network_tx_buf_gc() method called from a regular interrupt context=20 > (like in the ususal case, when we deal with ordinary=20 > drivers) ? Am I permitted to call a method that may sleep in these > methods ?=20 no. frontend drivers are regular netdevs and therefore have to adhere to the context the protocol stack calls the methods. xen linux doesn't change much about that. > As I understood, interrrupt handling in Xen is different, because > interrupts are=20 > handled by domain 0, and as I understood there are events channels and > pending > events, and the interrupts are in fact handled first by domain 0, > which activates > some event channel messages. while hardware interrupts are caught by xen and dom0, there are still interrupts involved here, though 'virtual' ones. indeed, these are managed by event channels, but the resulting execution model in the guest doesn't differ much a hardware irq. xen builds a custom interrupt frame on the guest kernel stack (grep the xen code for 'trap_bounce') and transfers guest control to the registered handler. yes, the virtual cpu where this is happening becomes a preemptible resource. but that's fully transparent for the guest system and doesn't change much about the kernel works. interrupt handlers won't turn into threads. cannot. > I want to verify this point for better understanding the > frontend/backend model.=20 hope that helped. regards, daniel --=20 Daniel Stodden LRR - Lehrstuhl f=C3=BCr Rechnertechnik und Rechnerorganisation Institut f=C3=BCr Informatik der TU M=C3=BCnchen D-85748 Garc= hing http://www.lrr.in.tum.de/~stodden mailto:stodden@cs.tum.edu PGP Fingerprint: F5A4 1575 4C56 E26A 0B33 3D80 457E 82AE B0D8 735B