[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/6] scsifront/back drivers' common Makefile and header



# HG changeset patch
# User fujita.tomonori@xxxxxxxxxxxxx
# Node ID 7111077b493ea53ef055ce38098f8af67f87d749
# Parent  ed8d345449c176cb5fe0ccff4299da782eb63c08
SCSI frontend and backend drivers' common Makefile and header

Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>

diff -r ed8d345449c1 -r 7111077b493e buildconfigs/linux-defconfig_xen0_x86_32
--- a/buildconfigs/linux-defconfig_xen0_x86_32  Wed Aug 02 15:11:34 2006 +0900
+++ b/buildconfigs/linux-defconfig_xen0_x86_32  Wed Aug 02 15:14:15 2006 +0900
@@ -491,6 +491,7 @@ CONFIG_IDEDMA_AUTO=y
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_TGT=y
 CONFIG_SCSI_PROC_FS=y
 
 #
@@ -580,6 +581,7 @@ CONFIG_SCSI_SATA_INTEL_COMBINED=y
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_SRP is not set
 
 #
 # Multi-device support (RAID and LVM)
@@ -1322,11 +1324,13 @@ CONFIG_XEN_PCIDEV_BACKEND_PASS=y
 CONFIG_XEN_PCIDEV_BACKEND_PASS=y
 # CONFIG_XEN_PCIDEV_BE_DEBUG is not set
 CONFIG_XEN_BLKDEV_BACKEND=y
+CONFIG_XEN_SCSI_BACKEND=y
 CONFIG_XEN_NETDEV_BACKEND=y
 # CONFIG_XEN_NETDEV_PIPELINED_TRANSMITTER is not set
 CONFIG_XEN_NETDEV_LOOPBACK=y
 # CONFIG_XEN_TPMDEV_BACKEND is not set
 CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_XEN_SCSI_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
 CONFIG_XEN_SCRUB_PAGES=y
 CONFIG_XEN_DISABLE_SERIAL=y
diff -r ed8d345449c1 -r 7111077b493e buildconfigs/linux-defconfig_xen_x86_32
--- a/buildconfigs/linux-defconfig_xen_x86_32   Wed Aug 02 15:11:34 2006 +0900
+++ b/buildconfigs/linux-defconfig_xen_x86_32   Wed Aug 02 15:14:15 2006 +0900
@@ -1049,13 +1049,14 @@ CONFIG_IDEDMA_AUTO=y
 # SCSI device support
 #
 CONFIG_RAID_ATTRS=m
-CONFIG_SCSI=m
+CONFIG_SCSI=y
+CONFIG_SCSI_TGT=y
 CONFIG_SCSI_PROC_FS=y
 
 #
 # SCSI support type (disk, tape, CD-ROM)
 #
-CONFIG_BLK_DEV_SD=m
+CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=m
 CONFIG_CHR_DEV_OSST=m
 CONFIG_BLK_DEV_SR=m
@@ -1157,6 +1158,7 @@ CONFIG_SCSI_DC390T=m
 CONFIG_SCSI_DC390T=m
 CONFIG_SCSI_NSP32=m
 CONFIG_SCSI_DEBUG=m
+# CONFIG_SCSI_SRP is not set
 
 #
 # PCMCIA SCSI adapter support
@@ -3022,11 +3024,13 @@ CONFIG_XEN_PCIDEV_BACKEND_VPCI=y
 # CONFIG_XEN_PCIDEV_BACKEND_PASS is not set
 # CONFIG_XEN_PCIDEV_BE_DEBUG is not set
 CONFIG_XEN_BLKDEV_BACKEND=y
+CONFIG_XEN_SCSI_BACKEND=y
 CONFIG_XEN_NETDEV_BACKEND=y
 # CONFIG_XEN_NETDEV_PIPELINED_TRANSMITTER is not set
 CONFIG_XEN_NETDEV_LOOPBACK=y
 # CONFIG_XEN_TPMDEV_BACKEND is not set
 CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_XEN_SCSI_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
 CONFIG_XEN_SCRUB_PAGES=y
 CONFIG_XEN_DISABLE_SERIAL=y
diff -r ed8d345449c1 -r 7111077b493e linux-2.6-xen-sparse/drivers/xen/Kconfig
--- a/linux-2.6-xen-sparse/drivers/xen/Kconfig  Wed Aug 02 15:11:34 2006 +0900
+++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig  Wed Aug 02 15:14:15 2006 +0900
@@ -84,6 +84,17 @@ config XEN_BLKDEV_BACKEND
          block devices to other guests via a high-performance shared-memory
          interface.
 
+config XEN_SCSI_BACKEND
+       tristate "SCSI backend driver"
+       depends on XEN_BACKEND && SCSI_TGT
+       default y
+       help
+         The SCSI backend driver allows the kernel to export its SCSI HBAs
+         to other guests via a high-performance shared-memory interface.
+         SCSI requests are redirected to userspace through netlink interface.
+         The user-space daemon can export disk images, which may be implemented
+         as files, in memory, or on other hosts across the network.
+
 config XEN_NETDEV_BACKEND
        tristate "Network-device backend driver"
         depends on XEN_BACKEND && NET
@@ -140,6 +151,14 @@ config XEN_BLKDEV_FRONTEND
          dedicated device-driver domain, or your master control domain
          (domain 0), then you almost certainly want to say Y here.
 
+config XEN_SCSI_FRONTEND
+       tristate "SCSI frontend driver"
+       depends on XEN && SCSI
+       default y
+       help
+         The SCSI frontend driver allows the kernel to access SCSI HBAs
+         within another guest OS.
+
 config XEN_NETDEV_FRONTEND
        tristate "Network-device frontend driver"
        depends on XEN && NET
diff -r ed8d345449c1 -r 7111077b493e linux-2.6-xen-sparse/drivers/xen/Makefile
--- a/linux-2.6-xen-sparse/drivers/xen/Makefile Wed Aug 02 15:11:34 2006 +0900
+++ b/linux-2.6-xen-sparse/drivers/xen/Makefile Wed Aug 02 15:14:15 2006 +0900
@@ -8,9 +8,11 @@ obj-$(CONFIG_XEN_BALLOON)              += balloon/
 obj-$(CONFIG_XEN_BALLOON)              += balloon/
 obj-$(CONFIG_XEN_DEVMEM)               += char/
 obj-$(CONFIG_XEN_BLKDEV_BACKEND)       += blkback/
+obj-$(CONFIG_XEN_SCSI_BACKEND)         += scsiback/
 obj-$(CONFIG_XEN_NETDEV_BACKEND)       += netback/
 obj-$(CONFIG_XEN_TPMDEV_BACKEND)       += tpmback/
 obj-$(CONFIG_XEN_BLKDEV_FRONTEND)      += blkfront/
+obj-$(CONFIG_XEN_SCSI_FRONTEND)                += scsifront/
 obj-$(CONFIG_XEN_NETDEV_FRONTEND)      += netfront/
 obj-$(CONFIG_XEN_PCIDEV_BACKEND)       += pciback/
 obj-$(CONFIG_XEN_PCIDEV_FRONTEND)      += pcifront/
diff -r ed8d345449c1 -r 7111077b493e xen/include/public/io/scsi.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/public/io/scsi.h      Wed Aug 02 15:14:15 2006 +0900
@@ -0,0 +1,41 @@
+#ifndef __XEN__PUBLIC_IO_SCSI_H__
+#define __XEN__PUBLIC_IO_SCSI_H__
+
+#include "ring.h"
+
+#define SRP_MAX_IU_LEN 256
+#define SRP_CAN_QUEUE 8
+
+struct scsi_request {
+       char buf[SRP_MAX_IU_LEN];
+};
+
+struct scsi_response {
+       char buf[sizeof(struct srp_rsp)];
+};
+
+DEFINE_RING_TYPES(scsi, struct scsi_request, struct scsi_response);
+
+#define SRP_MAX_INDIRECT       ((SRP_MAX_IU_LEN -                      \
+                                 sizeof (struct srp_cmd) -             \
+                                 sizeof (struct srp_indirect_buf)) / 16)
+
+#define SRP_MAPPED_PAGES (SRP_CAN_QUEUE * SRP_MAX_INDIRECT)
+#define SRP_RING_PAGES (((sizeof(struct scsi_iovec) * SRP_CAN_QUEUE) \
+                       + PAGE_SIZE - 1) >> PAGE_SHIFT)
+
+struct scsi_iovec {
+       u32 iovcnt;
+       struct iovec iov[SRP_MAX_INDIRECT];
+} __attribute__((packed));
+
+/*
+ * srp_cmd             : 48 bytes
+ * srp_direct_buf      : 16 bytes
+ * srp_indirect_buf    : 20 bytes
+ * SRP_MAX_INDIRECT    : 11
+ * SRP_MAX_MAPPED_PAGES        : 88
+ * SRP_RING_PAGES      : 1
+ */
+
+#endif

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.