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] simple backend, frontend

To: Deepak Manohar <mjdeepak@xxxxxxxxx>
Subject: Re: [Xen-devel] simple backend, frontend
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Wed, 17 Nov 2004 21:59:04 +0000
Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxx>, mark.williamson@xxxxxxxxxxxx, andrew.warfield@xxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 17 Nov 2004 23:03:57 +0000
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: Your message of "Wed, 17 Nov 2004 13:27:33 EST." <fdef3c240411171027e2c31e4@xxxxxxxxxxxxxx>
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
> Hi,
> 
>   Writing a custom backend driver...... can a custom backend driver be
> a module in the linux kernel or does it have to be built in?
> 
>  write now the backend and front end are very simple.
> 
>  a user level program establishes a shared event channel using -
> libxc.  this part is complete.

If you mean that the user-level program creates the event channel, I
would recommend not doing that. Instead, your frontend should
allocate an unbound port that the backend can then connect to (or vice
versa). i.e., frontend does EVTCHNOP_alloc_unbound.

I guess if you are using an existing front-end then this doesn't make
sense as you need to go along with the existing protocol. However,
both blkif and netif protocols will change to the new evtchn creation
model in the near future.

> this is the plan for the next part but need some info: 
> 
> i manually plan to install the module passing the eventchannel port.
> as a command line argument to the module. but i need to know if a
> linux kernel module can access the xen api such as
> "bind_evtchn_to_irq".

As Bin says, some functions will need EXPORT_SYMBOL(). Bin checked in
EXPORT_SYMBOL(bind_evtchn_to_irq) earlier today.

 -- Keir

> thanks.
> 
> 
> Deepak
> 
> 
> 
> 
> On Sun, 14 Nov 2004 15:42:44 +0000, Keir Fraser
> <keir.fraser@xxxxxxxxxxxx> wrote:
> > 
> > 
> > > Hi,
> > >
> > >  Sorry I seem to be stuck and asking similar questions.
> > >
> > > > > linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c
> > > >
> > > > That's the one in kernel users will call into.
> > >
> > >  That file does not contain any code to create event channels.
> > >
> > >
> > >  Do I have to write some code in Xen tht uses xen/common/event_channel.c 
> > > creates
> > > an event channel on init. And then pass the port returned to some
> > > other program which passes it to the other domain?
> > 
> > The 'old' model for creating event channels was that xend would create
> > them and pass each domain the id of its end. So no creation code
> > needed in XenLinux.
> > 
> > The 'new' model (in which one domain creates an unbound port that the
> > other end then connects to) is rather recent and so no drivers in
> > XenLinux use it, so there's no code to steal. :-)
> > 
> > evtchn.c is all about receipt and demux of events. You should create
> > your own code to create an unbound port, then you should use
> > bind_evtchn_to_irq() to get yourself a Linux IRQ number that you can
> > then get interrupts for by using 'request_irq()'.
> > 
> > If you're implementing a user-space driver then you won't want to bind
> > into the Linux IRQ subsystem -- instead you would open /dev/xen/evtchn,
> > bind to your event-channel port, then read() or poll() your file
> > descriptor.  Currently only one process can have /dev/xen/evtchn open
> > at any time, but I know of at least two patches to fix this, so I
> > guess one of these ought to be checked in to the tree!
> > 
> > So, yes, in short, you have to write the bit of code that you describe
> > in your email. :-)
> > 
> >  -- Keir
> >



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel