first attempt of pvscai backend driver port to pvops
Subsystems (2)
Attached is my first attempt at getting the backend pvscsi driver (scsiback) working under the latest pvops kernel. I have tested it with the scsi frontend driver in gplpv, and have restored about 20GB of data from a HP LTO3 tape drive successfully, so it appears to be working fine.
There are quite a few changes compared to the version in 2.6.18. The main change is that I get the vaddr for each sg element and use the regular dma calls to make it work instead of all the magic that the 2.6.18 version used to use that isn't exported anymore.
I created a new branch in a local git repo, what git magic do I need to weave to make the patch look a bit neater?
Thanks
James
drivers/xen/Kconfig +8 -0
@@ -60,6 +60,14 @@ config XEN_BLKBACK_PAGEMAP depends on XEN_BLKDEV_BACKEND != n && XEN_BLKDEV_TAP != n default XEN_BLKDEV_BACKEND || XEN_BLKDEV_TAP +config XEN_SCSI_BACKEND + tristate "SCSI backend driver" + depends on SCSI && XEN_BACKEND + default m + help + The SCSI backend driver allows the kernel to export its SCSI Devices + to other guests via a high-performance shared-memory interface. + config XEN_NETDEV_BACKEND tristate "Xen backend network device" depends on XEN_BACKEND && NET
drivers/xen/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_XEN_DEV_EVTCHN) += xen-evtchn.o obj-$(CONFIG_XEN_GNTDEV) += xen-gntdev.o obj-$(CONFIG_XEN_BLKDEV_BACKEND) += blkback/ obj-$(CONFIG_XEN_BLKDEV_TAP) += blktap/ +obj-$(CONFIG_XEN_SCSI_BACKEND) += scsiback/ obj-$(CONFIG_XEN_NETDEV_BACKEND) += netback/ obj-$(CONFIG_XEN_PCIDEV_BACKEND) += pciback/ obj-$(CONFIG_XENFS) += xenfs/
drivers/xen/scsiback/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +obj-$(CONFIG_XEN_SCSI_BACKEND) := xen-scsibk.o + +xen-scsibk-y := interface.o scsiback.o xenbus.o translate.o emulate.o +
drivers/xen/scsiback/common.h new file +193 -0
193 lines not on this page · raw message
drivers/xen/scsiback/emulate.c new file +491 -0
491 lines not on this page · raw message
drivers/xen/scsiback/interface.c new file +184 -0
184 lines not on this page · raw message
drivers/xen/scsiback/scsiback.c new file +632 -0
632 lines not on this page · raw message
drivers/xen/scsiback/translate.c new file +168 -0
168 lines not on this page · raw message
drivers/xen/scsiback/xenbus.c new file +378 -0
378 lines not on this page · raw message
drivers/xen/usbback/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +obj-$(CONFIG_XEN_USB_BACKEND) := usbbk.o + +usbbk-y := usbstub.o xenbus.o interface.o usbback.o +
drivers/xen/usbback/interface.c new file +250 -0
250 lines not on this page · raw message
drivers/xen/usbback/usbback.c new file +1171 -0
675 lines not on this page · raw message
drivers/xen/usbback/usbback.h new file +195 -0
195 lines not on this page · raw message
drivers/xen/usbback/usbstub.c new file +319 -0
319 lines not on this page · raw message
drivers/xen/usbback/xenbus.c new file +318 -0
318 lines not on this page · raw message
include/xen/interface/io/vscsiif.h new file +105 -0
105 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.
Quoted 6 lines · James Harper
Attached is my first attempt at getting the backend pvscsi driver (scsiback) working under the latest pvops kernel. I have tested it with the scsi frontend driver in gplpv, and have restored about 20GB of data from a HP LTO3 tape drive successfully, so it appears to be working fine.
Quoted 8 lines
There are quite a few changes compared to the version in 2.6.18. The main change is that I get the vaddr for each sg element and use the regular dma calls to make it work instead of all the magic that the 2.6.18 version used to use that isn't exported anymore.
I created a new branch in a local git repo, what git magic do I need to weave to make the patch look a bit neater?
It does need some cleaning up. Run it through linux/scripts/checkpatch.pl and iterate until its fairly clean (as clean as possible without making it barbarous). Most obvious is that kernel code uses 8-width hard tabs.
The patch also seems to contain usbback. Did you mean to include it? Either way it shouldn't be part of the scsi patches.
If possible and sensible, split the patch into logically separate parts (like introduce infrastructure, use infrastructure for a, for b, for c). However for these kinds of "new subsystem" patches, it often makes most sense to just have one large patch adding the new code.
Please base the patches on (ideally) 2.6.31 or .32. If you need some Xen infrastructure (which is likely), then base the patch on the xen/dom0/backend/common branch.
Mail your patches to the list for review (but, please, inlined plain text). But the easiest way for me to include the patches is if I can pull them from your git server. If you can't make your own machine accessible, you can set up an account on github.com, or ask for an account on kernel.org.
I haven't actually looked at the substance of the patch yet.
Thanks,
J
Quoted 3 lines
It does need some cleaning up. Run it through
linux/scripts/checkpatch.pland iterate until its fairly clean (as
clean
Quoted 4 lines
as possible without making it barbarous). Most obvious is that kernel code uses 8-width hard tabs.
The patch also seems to contain usbback. Did you mean to include it?
I sure didn't. Not sure how that got there...
Quoted 1 line
If possible and sensible, split the patch into logically separate
parts
Quoted 2 lines
(like introduce infrastructure, use infrastructure for a, for b, for c). However for these kinds of "new subsystem" patches, it often
makes
Quoted 5 lines
most sense to just have one large patch adding the new code.
Please base the patches on (ideally) 2.6.31 or .32. If you need some Xen infrastructure (which is likely), then base the patch on the xen/dom0/backend/common branch.
They are based on xen/master at the moment.
Quoted 5 lines
Mail your patches to the list for review (but, please, inlined plain text). But the easiest way for me to include the patches is if I can pull them from your git server. If you can't make your own machine accessible, you can set up an account on github.com, or ask for an account on kernel.org.
I'll look at doing that.
Quoted 3 lines
I haven't actually looked at the substance of the patch yet.
Probably best not to bother until I've cleaned up some of the above.
Thanks
James
Re: first attempt of pvscsi backend driver port to pvops
Quoted 30 lines · James Harper
Quoted 3 lines
It does need some cleaning up. Run it through
linux/scripts/checkpatch.pland iterate until its fairly clean (asclean
Quoted 4 lines
as possible without making it barbarous). Most obvious is that kernel code uses 8-width hard tabs.
The patch also seems to contain usbback. Did you mean to include it?
I sure didn't. Not sure how that got there...
Quoted 1 line
If possible and sensible, split the patch into logically separate
parts
Quoted 2 lines
(like introduce infrastructure, use infrastructure for a, for b, for c). However for these kinds of "new subsystem" patches, it often
makes
Quoted 5 lines
most sense to just have one large patch adding the new code.
Please base the patches on (ideally) 2.6.31 or .32. If you need some Xen infrastructure (which is likely), then base the patch on the xen/dom0/backend/common branch.
They are based on xen/master at the moment.
Quoted 5 lines
Mail your patches to the list for review (but, please, inlined plain text). But the easiest way for me to include the patches is if I can pull them from your git server. If you can't make your own machine accessible, you can set up an account on github.com, or ask for an account on kernel.org.
Quoted 8 lines
I'll look at doing that.
Quoted 3 lines
I haven't actually looked at the substance of the patch yet.
Probably best not to bother until I've cleaned up some of the above.
Did you get it working? :)
-- Pasi