FUJITA Tomonori
2006-Aug-02 08:32 UTC
[Xen-devel] [PATCH 0/6] SCSI frontend and backend drivers
This patchset includes an updated version of the SCSI frontend and backend drivers. The frontend and backend drivers exchange SCSI RDMA Protocol (SRP) messages via a ring buffer. The backend driver sends SCSI commands to the user-space daemon, which performs SCSI commands and I/O operations. The backend driver uses VM_FOREIGN feature like the blktap driver for zero-copy of data pages. Like the blktap, the user-space daemon can enjoy the advantages of user-space I/O, that is, it can export raw partitions, regular files, network, etc to VMs, and use nice tricks like snapshot by using metadata disk formats, QoS, etc. In addition, the user-space daemon performs SCSI protocol so that it can use SCSI device virtualization like Virtual Tape Library, which exports files as tape drives to VMs. The backend driver exploits the SCSI target framework (tgt), which aims to add target driver support in Linux SCSI mid layer. It has been included in the -mm tree. This patchset includes a modified version of tgt code. - Instructions This patchset is against cset 10426:840f33e54054. `make world && make install` should work. The user-space daemon code is at tools/tgtd directory. Configure your VM config file to use the SCSI drivers. If you like to export /dev/sdb1 as a logical unit to a VM, add the following line: scsi = [ ''disk:/dev/sdb1,w'' ] You must run the user-space daemon before starting domainUs (otherwise Domain0 crashes). /usr/sbin/tgtd -f -d8 The above command runs the daemon in the foreground. So run start VMs with another terminal. If everything goes well, a SCSI host shows up in your VM (DomainU). clematis:/# cat /sys/class/scsi_host/host0/proc_name scsifront And you can see a disk driver: clematis:/# ls /sys/class/scsi_device/0\:0\:0\:0/device/ block:sda iocounterbits queue_depth scsi_level vendor bus iodone_cnt queue_type state delete ioerr_cnt rescan timeout device_blocked iorequest_cnt rev type driver model scsi_device:0:0:0:0 uevent - Status and TODO I manage to do fdisk, dd with a virtual disk drive (on DomainU), however, it''s still far from completion. You cannot even stop the drivers (sorry, it makes VMs crash). Now, the user-space daemon uses read/write system calls for I/O. Soon I will add AIO support and compare the performances of SCSI, blktap, and blkback to examine SCSI overhead. The current configuration format need to be improved, e.g., it can handle only one logical unit per host. VMs cannot share a logical unit. I will take some code from the blktap daemon like metadata disk formats, etc. The tgt daemon and the blktap daemon will have lots of common features, so maybe it would be better to merge them later on. - For SCSI people I''ve not implemented the SRP protocol fully yet. For example, without a login command, the frontend driver sends SCSI commands. I will work on this later on. Probably, something like scsi_transport_srp would be nice because of other SRP drivers (InfiniBand, IBM pSeries). Another issue is the limitation on the number of sg table (now 11) because I put indirect buffer in a ring buffer (like IB srp initiator driver). I will work on this too later on. The patchset includes libsrp.c, but it''s just makeshift. I will rewrite it completely. o Linux SCSI target framework (tgt) http://stgt.berlios.de/ o The old version of SCSI frontend and backend drivers http://lists.xensource.com/archives/html/xen-devel/2006-06/msg00849.html _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel