From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH] skeleton frontend/backend examples and a deadlock Date: Thu, 03 Nov 2005 12:36:52 +1100 Message-ID: <1130981813.8734.10.camel@localhost.localdomain> References: <1130908964.18258.25.camel@localhost.localdomain> <1130935066.4719.22.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1130935066.4719.22.camel@localhost> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Harry Butterworth Cc: Xen Mailing List , mark.williamson@cl.cam.ac.uk List-Id: xen-devel@lists.xenproject.org On Wed, 2005-11-02 at 12:37 +0000, Harry Butterworth wrote: > On Wed, 2005-11-02 at 16:22 +1100, Rusty Russell wrote: > > Here are example frontend and backend driver skeletons. They're > > *designed* to handle driver restart and module unloading. However, > > device_unregister deadlocks. I guess noone tried testing > > unregister_xenbus_watch when not called from a watch callback. > > Thanks, that'll be useful for me to know when it comes to testing my > code. > > For comparison, I've knocked up a skeleton FE/BE driver based on the > xenidc API that I'm using for my USB driver. > > You'll see that my patch is smaller, simpler and provides significantly > more functionality: enough to send messages and transactions > bi-directionally between the FE and BE. For a fair comparison, yours > would require interrupt handlers, use of the RING macros, correct memory > barriers etc. Agreed! These drivers are a clear demonstration that the current xenbus device API is too low-level. More obvious than putting a layer on top of the xenbus API was to change the xenbus API to be more convenient. But when I tried to rewrite the xenbus API, I realised I would have had to rewrite every driver, and it doesn't get much nicer anyway. A connection-oriented API seems an obviously-good idea to me. Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman