Skip to contentSkip to conversation

USB virt status

PATCH Harry Butterworth 4 participants 8 messages Oct 30, 2005 – Nov 5, 2005 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Here's the latest USB code. This patch is much less crufty than the one I sent out a week ago since I just finished the refactoring which was in-progress in the last patch.

In this patch, the inter-domain communication endpoint object (xenidc_endpoint) is theoretically code-complete but is substantially unexecuted so I wouldn't recommend trying to use it unless you want to help test it.

FIXMEs in the patch indicate the work remaining to complete the USB driver which include:

1) Implement the xenidc_rbr_provider_pool and the xenidc_rbr_mapper_pool objects which are used to implement the bulk data transfer between the FE and BE based on the grant-tables API.

2) Update the usbback_driver_port state machine to handle the cn and dn stimuli.

3) Some minor bits and pieces here and there.

I also need to hook up the claim and release port interfaces to xenbus.

And of course, lots of testing.

Enjoy.

Signature · 1 line
Harry Butterworth <[email protected]>
linux-2.6-xen-sparse/arch/xen/Kconfig +55 -0
diff -r b5903c9aeda5 -r e93b9c54edb3 linux-2.6-xen-sparse/arch/xen/Kconfig
@@ -38,6 +38,14 @@
 	  (e.g., hard drives, network cards). This allows you to configure
 	  such devices and also includes some low-level support that is
 	  otherwise not compiled into the kernel.
+
+config XEN_IDC_TRACE
+	bool "Inter-domain communication code tracing"
+	default y
+	help
+	  This option causes the IDC code to output a continual trace of its
+          activity.
+	  Say N here unless you are trying to debug this code.
 
 config XEN_BLKDEV_BACKEND
 	bool "Block-device backend driver"
@@ -69,6 +77,29 @@
 	  The network-device backend driver allows the kernel to export its
 	  network devices to other guests via a high-performance shared-memory
 	  interface.
+
+config XEN_USBDEV_BACKEND
+	tristate "USB-device backend driver"
+	depends on XEN_PHYSDEV_ACCESS
+	select USB
+	default m
+	help
+	  The USB-device backend driver allows the kernel to export USB
+	  devices to USB-device frontend drivers running in other domains.
+	  This is not required for USB device access in domain 0 or any domain
+	  given exclusive control over a USB host controller device at the PCI
+	  level.
+	  Say Y or M if you want to use this kernel to export a USB device to
+          another domain running a USB-device frontend driver.
+
+config XEN_USBDEV_BACKEND_TRACE
+	bool "USB-device backend driver tracing"
+	depends on XEN_USBDEV_BACKEND
+	default y
+	help
+	  This option causes the driver to output a continual trace of its
+          activity.
+	  Say N here unless you are trying to debug the driver.
 
 config XEN_TPMDEV_FRONTEND
         bool "TPM-device frontend driver"
@@ -128,6 +159,30 @@
 	  are unsure; or if you experience network hangs when this option is
 	  enabled; then you must say N here.
 
+config XEN_USBDEV_FRONTEND
+	tristate "USB-device frontend driver"
+	select USB
+	default m
+	help
+	  The USB-device frontend driver allows the kernel to access USB
+	  devices exported by a USB-device backend driver running in another
+	  domain.
+	  This is not required for USB device access in domain 0 or any domain
+	  given exclusive control over a USB host controller device at the PCI
+	  level.
+	  Say Y or M if you want to use a USB-device backend driver to export a
+	  USB device from another domain to the domain which will run this
+	  kernel.
+
+config XEN_USBDEV_FRONTEND_TRACE
+	bool "USB-device frontend driver tracing"
+	depends on XEN_USBDEV_FRONTEND
+	default y
+	help
+	  This option causes the driver to output a continual trace of its
+          activity.
+	  Say N here unless you are trying to debug the driver.
+
 config XEN_BLKDEV_TAP
 	bool "Block device tap driver"
 	default n
linux-2.6-xen-sparse/drivers/xen/Makefile +3 -2
diff -r b5903c9aeda5 -r e93b9c54edb3 linux-2.6-xen-sparse/drivers/xen/Makefile
@@ -1,4 +1,3 @@
-
 obj-y	+= util.o
 
 obj-y	+= console/
@@ -6,12 +5,14 @@
 obj-y	+= balloon/
 obj-y	+= privcmd/
 obj-y	+= xenbus/
+obj-y	+= xenidc/
 
 obj-$(CONFIG_XEN_BLKDEV_BACKEND)	+= blkback/
 obj-$(CONFIG_XEN_NETDEV_BACKEND)	+= netback/
+obj-$(CONFIG_XEN_USBDEV_BACKEND)	+= usbback/
 obj-$(CONFIG_XEN_TPMDEV_BACKEND)	+= tpmback/
 obj-$(CONFIG_XEN_BLKDEV_FRONTEND)	+= blkfront/
 obj-$(CONFIG_XEN_NETDEV_FRONTEND)	+= netfront/
+obj-$(CONFIG_XEN_USBDEV_FRONTEND)	+= usbfront/
 obj-$(CONFIG_XEN_BLKDEV_TAP)    	+= blktap/
 obj-$(CONFIG_XEN_TPMDEV_FRONTEND)	+= tpmfront/
-
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +1 -0
diff -r b5903c9aeda5 -r e93b9c54edb3 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
@@ -264,6 +264,7 @@
 {
 	return xenbus_register_driver_common(drv, &xenbus_backend);
 }
+EXPORT_SYMBOL(xenbus_register_backend);
 
 void xenbus_unregister_driver(struct xenbus_driver *drv)
 {
tools/ioemu/target-i386-dm/Makefile +1 -1
diff -r b5903c9aeda5 -r e93b9c54edb3 tools/ioemu/target-i386-dm/Makefile
@@ -188,7 +188,7 @@
 #########################################################
 
 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DAPIC_SUPPORT
-LIBS+=-lm -L../../libxc -lxenctrl
+LIBS+=-lm -L../../libxc -lxenctrl -lpthread
 ifndef CONFIG_USER_ONLY
 LIBS+=-lz
 endif
tools/python/xen/xend/server/usbif.py +13 -4
diff -r b5903c9aeda5 -r e93b9c54edb3 tools/python/xen/xend/server/usbif.py
@@ -22,8 +22,9 @@
 """Support for virtual USB hubs.
 """
 
+from xen.xend import sxp
+
 from xen.xend.server.DevController import DevController
-
 
 class UsbifController(DevController):
     """USB device interface controller. Handles all USB devices
@@ -35,8 +36,16 @@
         """
         DevController.__init__(self, vm)
 
-
-    def getDeviceDetails(self, _):
+    def getDeviceDetails(self, config):
         """@see DevController.getDeviceDetails"""
 
-        return (self.allocateDeviceID(), {}, {})
+        path = sxp.child_value(config, 'path')
+
+        devid = self.allocateDeviceID()
+
+        back  = { 'path'   : path,
+                  'handle' : "%i" % devid }
+
+        front = { 'handle' : "%i" % devid }
+
+        return (devid, back, front)
tools/python/xen/xm/create.py +36 -6

81 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/Makefile new file +9 -0
diff -r b5903c9aeda5 -r e93b9c54edb3 linux-2.6-xen-sparse/drivers/xen/usbback/Makefile
@@ -0,0 +1,9 @@
+obj-$(CONFIG_XEN_USBDEV_BACKEND) += usbback.o
+
+usbback-objs :=                \
+usbback_device.o               \
+usbback_driver_backend.o       \
+usbback_driver.o               \
+usbback_driver_port.o          \
+usbback_driver_port_resource.o \
+usbback_module.o
linux-2.6-xen-sparse/drivers/xen/usbback/usbback_assert.h new file +43 -0

43 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_device.c new file +401 -0

401 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_device.h new file +37 -0
diff -r b5903c9aeda5 -r e93b9c54edb3 linux-2.6-xen-sparse/drivers/xen/usbback/usbback_device.h
@@ -0,0 +1,37 @@
+/*****************************************************************************/
+/* A device object representing the low-level connection to a single         */
+/* front-end.                                                                */
+/*                                                                           */
+/* Copyright (c) 2005 Harry Butterworth IBM Corporation                      */
+/*                                                                           */
+/* This program is free software; you can redistribute it and/or modify it   */
+/* under the terms of the GNU General Public License as published by the     */
+/* Free Software Foundation; either version 2 of the License, or (at your    */
+/* option) any later version.                                                */
+/*                                                                           */
+/* This program is distributed in the hope that it will be useful, but       */
+/* WITHOUT ANY WARRANTY; without even the implied warranty of                */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General */
+/* Public License for more details.                                          */
+/*                                                                           */
+/* You should have received a copy of the GNU General Public License along   */
+/* with this program; if not, write to the Free Software Foundation, Inc.,   */
+/* 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                   */
+/*                                                                           */
+/*****************************************************************************/
+
+#ifndef USBBACK_DEVICE_H
+#define USBBACK_DEVICE_H
+
+extern int usbback_device_class_init( void );
+
+extern void usbback_device_class_exit( void );
+
+struct usbback_device;
+
+extern void usbback_device_set_drvdata
+  ( struct usbback_device * device, void * data );
+
+extern void * usbback_device_get_drvdata( struct usbback_device * device );
+
+#endif
linux-2.6-xen-sparse/drivers/xen/usbback/usbback_driver.c new file +249 -0

249 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_driver.h new file +57 -0

57 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_driver_backend.c new file +603 -0

603 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_driver_backend.h new file +63 -0

63 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_driver_port.c new file +1163 -0

1,163 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_driver_port.h new file +149 -0

149 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_driver_port_resource.c new file +1228 -0

9 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_driver_port_resource.h new file +87 -0

87 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_module.c new file +83 -0

83 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbback/usbback_trace.h new file +54 -0

54 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/Makefile new file +7 -0
diff -r b5903c9aeda5 -r e93b9c54edb3 linux-2.6-xen-sparse/drivers/xen/usbfront/Makefile

Lines of this file are not shown. View the raw message.

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_assert.h new file +44 -0

44 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_device.c new file +1314 -0

1,314 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_device.h new file +85 -0

85 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_driver.c new file +880 -0

880 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_driver.h new file +35 -0
diff -r b5903c9aeda5 -r e93b9c54edb3 linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_driver.h

Lines of this file are not shown. View the raw message.

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_hcd_resource.c new file +945 -0

945 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_hcd_resource.h new file +104 -0

104 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_module.c new file +92 -0

92 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_sll.h new file +133 -0

133 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront_trace.h new file +53 -0

53 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/Makefile new file +17 -0
diff -r b5903c9aeda5 -r e93b9c54edb3 linux-2.6-xen-sparse/drivers/xen/xenidc/Makefile

Lines of this file are not shown. View the raw message.

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_callback.c new file +61 -0

61 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_channel_ring.h new file +44 -0

44 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_concatenate.c new file +140 -0

140 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_endpoint.c new file +176 -0

176 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_gateway.c new file +1344 -0

1,344 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_gateway_initiator_resource.c new file +411 -0

411 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_gateway_initiator_resource.h new file +95 -0

95 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_gateway_ring.h new file +69 -0

69 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_gateway_target_resource.c new file +193 -0

193 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_gateway_target_resource.h new file +68 -0

68 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_gnttab_channel.c new file +1693 -0

1,693 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_gnttab_channel_enumeration.dot new file +55 -0

55 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_local_buffer_reference.c new file +618 -0

618 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_rbr_mapper_pool.c new file +80 -0

80 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_rbr_provider_pool.c new file +80 -0

80 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_trace.h new file +54 -0

54 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_vaddress.c new file +129 -0

129 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_work.c new file +110 -0

110 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_wrapping.c new file +165 -0

165 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_xbgt_channel.c new file +1737 -0

1,737 lines not on this page · raw message

linux-2.6-xen-sparse/drivers/xen/xenidc/xenidc_xbgt_channel_enumeration.dot new file +109 -0

109 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc.h new file +122 -0

122 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_address.h new file +60 -0

60 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_callback.h new file +166 -0

166 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_channel.h new file +146 -0

146 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_concatenate.h new file +47 -0

47 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_endpoint.h new file +203 -0

203 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_error.h new file +56 -0

56 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_gateway.h new file +253 -0

253 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_gnttab_channel.h new file +222 -0

222 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_local_buffer_reference.h new file +283 -0

283 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_rbr_mapper_pool.h new file +150 -0

150 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_rbr_provider_pool.h new file +160 -0

160 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_remote_buffer_reference.h new file +42 -0

42 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_vaddress.h new file +30 -0
diff -r b5903c9aeda5 -r e93b9c54edb3 linux-2.6-xen-sparse/include/asm-xen/xenidc_vaddress.h

Lines of this file are not shown. View the raw message.

linux-2.6-xen-sparse/include/asm-xen/xenidc_work.h new file +160 -0

160 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_wrapping.h new file +48 -0

48 lines not on this page · raw message

linux-2.6-xen-sparse/include/asm-xen/xenidc_xbgt_channel.h new file +142 -0

142 lines not on this page · raw message

patches/linux-2.6.12/usb.patch new file +10 -0
diff -r b5903c9aeda5 -r e93b9c54edb3 patches/linux-2.6.12/usb.patch

Lines of this file are not shown. View the raw message.

xen/include/public/io/usbif.h new file +357 -0

357 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Part of the diff is not shown here. View the raw message.

#4 lore raw
In reply to a message not in the archive
Quoted 7 lines · Mark Williamson
Quoted 6 lines

Most of the difficulty is in working with xenstore, which is deeply inconvenient as a tool for sequencing dependent operations. That's what resulted in the state machine I posted to the list as a ps file. You could probably hack this state machine into the existing drivers with only a small amount of additional code but it will just make the drivers even more ugly and incomprehensible than they are already.

Quoted 5 lines

Yes, right now I'm working with Xenstore too. The updates I mentioned are supposed to tackle this problem by providing a better API, automating the channel setup state machine for the majority of users (i.e. all devices). I believe a some of this code is fully completed and awaiting push to the main tree once it's been reviewed by a few people.

Really? I haven't seen any discussion about this on the list. Or any patches for review for that matter. Another private Cambridge clique?

Quoted 11 lines
Quoted 6 lines

The main reason for me to write the API was to have something concrete to code the USB driver against whilst the Xen infrastructure was in flux---previously the two changes to xend and the change to grant-tables had caused me a huge amount of rework. The API allowed me to complete the driver whilst the infrastructure was stabilising.

Surely you still had to update the code just as often? I guess having it separated would at least ease the update burden. I've rewritten my code several times for the control plane also; it's tough working out-of-tree for long periods based on the unstable tree.

No, after I stopped trying to sync up with the xenbus-of-the-week API I just defined the API I wanted, coded my driver to it and it's only been in the last few weeks that I've been implementing the API. Thankfully the xenbus and grant-table interfaces haven't changed enough to completely break me since then. And, yes, you'll find it is much easier to update the code when it isn't all munged together in one big lump.

Quoted 17 lines
Quoted 9 lines

Rather than remove the xenidc stuff, I think it would be much more useful to pick up the xenidc code for general use, base all new drivers on it and eventually port the block and net drivers to it. This would allow you to change the infrastructure underneath all new drivers relatively easily and I would expect it to save you a significant amount of effort when implementing new drivers, when optimizing the code and, in the future, if you extend the system over the network or do any fancy page sharing.

I really would have liked to see a more abstract interface to communications, such as the one you propose. However, it is not going to happen for the 3.0 release and that's when the team promised the interfaces will be frozen. If it can't be compatible with the existing interfaces, that's going to make it much less likely that anyone will update the existing drivers and then maintain two separate interdomain interfaces for each.

Quoted 4 lines

I think the project is likely to follow the path of least resistance and go with a "xenstore connection setup library" that replaces most of the duplicate code but retain the old datapath API. I get the impression this decision has been taken already.

This doesn't seem to have been discussed on the list either.

Quoted 12 lines
Quoted 5 lines

When I've got the code up and working and have split the patch up into a series of manageable chunks you should judge it on technical merit. I would expect that peer review will find ways to improve the implementation and perhaps make it fit better with Xen but I'm confident that the basic design is reasonable.

I agree, but regardless of the goals of the basic design it's going to be harder to get a merge for a driver that implements its own complex abstraction layer than for one which uses the Xen APIs directly. I'd like to have a nicer driver API but if that isn't accepted then we're probably better with the drivers as small as possible.

Quoted 5 lines

It's an unfortunate situation; what you propose is a nice way of doing things but doesn't appear to be gaining much traction yet. If the USB driver is going to be predicated on it I'd suggest having a clear plan about how you're going to get the generic IDC code into the main tree - I'm not sure whether rolling it in with the USB driver itself will be accepted.

Current plan: write good quality generic code which is reusable and useful to other drivers. Document and break patch down into manageable chunks. Get in to the tree on technical merit.

In any case, I can always change the implementation of the xenidc code to base it on whatever API you provide. This is what it was designed for. So at least I won't have to rewrite the driver again.

Quoted 4 lines

Cheers,
Mark

Signature · 1 line
Harry Butterworth <[email protected]>
#5 lore raw
Quoted 3 lines · Harry Butterworth
Quoted 1 line · Mark Williamson

Yes, right now I'm working with Xenstore too. The updates I mentioned are supposed to tackle this problem by providing a better API, automating the channel setup state machine for the majority of users (i.e. all devices). I believe a some of this code is fully completed and awaiting push to the main tree once it's been reviewed by a few people.

Hi Mark,

I didn't see the original email that Harry quoted, but could you elaborate on that? Are you proposing a new API? Why only a few people? Any reason not on the list?

Rusty had asked a question regarding what's in 3.0:
http://marc.theaimsgroup.com/?l=xen-devel&m=113038760216447&w=2

and I guess I'll second that..

Quoted 3 lines
Quoted 3 lines

I really would have liked to see a more abstract interface to communications, such as the one you propose. However, it is not going to happen for the 3.0 release and that's when the team promised the interfaces will be frozen. If it can't be compatible with the existing interfaces, that's going to make it much less likely that anyone will update the existing drivers and then maintain two separate interdomain interfaces for each.

I think the project is likely to follow the path of least resistance and go with a "xenstore connection setup library" that replaces most of the duplicate code but retain the old datapath API. I get the impression this decision has been taken already.

Any reason for this to not be shared on xen-devel?

thanks,
Nivedita

#6 lore raw
Quoted 5 lines · Nivedita Singhvi
Quoted 3 lines
Quoted 3 lines

I really would have liked to see a more abstract interface to communications, such as the one you propose. However, it is not going to happen for the 3.0 release and that's when the team promised the interfaces will be frozen. If it can't be compatible with the existing interfaces, that's going to make it much less likely that anyone will update the existing drivers and then maintain two separate interdomain interfaces for each.

I think the project is likely to follow the path of least resistance and go with a "xenstore connection setup library" that replaces most of the duplicate code but retain the old datapath API. I get the impression this decision has been taken already.

Any reason for this to not be shared on xen-devel?

All that's being done is the simplest possible bug fixing and refactoring to get stable drivers for a 3.0.0 release asap. xenidc is possibly a suitable alternative for future releases, after we have had time to look at it, integrate it with all the split drivers, and fix bug fallout. Given the size and complexity of the patch, I think it would be very high risk to commit to doing that in the next couple of weeks.

-- Keir

#7 lore raw
Quoted 7 lines · Keir Fraser

All that's being done is the simplest possible bug fixing and refactoring to get stable drivers for a 3.0.0 release asap. xenidc is possibly a suitable alternative for future releases, after we have had time to look at it, integrate it with all the split drivers, and fix bug fallout. Given the size and complexity of the patch, I think it would be very high risk to commit to doing that in the next couple of weeks.

Good. This seems entirely reasonable to me.

So I'll release the USB driver against xenidc as an example and document and break down the xenidc patch (and run it through a reformatter) so it can be reviewed.

If you like xenidc you can keep it, if not I can factor out the code later. Easy come, easy go :-)

Quoted 9 lines

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 1 line
Harry Butterworth <[email protected]>
#10 lore raw
In reply to Harry Butterworth
Quoted 8 lines
Quoted 5 lines

Yes, right now I'm working with Xenstore too. The updates I mentioned are supposed to tackle this problem by providing a better API, automating the channel setup state machine for the majority of users (i.e. all devices). I believe a some of this code is fully completed and awaiting push to the main tree once it's been reviewed by a few people.

Really? I haven't seen any discussion about this on the list. Or any patches for review for that matter. Another private Cambridge clique?

I believe I mentioned it to you in a previous e-mail. But no, it hasn't been on the public list; I found out about it by chance and was trying to keep you informed. It's not my place to publically announce other people's work unless it's relevant to an on-list discussion. That said, it does seem like a logical next step to progress to.

Quoted 6 lines

No, after I stopped trying to sync up with the xenbus-of-the-week API I just defined the API I wanted, coded my driver to it and it's only been in the last few weeks that I've been implementing the API. Thankfully the xenbus and grant-table interfaces haven't changed enough to completely break me since then. And, yes, you'll find it is much easier to update the code when it isn't all munged together in one big lump.

I separated the control code from the data code within my driver, so I just have to rewrite that, rather than the entire driver.

Quoted 6 lines
Quoted 4 lines

I think the project is likely to follow the path of least resistance and go with a "xenstore connection setup library" that replaces most of the duplicate code but retain the old datapath API. I get the impression this decision has been taken already.

This doesn't seem to have been discussed on the list either.

It's the same thing I mentioned above...

Quoted 3 lines

Current plan: write good quality generic code which is reusable and useful to other drivers. Document and break patch down into manageable chunks. Get in to the tree on technical merit.

I'll look forward to future patches.

Cheers,
Mark

#9 lore raw
In reply to Nivedita Singhvi
Quoted 2 lines

I didn't see the original email that Harry quoted, but could you elaborate on that? Are you proposing a new API?

My understanding is that a new Xenbus "library" has been developed that'll automate the state machines involved in connecting a device channel. This'll hopefully eliminate some of the "cut and paste" code that's in all the drivers. The data-plane code and the actual Xenstore setup protocols will remain the same.

I believe the code exists (at least partially) but that's all I know. I'm afraid it's not my area... Somebody else may be more qualified to comment.

Quoted 4 lines

Rusty had asked a question regarding what's in 3.0:
http://marc.theaimsgroup.com/?l=xen-devel&m=113038760216447&w=2

and I guess I'll second that..

There's a TODO list on the Wiki which should give some idea. Beyond that, it's hard to know exactly. I'm not directly working on the release code this time round.

Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

I think the project is likely to follow the path of least resistance and go with a "xenstore connection setup library" that replaces most of the duplicate code but retain the old datapath API. I get the impression this decision has been taken already.

Any reason for this to not be shared on xen-devel?

In case there's any confusion again, this "library" is the same code referred to above. I didn't post on xen-devel because it was speculative, and intended to be shared in private discussion with Harry.

Cheers,
Mark

#8 lore raw
In reply to Keir Fraser
Quoted 1 line · Keir Fraser

All that's being done is the simplest possible bug fixing and refactoring to get stable drivers for a 3.0.0 release asap. xenidc is possibly a suitable alternative for future releases, after we have had time to look at it, integrate it with all the split drivers, and fix bug fallout. Given the size and complexity of the patch, I think it would be very high risk to commit to doing that in the next couple of weeks.

Thanks for the clarification, Keir, good to know!

thanks,
Nivedita