From: <vl...@us...> - 2006-10-12 13:49:00
|
Revision: 1 http://svn.sourceforge.net/scst/?rev=1&view=rev Author: vlnb Date: 2006-10-12 06:47:28 -0700 (Thu, 12 Oct 2006) Log Message: ----------- Initial commit Added Paths: ----------- branches/ tags/ trunk/ trunk/Makefile trunk/qla2x00t/ trunk/qla2x00t/Kconfig trunk/qla2x00t/Makefile trunk/qla2x00t/ql2100.c trunk/qla2x00t/ql2100_fw.c trunk/qla2x00t/ql2200.c trunk/qla2x00t/ql2200_fw.c trunk/qla2x00t/ql2300.c trunk/qla2x00t/ql2300_fw.c trunk/qla2x00t/ql2322.c trunk/qla2x00t/ql2322_fw.c trunk/qla2x00t/ql2400.c trunk/qla2x00t/ql2400_fw.c trunk/qla2x00t/qla2x00-target/ trunk/qla2x00t/qla2x00-target/ChangeLog trunk/qla2x00t/qla2x00-target/Makefile trunk/qla2x00t/qla2x00-target/README trunk/qla2x00t/qla2x00-target/ToDo trunk/qla2x00t/qla2x00-target/qla2x00t.c trunk/qla2x00t/qla2x00-target/qla2x00t.h trunk/qla2x00t/qla2x_tgt.h trunk/qla2x00t/qla2x_tgt_def.h trunk/qla2x00t/qla_attr.c trunk/qla2x00t/qla_dbg.c trunk/qla2x00t/qla_dbg.h trunk/qla2x00t/qla_def.h trunk/qla2x00t/qla_devtbl.h trunk/qla2x00t/qla_fw.h trunk/qla2x00t/qla_gbl.h trunk/qla2x00t/qla_gs.c trunk/qla2x00t/qla_init.c trunk/qla2x00t/qla_inline.h trunk/qla2x00t/qla_iocb.c trunk/qla2x00t/qla_isr.c trunk/qla2x00t/qla_mbx.c trunk/qla2x00t/qla_os.c trunk/qla2x00t/qla_rscn.c trunk/qla2x00t/qla_settings.h trunk/qla2x00t/qla_sup.c trunk/qla2x00t/qla_version.h trunk/scst/ trunk/scst/COPYING trunk/scst/ChangeLog trunk/scst/Makefile trunk/scst/README trunk/scst/ToDo trunk/scst/include/ trunk/scst/include/scsi_tgt.h trunk/scst/include/scst_debug.c trunk/scst/include/scst_debug.h trunk/scst/kernel/ trunk/scst/kernel/26_scst-2.6.14-.patch trunk/scst/kernel/26_scst-2.6.15+.patch trunk/scst/kernel/26_scst-2.6.16.patch trunk/scst/kernel/in-tree/ trunk/scst/kernel/in-tree/Kconfig.scsi.Linux-2.6.7.patch trunk/scst/kernel/in-tree/Kconfig.scsi_tgt trunk/scst/kernel/in-tree/Makefile.scsi.Linux-2.6.7.patch trunk/scst/kernel/in-tree/Makefile.scsi_tgt trunk/scst/src/ trunk/scst/src/Makefile trunk/scst/src/dev_handlers/ trunk/scst/src/dev_handlers/Makefile trunk/scst/src/dev_handlers/scst_cdrom.c trunk/scst/src/dev_handlers/scst_changer.c trunk/scst/src/dev_handlers/scst_dev_handler.h trunk/scst/src/dev_handlers/scst_disk.c trunk/scst/src/dev_handlers/scst_fileio.c trunk/scst/src/dev_handlers/scst_modisk.c trunk/scst/src/dev_handlers/scst_processor.c trunk/scst/src/dev_handlers/scst_raid.c trunk/scst/src/dev_handlers/scst_tape.c trunk/scst/src/scst.c trunk/scst/src/scst_cdbprobe.h trunk/scst/src/scst_lib.c trunk/scst/src/scst_mem.c trunk/scst/src/scst_mem.h trunk/scst/src/scst_module.c trunk/scst/src/scst_priv.h trunk/scst/src/scst_proc.c trunk/scst/src/scst_targ.c Added: trunk/Makefile =================================================================== --- trunk/Makefile (rev 0) +++ trunk/Makefile 2006-10-12 13:47:28 UTC (rev 1) @@ -0,0 +1,102 @@ +# +# Common makefile for SCSI target mid-level and its drivers +# +# Copyright (C) 2006 Vladislav Bolkhovitin <vs...@vl...> +# +# 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, version 2 +# of the License. +# +# 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. +# +# + +# Decide to use which kernel src. If not specified, is current running kernel. +#export KDIR=/usr/src/linux-2.6 + +SCST_DIR=scst +QLA_INI_DIR=qla2x00t +QLA_DIR=qla2x00t/qla2x00-target + +all: + cd $(SCST_DIR) && $(MAKE) $@ + @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi + +install: + cd $(SCST_DIR) && $(MAKE) $@ + @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi + +uninstall: + cd $(SCST_DIR) && $(MAKE) $@ + @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi + +clean: + cd $(SCST_DIR) && $(MAKE) $@ + @if [ -d $(QLA_INI_DIR) ]; then cd $(QLA_INI_DIR) && $(MAKE) $@; fi + @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi + +extraclean: + cd $(SCST_DIR) && $(MAKE) $@ + @if [ -d $(QLA_INI_DIR) ]; then cd $(QLA_INI_DIR) && $(MAKE) $@; fi + @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi + +scst: + cd $(SCST_DIR) && $(MAKE) + +scst_install: + cd $(SCST_DIR) && $(MAKE) install + +scst_uninstall: + cd $(SCST_DIR) && $(MAKE) uninstall + +scst_clean: + cd $(SCST_DIR) && $(MAKE) clean + +scst_extraclean: + cd $(SCST_DIR) && $(MAKE) extraclean + +qla: + cd $(QLA_DIR) && $(MAKE) + +qla_install: + cd $(QLA_DIR) && $(MAKE) install + +qla_uninstall: + cd $(QLA_DIR) && $(MAKE) uninstall + +qla_clean: + cd $(QLA_INI_DIR) && $(MAKE) clean + cd $(QLA_DIR) && $(MAKE) clean + +qla_extraclean: + cd $(QLA_INI_DIR)/.. && $(MAKE) extraclean + cd $(QLA_DIR) && $(MAKE) extraclean + +help: + @echo " all (the default) : make all" + @echo " clean : clean files" + @echo " extraclean : clean + clean dependencies" + @echo " install : install" + @echo " uninstall : uninstall" + @echo "" + @echo " scst : make scst only" + @echo " scst_clean : scst: clean " + @echo " scst_extraclean : scst: clean + clean dependencies" + @echo " scst_install : scst: install" + @echo " scst_uninstall : scst: uninstall" + @echo "" + @echo " qla : make new qla target using 2.6.x kernel qla2xxx" + @echo " qla_clean : 2.6 qla target: clean " + @echo " qla_extraclean : 2.6 qla target: clean + clean dependencies" + @echo " qla_install : 2.6 qla target: install" + @echo " qla_uninstall : 2.6 qla target: uninstall" + @echo " Notes :" + @echo " - install and uninstall must be made as root" + +.PHONY: all install uninstall clean extraclean help \ + qla qla_install qla_uninstall qla_clean qla_extraclean \ + scst scst_install scst_uninstall scst_clean scst_extraclean Added: trunk/qla2x00t/Kconfig =================================================================== --- trunk/qla2x00t/Kconfig (rev 0) +++ trunk/qla2x00t/Kconfig 2006-10-12 13:47:28 UTC (rev 1) @@ -0,0 +1,82 @@ +config SCSI_QLA_FC + tristate "QLogic QLA2XXX Fibre Channel Support" + depends on PCI && SCSI + select SCSI_FC_ATTRS + select FW_LOADER + ---help--- + This qla2xxx driver supports all QLogic Fibre Channel + PCI and PCIe host adapters. + + By default, firmware for the ISP parts will be loaded + via the Firmware Loader interface. + + ISP Firmware Filename + ---------- ----------------- + 21xx ql2100_fw.bin + 22xx ql2200_fw.bin + 2300, 2312, 6312 ql2300_fw.bin + 2322, 6322 ql2322_fw.bin + 24xx ql2400_fw.bin + + Upon request, the driver caches the firmware image until + the driver is unloaded. + + Firmware images can be retrieved from: + + ftp://ftp.qlogic.com/outgoing/linux/firmware/ + + NOTE: The original method of building firmware-loader + modules has been deprecated as the firmware-images will + be removed from the kernel sources. + +config SCSI_QLA2XXX_TARGET + bool "QLogic 2xxx target mode support" + depends on SCSI_QLA_FC + default y + ---help--- + This option enables target mode hooks used by the SCST QLA2x00tgt driver. + Once the qla2x00tgt module is loaded, target mode can be enable via a + sysfs interface under scsi_host, thus enabling target mode for specific + cards. + You will also need the SCST middle level drivers from http://scst.sf.net/. + +config SCSI_QLA2XXX_EMBEDDED_FIRMWARE + bool " Use firmware-loader modules (DEPRECATED)" + depends on SCSI_QLA_FC + help + This option offers you the deprecated firmware-loader + modules that have been obsoleted by the usage of the + Firmware Loader interface in the qla2xxx driver. + +config SCSI_QLA21XX + tristate " Build QLogic ISP2100 firmware-module" + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE + ---help--- + This driver supports the QLogic 21xx (ISP2100) host adapter family. + +config SCSI_QLA22XX + tristate " Build QLogic ISP2200 firmware-module" + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE + ---help--- + This driver supports the QLogic 22xx (ISP2200) host adapter family. + +config SCSI_QLA2300 + tristate " Build QLogic ISP2300/ISP6312 firmware-module" + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE + ---help--- + This driver supports the QLogic 2300 (ISP2300, ISP2312 and + ISP6312) host adapter family. + +config SCSI_QLA2322 + tristate " Build QLogic ISP2322/ISP6322 firmware-module" + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE + ---help--- + This driver supports the QLogic 2322 (ISP2322 and ISP6322) host + adapter family. + +config SCSI_QLA24XX + tristate " Build QLogic ISP24xx firmware-module" + depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE + ---help--- + This driver supports the QLogic 24xx (ISP2422 and ISP2432) host + adapter family. Added: trunk/qla2x00t/Makefile =================================================================== --- trunk/qla2x00t/Makefile (rev 0) +++ trunk/qla2x00t/Makefile 2006-10-12 13:47:28 UTC (rev 1) @@ -0,0 +1,48 @@ +ifneq ($(KERNELRELEASE),) +EXTRA_CFLAGS += -DUNIQUE_FW_NAME + +qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ + qla_dbg.o qla_sup.o qla_rscn.o qla_attr.o + +obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx.o + +qla2100-y := ql2100.o ql2100_fw.o +qla2200-y := ql2200.o ql2200_fw.o +qla2300-y := ql2300.o ql2300_fw.o +qla2322-y := ql2322.o ql2322_fw.o +qla2400-y := ql2400.o ql2400_fw.o + +obj-$(CONFIG_SCSI_QLA21XX) += qla2xxx.o qla2100.o +obj-$(CONFIG_SCSI_QLA22XX) += qla2xxx.o qla2200.o +obj-$(CONFIG_SCSI_QLA2300) += qla2xxx.o qla2300.o +obj-$(CONFIG_SCSI_QLA2322) += qla2xxx.o qla2322.o +obj-$(CONFIG_SCSI_QLA24XX) += qla2xxx.o qla2400.o + +else +ifeq ($(KVER),) + ifeq ($(KDIR),) + KDIR := /lib/modules/$(shell uname -r)/build + endif +else + KDIR := /lib/modules/$(KVER)/build +endif + +all: + $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) + +install: all + $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \ + modules_install + +uninstall: + rm -f $(INSTALL_DIR)/qla2[2-3]00.ko $(INSTALL_DIR)/qla2xxx.ko + -/sbin/depmod -a +endif + +clean: + rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend *~ Modules.symvers + rm -rf .tmp_versions + +extraclean: clean + +.PHONY: all install uninstall clean extraclean Added: trunk/qla2x00t/ql2100.c =================================================================== --- trunk/qla2x00t/ql2100.c (rev 0) +++ trunk/qla2x00t/ql2100.c 2006-10-12 13:47:28 UTC (rev 1) @@ -0,0 +1,91 @@ +/* + * QLogic Fibre Channel HBA Driver + * Copyright (C) 2003 Christoph Hellwig. + * Copyright (c) 2003-2005 QLogic Corporation + * + * See LICENSE.qla2xxx for copyright and licensing details. + */ +#include <linux/init.h> +#include <linux/module.h> +#include <linux/pci.h> + +#include "qla_def.h" + +static char qla_driver_name[] = "qla2100"; + +extern unsigned char fw2100tp_version[]; +extern unsigned char fw2100tp_version_str[]; +extern unsigned short fw2100tp_addr01; +extern unsigned short fw2100tp_code01[]; +extern unsigned short fw2100tp_length01; + +static struct qla_fw_info qla_fw_tbl[] = { + { + .addressing = FW_INFO_ADDR_NORMAL, + .fwcode = &fw2100tp_code01[0], + .fwlen = &fw2100tp_length01, + .fwstart = &fw2100tp_addr01, + }, + + { FW_INFO_ADDR_NOMORE, }, +}; + +static struct qla_board_info qla_board_tbl = { + .drv_name = qla_driver_name, + + .isp_name = "ISP2100", + .fw_info = qla_fw_tbl, +}; + +static struct pci_device_id qla2100_pci_tbl[] = { + { + .vendor = PCI_VENDOR_ID_QLOGIC, + .device = PCI_DEVICE_ID_QLOGIC_ISP2100, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = (unsigned long)&qla_board_tbl, + }, + + {0, 0}, +}; +MODULE_DEVICE_TABLE(pci, qla2100_pci_tbl); + +static int __devinit +qla2100_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) +{ + return qla2x00_probe_one(pdev, + (struct qla_board_info *)id->driver_data); +} + +static void __devexit +qla2100_remove_one(struct pci_dev *pdev) +{ + qla2x00_remove_one(pdev); +} + +static struct pci_driver qla2100_pci_driver = { + .name = "qla2100", + .id_table = qla2100_pci_tbl, + .probe = qla2100_probe_one, + .remove = __devexit_p(qla2100_remove_one), +}; + +static int __init +qla2100_init(void) +{ + return pci_module_init(&qla2100_pci_driver); +} + +static void __exit +qla2100_exit(void) +{ + pci_unregister_driver(&qla2100_pci_driver); +} + +module_init(qla2100_init); +module_exit(qla2100_exit); + +MODULE_AUTHOR("QLogic Corporation"); +MODULE_DESCRIPTION("QLogic ISP21xx FC-SCSI Host Bus Adapter driver"); +MODULE_LICENSE("GPL"); +MODULE_VERSION(QLA2XXX_VERSION); Added: trunk/qla2x00t/ql2100_fw.c =================================================================== --- trunk/qla2x00t/ql2100_fw.c (rev 0) +++ trunk/qla2x00t/ql2100_fw.c 2006-10-12 13:47:28 UTC (rev 1) @@ -0,0 +1,4848 @@ +/* + * QLogic Fibre Channel HBA Driver + * Copyright (c) 2003-2005 QLogic Corporation + * + * See LICENSE.qla2xxx for copyright and licensing details. + */ + +/* + * Firmware Version 1.19.25 (13:12 Dec 10, 2003) + */ + +#ifdef UNIQUE_FW_NAME +unsigned short fw2100tp_version = 1*1024+19; +#else +unsigned short risc_code_version = 1*1024+19; +#endif + +#ifdef UNIQUE_FW_NAME +unsigned char fw2100tp_version_str[] = {1,19,25}; +#else +unsigned char firmware_version[] = {1,19,25}; +#endif + +#ifdef UNIQUE_FW_NAME +#define fw2100tp_VERSION_STRING "1.19.25" +#else +#define FW_VERSION_STRING "1.19.25" +#endif + +#ifdef UNIQUE_FW_NAME +unsigned short fw2100tp_addr01 = 0x1000 ; +#else +unsigned short risc_code_addr01 = 0x1000 ; +#endif + +#ifdef UNIQUE_FW_NAME +unsigned short fw2100tp_code01[] = { +#else +unsigned short risc_code01[] = { +#endif + 0x0078, 0x102d, 0x0000, 0x9601, 0x0000, 0x0001, 0x0013, 0x0019, + 0x0017, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030, + 0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241, + 0x5449, 0x4f4e, 0x2049, 0x5350, 0x3231, 0x3030, 0x2046, 0x6972, + 0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, + 0x312e, 0x3139, 0x2020, 0x2020, 0x2400, 0x2091, 0x2000, 0x20c1, + 0x0021, 0x2039, 0xffff, 0x2019, 0xaaaa, 0x2760, 0x2069, 0x7fff, + 0x20c1, 0x0020, 0x2c2c, 0x2d34, 0x2762, 0x236a, 0x2c24, 0x2d04, + 0x266a, 0x2562, 0xa406, 0x00c0, 0x1052, 0x20c1, 0x0021, 0x2c2c, + 0x2362, 0x2c04, 0x2562, 0xa306, 0x0040, 0x1052, 0x20c1, 0x0020, + 0x2039, 0x8fff, 0x20a1, 0xae00, 0x2708, 0x810d, 0x810d, 0x810d, + 0x810d, 0xa18c, 0x000f, 0x2001, 0x000a, 0xa112, 0xa00e, 0x21a8, + 0x41a4, 0x3400, 0x8211, 0x00c0, 0x105f, 0x2708, 0x3400, 0xa102, + 0x0040, 0x106f, 0x0048, 0x106f, 0x20a8, 0xa00e, 0x41a4, 0x20a1, + 0xa601, 0x2009, 0x0000, 0x20a9, 0x07ff, 0x41a4, 0x3400, 0x20c9, + 0xabff, 0x2059, 0x0000, 0x2b78, 0x7823, 0x0004, 0x2089, 0x25c7, + 0x2051, 0xa700, 0x2a70, 0x7762, 0xa786, 0x8fff, 0x0040, 0x1092, + 0x705f, 0xce00, 0x705b, 0xcdf1, 0x7067, 0x0200, 0x706b, 0x0200, + 0x0078, 0x109a, 0x705b, 0xbe01, 0x7067, 0x0100, 0x706b, 0x0100, + 0x705f, 0xbe00, 0x1078, 0x12df, 0x1078, 0x13ca, 0x1078, 0x1577, + 0x1078, 0x1ce9, 0x1078, 0x42ec, 0x1078, 0x76bf, 0x1078, 0x1355, + 0x1078, 0x2ac0, 0x1078, 0x4e93, 0x1078, 0x49a3, 0x1078, 0x594a, + 0x1078, 0x2263, 0x1078, 0x5c43, 0x1078, 0x5485, 0x1078, 0x2162, + 0x1078, 0x2240, 0x2091, 0x3009, 0x7823, 0x0000, 0x0090, 0x10cf, + 0x7820, 0xa086, 0x0002, 0x00c0, 0x10cf, 0x7823, 0x4000, 0x0068, + 0x10c7, 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2a70, + 0x7003, 0x0000, 0x2001, 0x017f, 0x2003, 0x0000, 0x2a70, 0x7000, + 0xa08e, 0x0003, 0x00c0, 0x10ef, 0x1078, 0x365e, 0x1078, 0x2ae8, + 0x1078, 0x4ee3, 0x1078, 0x4b66, 0x2009, 0x0100, 0x2104, 0xa082, + 0x0002, 0x0048, 0x10f3, 0x1078, 0x5966, 0x0078, 0x10d6, 0x1079, + 0x10f7, 0x0078, 0x10dc, 0x1078, 0x7197, 0x0078, 0x10eb, 0x1101, + 0x1102, 0x11be, 0x10ff, 0x1246, 0x12dc, 0x12dd, 0x12de, 0x1078, + 0x1332, 0x007c, 0x127e, 0x0f7e, 0x2091, 0x8000, 0x7000, 0xa086, + 0x0001, 0x00c0, 0x1198, 0x1078, 0x3aec, 0x2079, 0x0100, 0x7844, + 0xa005, 0x00c0, 0x1198, 0x2011, 0x41dc, 0x1078, 0x5a45, 0x1078, + 0x1adf, 0x780f, 0x00ff, 0x7840, 0xa084, 0xfffb, 0x7842, 0x2011, + 0x8010, 0x73c4, 0x1078, 0x361b, 0x2001, 0xffff, 0x1078, 0x5ae6, + 0x723c, 0xc284, 0x723e, 0x2001, 0xa70c, 0x2014, 0xc2ac, 0x2202, + 0x1078, 0x6f9f, 0x2011, 0x0004, 0x1078, 0x8d2b, 0x1078, 0x489e, + 0x1078, 0x42d4, 0x0040, 0x1144, 0x7087, 0x0001, 0x70bf, 0x0000, + 0x1078, 0x3c9e, 0x0078, 0x1198, 0x1078, 0x4967, 0x0040, 0x114d, + 0x7a0c, 0xc2b4, 0x7a0e, 0x0078, 0x1159, 0x1078, 0x90b6, 0x70cc, + 0xd09c, 0x00c0, 0x1159, 0x7098, 0xa005, 0x0040, 0x1159, 0x1078, + 0x42b8, 0x70d7, 0x0000, 0x70d3, 0x0000, 0x72cc, 0x2079, 0xa752, + 0x7804, 0xd0ac, 0x0040, 0x1165, 0xc295, 0x72ce, 0xa296, 0x0004, + 0x0040, 0x1186, 0x2011, 0x0001, 0x1078, 0x8d2b, 0x7093, 0x0000, + 0x7097, 0xffff, 0x7003, 0x0002, 0x0f7f, 0x1078, 0x2677, 0x2011, + 0x0005, 0x1078, 0x70e0, 0x1078, 0x62d1, 0x0c7e, 0x2061, 0x0100, + 0x60e3, 0x0008, 0x0c7f, 0x127f, 0x0078, 0x119a, 0x7093, 0x0000, + 0x7097, 0xffff, 0x7003, 0x0002, 0x2011, 0x0005, 0x1078, 0x70e0, + 0x1078, 0x62d1, 0x0c7e, 0x2061, 0x0100, 0x60e3, 0x0008, 0x0c7f, + 0x0f7f, 0x127f, 0x007c, 0x0c7e, 0x20a9, 0x0082, 0x2009, 0x007e, + 0x017e, 0x027e, 0x037e, 0x2110, 0x027e, 0x2019, 0x0029, 0x1078, + 0x73d0, 0x027f, 0x1078, 0xa501, 0x037f, 0x027f, 0x017f, 0x1078, + 0x298e, 0x8108, 0x00f0, 0x11a0, 0x0c7f, 0x706f, 0x0000, 0x7070, + 0xa084, 0x00ff, 0x7072, 0x709b, 0x0000, 0x007c, 0x127e, 0x2091, + 0x8000, 0x7000, 0xa086, 0x0002, 0x00c0, 0x1244, 0x7094, 0xa086, + 0xffff, 0x0040, 0x11d1, 0x1078, 0x2677, 0x1078, 0x62d1, 0x0078, + 0x1244, 0x70cc, 0xd09c, 0x0040, 0x11fd, 0xd084, 0x0040, 0x11fd, + 0x0f7e, 0x2079, 0x0100, 0x790c, 0xc1b5, 0x790e, 0x0f7f, 0xd08c, + 0x0040, 0x11fd, 0x70d0, 0xa086, 0xffff, 0x0040, 0x11f9, 0x1078, + 0x27f7, 0x1078, 0x62d1, 0x70cc, 0xd094, 0x00c0, 0x1244, 0x2011, + 0x0001, 0x2019, 0x0000, 0x1078, 0x282f, 0x1078, 0x62d1, 0x0078, + 0x1244, 0x70d4, 0xa005, 0x00c0, 0x1244, 0x7090, 0xa005, 0x00c0, + 0x1244, 0x1078, 0x4967, 0x00c0, 0x1244, 0x2001, 0xa753, 0x2004, + 0xd0ac, 0x0040, 0x1227, 0x157e, 0x0c7e, 0x20a9, 0x007f, 0x2009, + 0x0000, 0x017e, 0x1078, 0x45c4, 0x00c0, 0x121a, 0x6000, 0xd0ec, + 0x00c0, 0x1222, 0x017f, 0x8108, 0x00f0, 0x1211, 0x0c7f, 0x157f, + 0x0078, 0x1227, 0x017f, 0x0c7f, 0x157f, 0x0078, 0x1244, 0x7003, + 0x0003, 0x7097, 0xffff, 0x2001, 0x0000, 0x1078, 0x24e8, 0x1078, + 0x3699, 0x2001, 0xa9b2, 0x2004, 0xa086, 0x0005, 0x00c0, 0x123c, + 0x2011, 0x0000, 0x1078, 0x70e0, 0x2011, 0x0000, 0x1078, 0x70ea, + 0x1078, 0x62d1, 0x1078, 0x639b, 0x127f, 0x007c, 0x017e, 0x0f7e, + 0x127e, 0x2091, 0x8000, 0x2079, 0x0100, 0x2009, 0x00f7, 0x1078, + 0x42a1, 0x7940, 0xa18c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0040, + 0x125b, 0x7827, 0x0040, 0xd19c, 0x0040, 0x1260, 0x7827, 0x0008, + 0x007e, 0x037e, 0x157e, 0xa006, 0x1078, 0x5ae6, 0x7900, 0xa18a, + 0x0003, 0x0050, 0x1289, 0x7954, 0xd1ac, 0x00c0, 0x1289, 0x2009, + 0x00f8, 0x1078, 0x42a1, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, + 0x09c4, 0x7820, 0xd09c, 0x00c0, 0x1281, 0x7824, 0xd0ac, 0x00c0, + 0x12ca, 0x00f0, 0x1279, 0x2001, 0x0001, 0x1078, 0x24e8, 0x0078, + 0x12d5, 0x7853, 0x0000, 0x782f, 0x0020, 0x20a9, 0x0050, 0x00e0, + 0x128f, 0x2091, 0x6000, 0x00f0, 0x128f, 0x7853, 0x0400, 0x782f, + 0x0000, 0x2009, 0x00f8, 0x1078, 0x42a1, 0x20a9, 0x000e, 0x0005, + 0x00f0, 0x129f, 0x7853, 0x1400, 0x7843, 0x0090, 0x7843, 0x0010, + 0x2019, 0x61a8, 0x7854, 0x0005, 0x0005, 0xd08c, 0x0040, 0x12b4, + 0x7824, 0xd0ac, 0x00c0, 0x12ca, 0x8319, 0x00c0, 0x12aa, 0x2009, + 0xa732, 0x2104, 0x8000, 0x200a, 0xa084, 0xfff0, 0x0040, 0x12c4, + 0x200b, 0x0000, 0x1078, 0x2588, 0x2001, 0x0001, 0x1078, 0x24e8, + 0x0078, 0x12d3, 0x2001, 0xa732, 0x2003, 0x0000, 0x7828, 0xc09d, + 0x782a, 0x7827, 0x0048, 0x7853, 0x0400, 0x157f, 0x037f, 0x007f, + 0x127f, 0x0f7f, 0x017f, 0x007c, 0x007c, 0x007c, 0x007c, 0x2a70, + 0x2061, 0xa9ad, 0x2063, 0x0001, 0x6007, 0x0013, 0x600b, 0x0019, + 0x600f, 0x0017, 0x2009, 0x0100, 0x2104, 0xa082, 0x0002, 0x0048, + 0x12f5, 0x7053, 0xffff, 0x0078, 0x12f7, 0x7053, 0x0000, 0x7057, + 0xffff, 0x706f, 0x0000, 0x7073, 0x0000, 0x1078, 0x90b6, 0x2061, + 0xa98d, 0x6003, 0x0909, 0x6007, 0x0000, 0x600b, 0x8800, 0x600f, + 0x0200, 0x6013, 0x00ff, 0x6017, 0x0003, 0x601b, 0x0000, 0x601f, + 0x07d0, 0x2061, 0xa995, 0x6003, 0x8000, 0x6007, 0x0000, 0x600b, + 0x0000, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x0000, 0x601b, + 0x0001, 0x601f, 0x0000, 0x2061, 0xa9a5, 0x6003, 0x514c, 0x6007, + 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, 0x2001, 0xa726, 0x2003, + 0x0000, 0x007c, 0x2091, 0x8000, 0x0068, 0x1334, 0x007e, 0x017e, + 0x2079, 0x0000, 0x7818, 0xd084, 0x00c0, 0x133a, 0x017f, 0x792e, + 0x007f, 0x782a, 0x007f, 0x7826, 0x3900, 0x783a, 0x7823, 0x8002, + 0x781b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x2079, 0xa700, + 0x7803, 0x0005, 0x0078, 0x1352, 0x007c, 0x2071, 0xa700, 0x715c, + 0x712e, 0x2021, 0x0001, 0xa190, 0x002d, 0xa298, 0x002d, 0x0048, + 0x136b, 0x7060, 0xa302, 0x00c8, 0x136b, 0x220a, 0x2208, 0x2310, + 0x8420, 0x0078, 0x135d, 0x200b, 0x0000, 0x74aa, 0x74ae, 0x007c, + 0x0e7e, 0x127e, 0x2091, 0x8000, 0x2071, 0xa700, 0x70ac, 0xa0ea, + 0x0010, 0x00c8, 0x137e, 0xa06e, 0x0078, 0x1388, 0x8001, 0x70ae, + 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, 0x0000, + 0x127f, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0xa700, 0x127e, 0x2091, + 0x8000, 0x70ac, 0x8001, 0x00c8, 0x1398, 0xa06e, 0x0078, 0x13a1, + 0x70ae, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, 0x0000, 0x6807, + 0x0000, 0x127f, 0x0e7f, 0x007c, 0x0e7e, 0x127e, 0x2091, 0x8000, + 0x2071, 0xa700, 0x702c, 0x206a, 0x2d00, 0x702e, 0x70ac, 0x8000, + 0x70ae, 0x127f, 0x0e7f, 0x007c, 0x8dff, 0x0040, 0x13c0, 0x6804, + 0x6807, 0x0000, 0x007e, 0x1078, 0x13a4, 0x0d7f, 0x0078, 0x13b4, + 0x007c, 0x0e7e, 0x2071, 0xa700, 0x70ac, 0xa08a, 0x0010, 0xa00d, + 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0xa9d6, 0x7007, 0x0000, 0x701b, + 0x0000, 0x701f, 0x0000, 0x2071, 0x0000, 0x7010, 0xa085, 0x8004, + 0x7012, 0x0e7f, 0x007c, 0x127e, 0x2091, 0x8000, 0x0e7e, 0x2270, + 0x700b, 0x0000, 0x2071, 0xa9d6, 0x7018, 0xa088, 0xa9df, 0x220a, + 0x8000, 0xa084, 0x0007, 0x701a, 0x7004, 0xa005, 0x00c0, 0x13f6, + 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1408, 0x0f7f, 0x0e7f, 0x127f, + 0x007c, 0x0e7e, 0x2071, 0xa9d6, 0x7004, 0xa005, 0x00c0, 0x1406, + 0x0f7e, 0x2079, 0x0010, 0x1078, 0x1408, 0x0f7f, 0x0e7f, 0x007c, + 0x7000, 0x0079, 0x140b, 0x140f, 0x1479, 0x1496, 0x1496, 0x7018, + 0x711c, 0xa106, 0x00c0, 0x1417, 0x7007, 0x0000, 0x007c, 0x0d7e, + 0xa180, 0xa9df, 0x2004, 0x700a, 0x2068, 0x8108, 0xa18c, 0x0007, + 0x711e, 0x7803, 0x0026, 0x6824, 0x7832, 0x6828, 0x7836, 0x682c, + 0x783a, 0x6830, 0x783e, 0x6810, 0x700e, 0x680c, 0x7016, 0x6804, + 0x0d7f, 0xd084, 0x0040, 0x1439, 0x7007, 0x0001, 0x1078, 0x143e, + 0x007c, 0x7007, 0x0002, 0x1078, 0x1454, 0x007c, 0x017e, 0x027e, + 0x710c, 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x1449, 0x2110, + 0xa006, 0x700e, 0x7212, 0x8203, 0x7822, 0x7803, 0x0020, 0x7803, + 0x0041, 0x027f, 0x017f, 0x007c, 0x017e, 0x027e, 0x137e, 0x147e, + 0x157e, 0x7014, 0x2098, 0x20a1, 0x0014, 0x7803, 0x0026, 0x710c, + 0x2011, 0x0040, 0xa182, 0x0040, 0x00c8, 0x1468, 0x2110, 0xa006, + 0x700e, 0x22a8, 0x53a6, 0x8203, 0x7822, 0x7803, 0x0020, 0x3300, + 0x7016, 0x7803, 0x0001, 0x157f, 0x147f, 0x137f, 0x027f, 0x017f, + 0x007c, 0x137e, 0x147e, 0x157e, 0x2099, 0xa7fa, 0x20a1, 0x0018, + 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000, + 0x7803, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x700b, + 0xa7f5, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x137e, 0x147e, + 0x157e, 0x2001, 0xa829, 0x209c, 0x20a1, 0x0014, 0x7803, 0x0026, + 0x2001, 0xa82a, 0x20ac, 0x53a6, 0x2099, 0xa82b, 0x20a1, 0x0018, + 0x20a9, 0x0008, 0x53a3, 0x7803, 0x0020, 0x127e, 0x2091, 0x8000, + 0x7803, 0x0001, 0x7007, 0x0004, 0x7000, 0xc08c, 0x7002, 0x700b, + 0xa826, 0x127f, 0x157f, 0x147f, 0x137f, 0x007c, 0x017e, 0x0e7e, + 0x2071, 0xa9d6, 0x0f7e, 0x2079, 0x0010, 0x7904, 0x7803, 0x0002, + 0xd1fc, 0x0040, 0x14d0, 0xa18c, 0x0700, 0x7004, 0x1079, 0x14d4, + 0x0f7f, 0x0e7f, 0x017f, 0x007c, 0x1408, 0x14dc, 0x1509, 0x1531, + 0x1564, 0x14da, 0x0078, 0x14da, 0xa18c, 0x0700, 0x00c0, 0x1502, + 0x137e, 0x147e, 0x157e, 0x7014, 0x20a0, 0x2099, 0x0014, 0x7803, + 0x0040, 0x7010, 0x20a8, 0x53a5, 0x3400, 0x7016, 0x157f, 0x147f, + 0x137f, 0x700c, 0xa005, 0x0040, 0x151e, 0x1078, 0x143e, 0x007c, + 0x7008, 0xa080, 0x0002, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, + 0x1408, 0x007c, 0x7008, 0xa080, 0x0002, 0x2003, 0x0200, 0x0078, + 0x14fd, 0xa18c, 0x0700, 0x00c0, 0x1514, 0x700c, 0xa005, 0x0040, + 0x151e, 0x1078, 0x1454, 0x007c, 0x7008, 0xa080, 0x0002, 0x2003, + 0x0200, 0x7007, 0x0000, 0x1078, 0x1408, 0x007c, 0x0d7e, 0x7008, + 0x2068, 0x7830, 0x6826, 0x7834, 0x682a, 0x7838, 0x682e, 0x783c, + 0x6832, 0x680b, 0x0100, 0x0d7f, 0x7007, 0x0000, 0x1078, 0x1408, + 0x007c, 0xa18c, 0x0700, 0x00c0, 0x155e, 0x137e, 0x147e, 0x157e, + 0x2001, 0xa7f8, 0x2004, 0xa080, 0x000d, 0x20a0, 0x2099, 0x0014, + 0x7803, 0x0040, 0x20a9, 0x0020, 0x53a5, 0x2001, 0xa7fa, 0x2004, + 0xd0bc, 0x0040, 0x1554, 0x2001, 0xa803, 0x2004, 0xa080, 0x000d, + 0x20a0, 0x20a9, 0x0020, 0x53a5, 0x157f, 0x147f, 0x137f, 0x7007, + 0x0000, 0x1078, 0x4f8c, 0x1078, 0x1408, 0x007c, 0x2011, 0x8003, + 0x1078, 0x361b, 0x0078, 0x1562, 0xa18c, 0x0700, 0x00c0, 0x1571, + 0x2001, 0xa828, 0x2003, 0x0100, 0x7007, 0x0000, 0x1078, 0x1408, + 0x007c, 0x2011, 0x8004, 0x1078, 0x361b, 0x0078, 0x1575, 0x127e, + 0x2091, 0x2100, 0x2079, 0x0030, 0x2071, 0xa9e7, 0x7803, 0x0004, + 0x7003, 0x0000, 0x700f, 0xa9ed, 0x7013, 0xa9ed, 0x780f, 0x0076, + 0x7803, 0x0004, 0x127f, 0x007c, 0x6934, 0xa184, 0x0007, 0x0079, + 0x1591, 0x1599, 0x15df, 0x1599, 0x1599, 0x1599, 0x15c4, 0x15a8, + 0x159d, 0xa085, 0x0001, 0x0078, 0x15f9, 0x684c, 0xd0bc, 0x0040, + 0x1599, 0x6860, 0x682e, 0x685c, 0x682a, 0x6858, 0x0078, 0x15e7, + 0xa18c, 0x00ff, 0xa186, 0x001e, 0x00c0, 0x1599, 0x684c, 0xd0bc, + 0x0040, 0x1599, 0x6860, 0x682e, 0x685c, 0x682a, 0x6804, 0x681a, + 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004, + 0x6832, 0x6858, 0x0078, 0x15ef, 0xa18c, 0x00ff, 0xa186, 0x0015, + 0x00c0, 0x1599, 0x684c, 0xd0ac, 0x0040, 0x1599, 0x6804, 0x681a, + 0xa080, 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004, + 0x6832, 0xa006, 0x682e, 0x682a, 0x6858, 0x0078, 0x15ef, 0x684c, + 0xd0ac, 0x0040, 0x1599, 0xa006, 0x682e, 0x682a, 0x6858, 0xa18c, + 0x000f, 0xa188, 0x206a, 0x210c, 0x6932, 0x2d08, 0x691a, 0x6826, + 0x684c, 0xc0dd, 0x684e, 0xa006, 0x680a, 0x697c, 0x6912, 0x6980, + 0x6916, 0x007c, 0x20e1, 0x0007, 0x20e1, 0x2000, 0x2001, 0x020a, + 0x2004, 0x82ff, 0x0040, 0x161c, 0xa280, 0x0004, 0x0d7e, 0x206c, + 0x684c, 0xd0dc, 0x00c0, 0x1618, 0x1078, 0x158c, 0x0040, 0x1618, + 0x0d7f, 0xa280, 0x0000, 0x2003, 0x0002, 0xa016, 0x0078, 0x161c, + 0x6808, 0x8000, 0x680a, 0x0d7f, 0x127e, 0x047e, 0x037e, 0x027e, + 0x2091, 0x2100, 0x027f, 0x037f, 0x047f, 0x7000, 0xa005, 0x00c0, + 0x1630, 0x7206, 0x2001, 0x1651, 0x007e, 0x2260, 0x0078, 0x17e0, + 0x710c, 0x220a, 0x8108, 0x230a, 0x8108, 0x240a, 0x8108, 0xa182, + 0xaa08, 0x0048, 0x163d, 0x2009, 0xa9ed, 0x710e, 0x7010, 0xa102, + 0xa082, 0x0009, 0x0040, 0x1648, 0xa080, 0x001b, 0x00c0, 0x164b, + 0x2009, 0x0138, 0x200a, 0x7000, 0xa005, 0x00c0, 0x1651, 0x1078, + 0x17c1, 0x127f, 0x007c, 0x127e, 0x027e, 0x037e, 0x0c7e, 0x007e, + 0x2091, 0x2100, 0x007f, 0x047f, 0x037f, 0x027f, 0x0d7e, 0x0c7e, + 0x2460, 0x6110, 0x2168, 0x6a62, 0x6b5e, 0xa005, 0x0040, 0x16dd, + 0x6808, 0xa005, 0x0040, 0x174a, 0x7000, 0xa005, 0x00c0, 0x1672, + 0x0078, 0x16d2, 0x700c, 0x7110, 0xa106, 0x00c0, 0x1753, 0x7004, + 0xa406, 0x00c0, 0x16d2, 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, + 0x168f, 0x047e, 0x1078, 0x1913, 0x047f, 0x2460, 0x6010, 0xa080, + 0x0002, 0x2004, 0xa005, 0x0040, 0x174a, 0x0078, 0x166c, 0x2001, + 0x0207, 0x2004, 0xd09c, 0x00c0, 0x167b, 0x7804, 0xa084, 0x6000, + 0x0040, 0x16a0, 0xa086, 0x6000, 0x0040, 0x16a0, 0x0078, 0x167b, + 0x7100, 0xa186, 0x0002, 0x00c0, 0x16c0, 0x0e7e, 0x2b68, 0x6818, + 0x2060, 0x1078, 0x203f, 0x2804, 0xac70, 0x6034, 0xd09c, 0x00c0, + 0x16b5, 0x7108, 0x720c, 0x0078, 0x16b7, 0x7110, 0x7214, 0x6810, + 0xa100, 0x6812, 0x6814, 0xa201, 0x6816, 0x0e7f, 0x0078, 0x16c4, + 0xa186, 0x0001, 0x00c0, 0x16cc, 0x7820, 0x6910, 0xa100, 0x6812, + 0x7824, 0x6914, 0xa101, 0x6816, 0x7803, 0x0004, 0x7003, 0x0000, + 0x7004, 0x2060, 0x6100, 0xa18e, 0x0004, 0x00c0, 0x1753, 0x2009, + 0x0048, 0x1078, 0x775c, 0x0078, 0x1753, 0x6808, 0xa005, 0x0040, + 0x174a, 0x7000, 0xa005, 0x00c0, 0x16e7, 0x0078, 0x174a, 0x700c, + 0x7110, 0xa106, 0x00c0, 0x16f0, 0x7004, 0xa406, 0x00c0, 0x174a, + 0x2001, 0x0005, 0x2004, 0xd08c, 0x0040, 0x1704, 0x047e, 0x1078, + 0x1913, 0x047f, 0x2460, 0x6010, 0xa080, 0x0002, 0x2004, 0xa005, + 0x0040, 0x174a, 0x0078, 0x16e1, 0x2001, 0x0207, 0x2004, 0xd09c, + 0x00c0, 0x16f0, 0x2001, 0x0005, 0x2004, 0xd08c, 0x00c0, 0x16f6, + 0x7804, 0xa084, 0x6000, 0x0040, 0x171b, 0xa086, 0x6000, 0x0040, + 0x171b, 0x0078, 0x16f0, 0x7007, 0x0000, 0xa016, 0x2218, 0x7000, + 0xa08e, 0x0001, 0x0040, 0x173c, 0xa08e, 0x0002, 0x00c0, 0x174a, + 0x0c7e, 0x0e7e, 0x6818, 0x2060, 0x1078, 0x203f, 0x2804, 0xac70, + 0x6034, 0xd09c, 0x00c0, 0x1738, 0x7308, 0x720c, 0x0078, 0x173a, + 0x7310, 0x7214, 0x0e7f, 0x0c7f, 0x7820, 0xa318, 0x7824, 0xa211, + 0x6810, 0xa300, 0x6812, 0x6814, 0xa201, 0x6816, 0x7803, 0x0004, + 0x7003, 0x0000, 0x6100, 0xa18e, 0x0004, 0x00c0, 0x1753, 0x2009, + 0x0048, 0x1078, 0x775c, 0x0c7f, 0x0d7f, 0x127f, 0x007c, 0x0f7e, + 0x0e7e, 0x027e, 0x037e, 0x047e, 0x057e, 0x2071, 0xa9e7, 0x7000, + 0xa086, 0x0000, 0x0040, 0x17ba, 0x7004, 0xac06, 0x00c0, 0x17ab, + 0x2079, 0x0030, 0x7000, 0xa086, 0x0003, 0x0040, 0x17ab, 0x7804, + 0xd0fc, 0x00c0, 0x17a7, 0x20e1, 0x6000, 0x2011, 0x0032, 0x2001, + 0x0208, 0x200c, 0x2001, 0x0209, 0x2004, 0xa106, 0x00c0, 0x176f, + 0x8211, 0x00c0, 0x1777, 0x7804, 0xd0fc, 0x00c0, 0x17a7, 0x1078, + 0x1b22, 0x027e, 0x057e, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, + 0x178d, 0x7803, 0x0002, 0x7803, 0x0009, 0x7003, 0x0003, 0x7007, + 0x0000, 0x057f, 0x027f, 0x2001, 0x015d, 0x2003, 0x0000, 0x2001, + 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x0078, 0x17ab, 0x1078, + 0x1913, 0x0078, 0x175f, 0x157e, 0x20a9, 0x0009, 0x2009, 0xa9ed, + 0x2104, 0xac06, 0x00c0, 0x17b5, 0x200a, 0xa188, 0x0003, 0x00f0, + 0x17b0, 0x157f, 0x057f, 0x047f, 0x037f, 0x027f, 0x0e7f, 0x0f7f, + 0x007c, 0x700c, 0x7110, 0xa106, 0x00c0, 0x17c9, 0x7003, 0x0000, + 0x007c, 0x2104, 0x7006, 0x2060, 0x8108, 0x211c, 0x8108, 0x2124, + 0x8108, 0xa182, 0xaa08, 0x0048, 0x17d7, 0x2009, 0xa9ed, 0x7112, + 0x700c, 0xa106, 0x00c0, 0x17e0, 0x2001, 0x0138, 0x2003, 0x0008, + 0x8cff, 0x00c0, 0x17e7, 0x1078, 0x1b4d, 0x0078, 0x1854, 0x6010, + 0x2068, 0x2d58, 0x6828, 0xa406, 0x00c0, 0x17f2, 0x682c, 0xa306, + 0x0040, 0x182f, 0x601c, 0xa086, 0x0008, 0x0040, 0x182f, 0x6024, + 0xd0f4, 0x00c0, 0x181c, 0xd0d4, 0x0040, 0x1818, 0x6038, 0xa402, + 0x6034, 0xa303, 0x0040, 0x1806, 0x00c8, 0x1818, 0x643a, 0x6336, + 0x6c2a, 0x6b2e, 0x047e, 0x037e, 0x2400, 0x6c7c, 0xa402, 0x6812, + 0x2300, 0x6b80, 0xa303, 0x6816, 0x037f, 0x047f, 0x0078, 0x181c, + 0x1078, 0x9063, 0x0040, 0x17e3, 0x2001, 0xa774, 0x2004, 0xd0b4, + 0x00c0, 0x182b, 0x6018, 0x2004, 0xd0bc, 0x00c0, 0x182b, 0x6817, + 0x7fff, 0x6813, 0xffff, 0x1078, 0x208a, 0x00c0, 0x17e3, 0x0c7e, + 0x7004, 0x2060, 0x6024, 0xc0d4, 0x6026, 0x0c7f, 0x684c, 0xd0f4, + 0x0040, 0x1840, 0x6817, 0xffff, 0x6813, 0xffff, 0x0078, 0x17e3, + 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, + 0x000f, 0x2009, 0x0011, 0x1078, 0x1855, 0x0040, 0x1853, 0x2009, + 0x0001, 0x1078, 0x1855, 0x2d58, 0x007c, 0x8aff, 0x0040, 0x18ec, + 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1877, 0xd0f4, 0x00c0, + 0x1887, 0x0d7e, 0x2804, 0xac68, 0x2900, 0x0079, 0x1867, 0x18ce, + 0x188e, 0x188e, 0x18ce, 0x18ce, 0x18c6, 0x18ce, 0x188e, 0x18ce, + 0x1894, 0x1894, 0x18ce, 0x18ce, 0x18ce, 0x18bd, 0x1894, 0xc0fc, + 0x6852, 0x6b6c, 0x6a70, 0x6d1c, 0x6c20, 0x0d7e, 0xd99c, 0x0040, + 0x18d1, 0x2804, 0xac68, 0x6f08, 0x6e0c, 0x0078, 0x18d1, 0xc0f4, + 0x6852, 0x6b6c, 0x6a70, 0x0d7e, 0x0078, 0x18d8, 0x6b08, 0x6a0c, + 0x6d00, 0x6c04, 0x0078, 0x18d1, 0x7b0c, 0xd3bc, 0x0040, 0x18b5, + 0x7004, 0x0e7e, 0x2070, 0x701c, 0x0e7f, 0xa086, 0x0008, 0x00c0, + 0x18b5, 0x7b08, 0xa39c, 0x0fff, 0x2d20, 0x0d7f, 0x0d7e, 0x6a14, + 0x82ff, 0x00c0, 0x18b0, 0x6810, 0xa302, 0x0048, 0x18b0, 0x6b10, + 0x2011, 0x0000, 0x2468, 0x0078, 0x18b7, 0x6b10, 0x6a14, 0x6d00, + 0x6c04, 0x6f08, 0x6e0c, 0x0078, 0x18d1, 0x0d7f, 0x0d7e, 0x6834, + 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x18ce, 0x0d7f, 0x1078, + 0x2026, 0x00c0, 0x1855, 0xa00e, 0x0078, 0x18ec, 0x0d7f, 0x1078, + 0x1332, 0x7b22, 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, + 0x7000, 0x8000, 0x7002, 0x0d7f, 0x6828, 0xa300, 0x682a, 0x682c, + 0xa201, 0x682e, 0x2300, 0x6b10, 0xa302, 0x6812, 0x2200, 0x6a14, + 0xa203, 0x6816, 0x1078, 0x2026, 0x007c, 0x1078, 0x1332, 0x1078, + 0x1c97, 0x7004, 0x2060, 0x0d7e, 0x6010, 0x2068, 0x7003, 0x0000, + 0x1078, 0x1af4, 0x1078, 0x8d16, 0x0040, 0x190c, 0x6808, 0x8001, + 0x680a, 0x697c, 0x6912, 0x6980, 0x6916, 0x682b, 0xffff, 0x682f, + 0xffff, 0x6850, 0xc0bd, 0x6852, 0x0d7f, 0x1078, 0x8a11, 0x0078, + 0x1adb, 0x1078, 0x1332, 0x127e, 0x2091, 0x2100, 0x007e, 0x017e, + 0x2b68, 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, + 0x00c0, 0x18ef, 0xa184, 0x0003, 0xa086, 0x0003, 0x0040, 0x1911, + 0x7000, 0x0079, 0x192b, 0x1933, 0x1935, 0x1a34, 0x1ab2, 0x1ac9, + 0x1933, 0x1933, 0x1933, 0x1078, 0x1332, 0x8001, 0x7002, 0xa184, + 0x0880, 0x00c0, 0x194a, 0x8aff, 0x0040, 0x19d4, 0x2009, 0x0001, + 0x1078, 0x1855, 0x0040, 0x1adb, 0x2009, 0x0001, 0x1078, 0x1855, + 0x0078, 0x1adb, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1bc, 0x00c0, + 0x19b2, 0x027e, 0x037e, 0x017e, 0x7808, 0xd0ec, 0x00c0, 0x1962, + 0x7c20, 0x7d24, 0x7e30, 0x7f34, 0x7803, 0x0009, 0x7003, 0x0004, + 0x0078, 0x1964, 0x1078, 0x1bd7, 0x017f, 0xd194, 0x0040, 0x196b, + 0x8aff, 0x0040, 0x19a1, 0x6b28, 0x6a2c, 0x2400, 0x686e, 0xa31a, + 0x2500, 0x6872, 0xa213, 0x6b2a, 0x6a2e, 0x0c7e, 0x7004, 0x2060, + 0x6024, 0xd0f4, 0x00c0, 0x197e, 0x633a, 0x6236, 0x0c7f, 0x2400, + 0x6910, 0xa100, 0x6812, 0x2500, 0x6914, 0xa101, 0x6816, 0x037f, + 0x027f, 0x2600, 0x681e, 0x2700, 0x6822, 0x1078, 0x203f, 0x2a00, + 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x6850, 0xc0fd, 0x6852, + 0x6808, 0x8001, 0x680a, 0x00c0, 0x19a7, 0x684c, 0xd0e4, 0x0040, + 0x19a7, 0x7004, 0x2060, 0x2009, 0x0048, 0x1078, 0x775c, 0x7000, + 0xa086, 0x0004, 0x0040, 0x1adb, 0x7003, 0x0000, 0x1078, 0x17c1, + 0x0078, 0x1adb, 0x057e, 0x7d0c, 0xd5bc, 0x00c0, 0x19b9, 0x1078, + 0xa58e, 0x057f, 0x1078, 0x1af4, 0x0f7e, 0x7004, 0x2078, 0x1078, + 0x4963, 0x0040, 0x19c6, 0x7824, 0xc0f5, 0x7826, 0x0f7f, 0x682b, + 0xffff, 0x682f, 0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912, + 0x6980, 0x6916, 0x0078, 0x1adb, 0x7004, 0x0c7e, 0x2060, 0x6024, + 0x0c7f, 0xd0f4, 0x0040, 0x19e1, 0x6808, 0x8001, 0x680a, 0x0078, + 0x19f5, 0x684c, 0xc0f5, 0x684e, 0x7814, 0xa005, 0x00c0, 0x19f9, + 0x7003, 0x0000, 0x6808, 0x8001, 0x680a, 0x00c0, 0x19f5, 0x7004, + 0x2060, 0x2009, 0x0048, 0x1078, 0x775c, 0x1078, 0x17c1, 0x0078, + 0x1adb, 0x7814, 0x6910, 0xa102, 0x6812, 0x6914, 0xa183, 0x0000, + 0x6816, 0x7814, 0x7908, 0xa18c, 0x0fff, 0xa192, 0x0841, 0x00c8, + 0x18ef, 0xa188, 0x0007, 0x8114, 0x8214, 0x8214, 0xa10a, 0x8104, + 0x8004, 0x8004, 0xa20a, 0x810b, 0x810b, 0x810b, 0x1078, 0x1b5e, + 0x7803, 0x0004, 0x780f, 0xffff, 0x7803, 0x0001, 0x7804, 0xd0fc, + 0x0040, 0x1a1e, 0x7803, 0x0002, 0x7803, 0x0004, 0x780f, 0x0076, + 0x7004, 0x7007, 0x0000, 0x2060, 0x2009, 0x0048, 0x1078, 0x775c, + 0x1078, 0x1b92, 0x0040, 0x19f5, 0x8001, 0x7002, 0xd194, 0x0040, + 0x1a46, 0x7804, 0xd0fc, 0x00c0, 0x191b, 0x8aff, 0x0040, 0x1adb, + 0x2009, 0x0001, 0x1078, 0x1855, 0x0078, 0x1adb, 0xa184, 0x0880, + 0x00c0, 0x1a53, 0x8aff, 0x0040, 0x1adb, 0x2009, 0x0001, 0x1078, + 0x1855, 0x0078, 0x1adb, 0x7803, 0x0004, 0x7003, 0x0000, 0xd1bc, + 0x00c0, 0x1a93, 0x027e, 0x037e, 0x7808, 0xd0ec, 0x00c0, 0x1a66, + 0x7803, 0x0009, 0x7003, 0x0004, 0x0078, 0x1a68, 0x1078, 0x1bd7, + 0x6b28, 0x6a2c, 0x1078, 0x203f, 0x0d7e, 0x0f7e, 0x2d78, 0x2804, + 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1a83, 0x6808, 0x2008, 0xa31a, + 0x680c, 0xa213, 0x7810, 0xa100, 0x7812, 0x690c, 0x7814, 0xa101, + 0x7816, 0x0078, 0x1a8f, 0x6810, 0x2008, 0xa31a, 0x6814, 0xa213, + 0x7810, 0xa100, 0x7812, 0x6914, 0x7814, 0xa101, 0x7816, 0x0f7f, + 0x0d7f, 0x0078, 0x196d, 0x057e, 0x7d0c, 0x1078, 0xa58e, 0x057f, + 0x1078, 0x1af4, 0x0f7e, 0x7004, 0x2078, 0x1078, 0x4963, 0x0040, + 0x1aa4, 0x7824, 0xc0f5, 0x7826, 0x0f7f, 0x682b, 0xffff, 0x682f, + 0xffff, 0x6808, 0x8001, 0x680a, 0x697c, 0x6912, 0x6980, 0x6916, + 0x0078, 0x1adb, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0xa00d, + 0x0040, 0x1ac5, 0x6808, 0x8001, 0x680a, 0x00c0, 0x1ac5, 0x7004, + 0x2060, 0x2009, 0x0048, 0x1078, 0x775c, 0x1078, 0x17c1, 0x0078, + 0x1adb, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x6010, + 0xa005, 0x0040, 0x1ac5, 0x2068, 0x6808, 0x8000, 0x680a, 0x6c28, + 0x6b2c, 0x1078, 0x17e0, 0x017f, 0x007f, 0x127f, 0x007c, 0x127e, + 0x2091, 0x2100, 0x7000, 0xa086, 0x0003, 0x00c0, 0x1af2, 0x700c, + 0x7110, 0xa106, 0x0040, 0x1af2, 0x20e1, 0x9028, 0x700f, 0xa9ed, + 0x7013, 0xa9ed, 0x127f, 0x007c, 0x0c7e, 0x1078, 0x1b22, 0x20e1, + 0x9028, 0x700c, 0x7110, 0xa106, 0x0040, 0x1b19, 0x2104, 0xa005, + 0x0040, 0x1b08, 0x2060, 0x6010, 0x2060, 0x6008, 0x8001, 0x600a, + 0xa188, 0x0003, 0xa182, 0xaa08, 0x0048, 0x1b10, 0x2009, 0xa9ed, + 0x7112, 0x700c, 0xa106, 0x00c0, 0x1af9, 0x2011, 0x0008, 0x0078, + 0x1af9, 0x2001, 0x015d, 0x2003, 0x0000, 0x2001, 0x0138, 0x2202, + 0x0c7f, 0x007c, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2021, + 0xb015, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x00c0, 0x1b3f, 0x2001, + 0x0109, 0x201c, 0xa39c, 0x0048, 0x00c0, 0x1b3f, 0x2001, 0x0111, + 0x201c, 0x83ff, 0x00c0, 0x1b3f, 0x8421, 0x00c0, 0x1b29, 0x007c, + 0x2011, 0x0201, 0x2009, 0x003c, 0x2204, 0xa005, 0x00c0, 0x1b4c, + 0x8109, 0x00c0, 0x1b44, 0x007c, 0x007c, 0x1078, 0x1b40, 0x0040, + 0x1b55, 0x780c, 0xd0a4, 0x0040, 0x1b5b, 0x1078, 0x1af4, 0xa085, + 0x0001, 0x0078, 0x1b5d, 0x1078, 0x1b92, 0x007c, 0x0e7e, 0x2071, + 0x0200, 0x7808, 0xa084, 0xf000, 0xa10d, 0x1078, 0x1b22, 0x2019, + 0x5000, 0x8319, 0x0040, 0x1b7c, 0x2001, 0xaa08, 0x2004, 0xa086, + 0x0000, 0x0040, 0x1b7c, 0x2001, 0x0021, 0xd0fc, 0x0040, 0x1b69, + 0x1078, 0x1eaa, 0x0078, 0x1b67, 0x20e1, 0x7000, 0x7324, 0x7420, + 0x7028, 0x7028, 0x7426, 0x7037, 0x0001, 0x810f, 0x712e, 0x702f, + 0x0100, 0x7037, 0x0008, 0x7326, 0x7422, 0x2001, 0x0138, 0x2202, + 0x0e7f, 0x007c, 0x027e, 0x2001, 0x015d, 0x2001, 0x0000, 0x7908, + 0xa18c, 0x0fff, 0xa182, 0x0ffd, 0x0048, 0x1ba0, 0x2009, 0x0000, + 0xa190, 0x0007, 0xa294, 0x1ff8, 0x8214, 0x8214, 0x8214, 0x2001, + 0x020a, 0x82ff, 0x0040, 0x1bb5, 0x20e1, 0x6000, 0x200c, 0x200c, + 0x200c, 0x200c, 0x8211, 0x00c0, 0x1bae, 0x20e1, 0x7000, 0x200c, + 0x200c, 0x7003, 0x0000, 0x20e1, 0x6000, 0x2001, 0x0208, 0x200c, + 0x2001, 0x0209, 0x2004, 0xa106, 0x0040, 0x1bd4, 0x1078, 0x1b40, + 0x0040, 0x1bd2, 0x7908, 0xd1ec, 0x00c0, 0x1bd4, 0x790c, 0xd1a4, + 0x0040, 0x1b97, 0x1078, 0x1af4, 0xa006, 0x027f, 0x007c, 0x7c20, + 0x7d24, 0x7e30, 0x7f34, 0x700c, 0x7110, 0xa106, 0x0040, 0x1c69, + 0x7004, 0x017e, 0x210c, 0xa106, 0x017f, 0x0040, 0x1c69, 0x0d7e, + 0x0c7e, 0x216c, 0x2d00, 0xa005, 0x0040, 0x1c67, 0x681c, 0xa086, + 0x0008, 0x0040, 0x1c67, 0x6824, 0xd0d4, 0x00c0, 0x1c67, 0x6810, + 0x2068, 0x6850, 0xd0fc, 0x0040, 0x1c29, 0x8108, 0x2104, 0x6b2c, + 0xa306, 0x00c0, 0x1c67, 0x8108, 0x2104, 0x6a28, 0xa206, 0x00c0, + 0x1c67, 0x6850, 0xc0fc, 0xc0f5, 0x6852, 0x686c, 0x7822, 0x6870, + 0x7826, 0x681c, 0x7832, 0x6820, 0x7836, 0x6818, 0x2060, 0x6034, + 0xd09c, 0x0040, 0x1c24, 0x6830, 0x2004, 0xac68, 0x6808, 0x783a, + 0x680c, 0x783e, 0x0078, 0x1c65, 0xa006, 0x783a, 0x783e, 0x0078, + 0x1c65, 0x8108, 0x2104, 0xa005, 0x00c0, 0x1c67, 0x6b2c, 0xa306, + 0x00c0, 0x1c67, 0x8108, 0x2104, 0xa005, 0x00c0, 0x1c67, 0x6a28, + 0xa206, 0x00c0, 0x1c67, 0x6850, 0xc0f5, 0x6852, 0x6830, 0x2004, + 0x6918, 0xa160, 0xa180, 0x000d, 0x2004, 0xd09c, 0x00c0, 0x1c57, + 0x6008, 0x7822, 0x686e, 0x600c, 0x7826, 0x6872, 0x6000, 0x7832, + 0x6004, 0x7836, 0xa006, 0x783a, 0x783e, 0x0078, 0x1c65, 0x6010, + 0x7822, 0x686e, 0x6014, 0x7826, 0x6872, 0x6000, 0x7832, 0x6004, + 0x7836, 0x6008, 0x783a, 0x600c, 0x783e, 0x7803, 0x0011, 0x0c7f, + 0x0d7f, 0x007c, 0x0f7e, 0x0e7e, 0x017e, 0x027e, 0x2071, 0xa9e7, + 0x2079, 0x0030, 0x2011, 0x0050, 0x7000, 0xa086, 0x0000, 0x0040, + 0x1c92, 0x8211, 0x0040, 0x1c90, 0x2001, 0x0005, 0x2004, 0xd08c, + 0x0040, 0x1c79, 0x7904, 0xa18c, 0x0780, 0x017e, 0x1078, 0x1913, + 0x017f, 0x81ff, 0x00c0, 0x1c90, 0x2011, 0x0050, 0x0078, 0x1c74, + 0xa085, 0x0001, 0x027f, 0x017f, 0x0e7f, 0x0f7f, 0x007c, 0x7803, + 0x0004, 0x2009, 0x0064, 0x7804, 0xd0ac, 0x0040, 0x1ce8, 0x8109, + 0x00c0, 0x1c9b, 0x2009, 0x0100, 0x210c, 0xa18a, 0x0003, 0x1048, + 0x1332, 0x1078, 0x1fca, 0x0e7e, 0x0f7e, 0x2071, 0xa9d6, 0x2079, + 0x0010, 0x7004, 0xa086, 0x0000, 0x0040, 0x1ce0, 0x7800, 0x007e, + 0x7820, 0x007e, 0x7830, 0x007e, 0x7834, 0x007e, 0x7838, 0x007e, + 0x783c, 0x007e, 0x7803, 0x0004, 0x7823, 0x0000, 0x0005, 0x0005, + 0x2079, 0x0030, 0x7804, 0xd0ac, 0x10c0, 0x1332, 0x2079, 0x0010, + 0x007f, 0x783e, 0x007f, 0x783a, 0x007f, 0x7836, 0x007f, 0x7832, + 0x007f, 0x7822, 0x007f, 0x7802, 0x0f7f, 0x0e7f, 0x0078, 0x1ce6, + 0x0f7f, 0x0e7f, 0x7804, 0xd0ac, 0x10c0, 0x1332, 0x1078, 0x639b, + 0x007c, 0x0e7e, 0x2071, 0xaa08, 0x7003, 0x0000, 0x0e7f, 0x007c, + 0x0d7e, 0xa280, 0x0004, 0x206c, 0x694c, 0xd1dc, 0x00c0, 0x1d6b, + 0x6934, 0xa184, 0x0007, 0x0079, 0x1cfd, 0x1d05, 0x1d56, 0x1d05, + 0x1d05, 0x1d05, 0x1d3b, 0x1d18, 0x1d07, 0x1078, 0x1332, 0x684c, + 0xd0b4, 0x0040, 0x1e79, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, + 0x6812, 0x687c, 0x680a, 0x6880, 0x680e, 0x6958, 0x0078, 0x1d5e, + 0x6834, 0xa084, 0x00ff, 0xa086, 0x001e, 0x00c0, 0x1d05, 0x684c, + 0xd0b4, 0x0040, 0x1e79, 0x6860, 0x682e, 0x6816, 0x685c, 0x682a, + 0x6812, 0x687c, 0x680a, 0x6880, 0x680e, 0x6804, 0x681a, 0xa080, + 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004, 0x6832, + 0x6958, 0x0078, 0x1d67, 0xa18c, 0x00ff, 0xa186, 0x0015, 0x00c0, + 0x1d6b, 0x684c, 0xd0b4, 0x0040, 0x1e79, 0x6804, 0x681a, 0xa080, + 0x000d, 0x2004, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004, 0x6832, + 0x6958, 0xa006, 0x682e, 0x682a, 0x0078, 0x1d67, 0x684c, 0xd0b4, + 0x0040, 0x18ed, 0x6958, 0xa006, 0x682e, 0x682a, 0x2d00, 0x681a, + 0x6834, 0xa084, 0x000f, 0xa080, 0x206a, 0x2004, 0x6832, 0x6926, + 0x684c, 0xc0dd, 0x684e, 0x0d7f, 0x007c, 0x0f7e, 0x2079, 0x0020, + 0x7804, 0xd0fc, 0x10c0, 0x1eaa, 0x0e7e, 0x0d7e, 0x2071, 0xaa08, + 0x7000, 0xa005, 0x00c0, 0x1df0, 0x0c7e, 0x7206, 0xa280, 0x0004, + 0x205c, 0x7004, 0x2068, 0x7803, 0x0004, 0x6818, 0x0d7e, 0x2068, + 0x686c, 0x7812, 0x6890, 0x0f7e, 0x20e1, 0x9040, 0x2079, 0x0200, + 0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, 0x0f7f, 0x0d7f, 0x2b68, + 0x6824, 0x2050, 0x6818, 0x2060, 0x6830, 0x2040, 0x6034, 0xa0cc, + 0x000f, 0x6908, 0x2001, 0x04fd, 0x2004, 0xa086, 0x0007, 0x0040, + 0x1db2, 0xa184, 0x0007, 0x0040, 0x1db2, 0x017e, 0x2009, 0x0008, + 0xa102, 0x017f, 0xa108, 0x791a, 0x7116, 0x701e, 0x680c, 0xa081, + 0x0000, 0x781e, 0x701a, 0xa006, 0x700e, 0x7012, 0x7004, 0x692c, + 0x6814, 0xa106, 0x00c0, 0x1dc9, 0x6928, 0x6810, 0xa106, 0x0040, + 0x1dd6, 0x037e, 0x047e, 0x6b14, 0x6c10, 0x1078, 0x208a, 0x047f, + 0x037f, 0x0040, 0x1dd6, 0x0c7f, 0x0078, 0x1df0, 0x8aff, 0x00c0, + 0x1dde, 0x0c7f, 0xa085, 0x0001, 0x0078, 0x1df0, 0x127e, 0x2091, + 0x8000, 0x2079, 0x0020, 0x2009, 0x0001, 0x1078, 0x1df4, 0x0040, + 0x1ded, 0x2009, 0x0001, 0x1078, 0x1df4, 0x127f, 0x0c7f, 0xa006, + 0x0d7f, 0x0e7f, 0x0f7f, 0x007c, 0x077e, 0x067e, 0x057e, 0x047e, + 0x037e, 0x027e, 0x8aff, 0x0040, 0x1e72, 0x700c, 0x7214, 0xa23a, + 0x7010, 0x7218, 0xa203, 0x0048, 0x1e71, 0xa705, 0x0040, 0x1e71, + 0xa03e, 0x2730, 0x6850, 0xd0fc, 0x00c0, 0x1e24, 0x0d7e, 0x2804, + 0xac68, 0x2900, 0x0079, 0x1e14, 0x1e53, 0x1e34, 0x1e34, 0x1e53, + 0x1e53, 0x1e4b, 0x1e53, 0x1e34, 0x1e53, 0x1e3a, 0x1e3a, 0x1e53, + 0x1e53, 0x1e53, 0x1e42, 0x1e3a, 0xc0fc, 0x6852, 0x6b6c, 0x6a70, + 0x6d1c, 0x6c20, 0xd99c, 0x0040, 0x1e57, 0x0d7e, 0x2804, 0xac68, + 0x6f08, 0x6e0c, 0x0078, 0x1e56, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, + 0x0078, 0x1e56, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, + 0x0078, 0x1e56, 0x0d7f, 0x0d7e, 0x6834, 0xa084, 0x00ff, 0xa086, + 0x001e, 0x00c0, 0x1e53, 0x0d7f, 0x1078, 0x2026, 0x00c0, 0x1dfa, + 0xa00e, 0x0078, 0x1e72, 0x0d7f, 0x1078, 0x1332, 0x0d7f, 0x7b22, + 0x7a26, 0x7d32, 0x7c36, 0x7f3a, 0x7e3e, 0x7902, 0x7000, 0x8000, + 0x7002, 0x6828, 0xa300, 0x682a, 0x682c, 0xa201, 0x682e, 0x700c, + 0xa300, 0x700e, 0x7010, 0xa201, 0x7012, 0x1078, 0x2026, 0x0078, + 0x1e72, 0xa006, 0x027f, 0x037f, 0x047f, 0x057f, 0x067f, 0x077f, + 0x007c, 0x1078, 0x1332, 0x027e, 0x2001, 0x0105, 0x2003, 0x0010, + 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, + 0x0d7e, 0x6010, 0x2068, 0x1078, 0x8d16, 0x0040, 0x1e92, 0x6850, + 0xc0bd, 0x6852, 0x0d7f, 0x0c7e, 0x1078, 0x8a11, 0x0c7f, 0x2001, + 0xa9c0, 0x2004, 0xac06, 0x00c0, 0x1ea7, 0x20e1, 0x9040, 0x1078, + 0x738a, 0x2011, 0x0000, 0x1078, 0x70ea, 0x1078, 0x639b, 0x027f, + 0x0078, 0x1f76, 0x127e, 0x2091, 0x2200, 0x007e, 0x017e, 0x0f7e, + 0x0e7e, 0x0d7e, 0x0c7e, 0x2079, 0x0020, 0x2071, 0xaa08, 0x2b68, + 0x6818, 0x2060, 0x7904, 0x7803, 0x0002, 0xa184, 0x0700, 0x00c0, + 0x1e7b, 0x7000, 0x0079, 0x1ec4, 0x1f76, 0x1ec8, 0x1f43, 0x1f74, + 0x8001, 0x7002, 0xd19c, 0x00c0, 0x1edc, 0x8aff, 0x0040, 0x1efb, + 0x2009, 0x0001, 0x1078, 0x1df4, 0x0040, 0x1f76, 0x2009, 0x0001, + 0x1078, 0x1df4, 0x0078, 0x1f76, 0x7803, 0x0004, 0xd194, 0x0040, + 0x1eec, 0x6850, 0xc0fc, 0x6852, 0x8aff, 0x00c0, 0x1ef1, 0x684c, + 0xc0f5, 0x684e, 0x0078, 0x1ef1, 0x1078, 0x203f, 0x6850, 0xc0fd, + 0x6852, 0x2a00, 0x6826, 0x2c00, 0x681a, 0x2800, 0x6832, 0x7003, + 0x0000, 0x0078, 0x1f76, 0x711c, 0x81ff, 0x0040, 0x1f11, 0x7918, + 0x7922, 0x7827, 0x0000, 0x7803, 0x0001, 0x7000, 0x8000, 0x7002, + 0x700c, 0xa100, 0x700e, 0x7010, 0xa081, 0x0000, 0x7012, 0x0078, + 0x1f76, 0x0f7e, 0x027e, 0x781c, 0x007e, 0x7818, 0x007e, 0x2079, + 0x0100, 0x7a14, 0xa284, 0x0004, 0xa085, 0x0012, 0x7816, 0x037e, + 0x2019, 0x1000, 0x8319, 0x1040, 0x1332, 0x7820, 0xd0bc, 0x00c0, + 0x1f22, 0x037f, 0x79c8, 0x007f, 0xa102, 0x017f, 0x007e, 0x017e, + 0x79c4, 0x007f, 0xa103, 0x78c6, 0x007f, 0x78ca, 0xa284, 0x0004, + 0xa085, 0x0012, 0x7816, 0x027f, 0x0f7f, 0x7803, 0x0008, 0x7003, + 0x0000, 0x0078, 0x1f76, 0x8001, 0x7002, 0xd194, 0x0040, 0x1f58, + 0x7804, 0xd0fc, 0x00c0, 0x1eba, 0xd19c, 0x00c0, 0x1f72, 0x8aff, + 0x0040, 0x1f76, 0x2009, 0x0001, 0x1078, 0x1df4, 0x0078, 0x1f76, + 0x027e, 0x037e, 0x6b28, 0x6a2c, 0x1078, 0x203f, 0x0d7e, 0x2804, + 0xac68, 0x6034, 0xd09c, 0x00c0, 0x1f6b, 0x6808, 0xa31a, 0x680c, + 0xa213, 0x0078, 0x1f6f, 0x6810, 0xa31a, 0x6814, 0xa213, 0x0d7f, + 0x0078, 0x1eec, 0x0078, 0x1eec, 0x1078, 0x1332, 0x0c7f, 0x0d7f, + 0x0e7f, 0x0f7f, 0x017f, 0x007f, 0x127f, 0x007c, 0x0f7e, 0x0e7e, + 0x2071, 0xaa08, 0x7000, 0xa086, 0x0000, 0x0040, 0x1fc7, 0x2079, + 0x0020, 0x017e, 0x2009, 0x0207, 0x210c, 0xd194, 0x0040, 0x1fa4, + 0x2009, 0x020c, 0x210c, 0xa184, 0x0003, 0x0040, 0x1fa4, 0x1078, + 0xa5e2, 0x2001, 0x0133, 0x2004, 0xa005, 0x1040, 0x1332, 0x20e1, + 0x9040, 0x2001, 0x020c, 0x2102, 0x2009, 0x0206, 0x2104, 0x2009, + 0x0203, 0x210c, 0xa106, 0x00c0, 0x1faf, 0x20e1, 0x9040, 0x7804, + 0xd0fc, 0x0040, 0x1f8a, 0x1078, 0x1eaa, 0x7000, 0xa086, 0x0000, + 0x00c0, 0x1f8a, 0x017f, 0x7803, 0x0004, 0x7804, 0xd0ac, 0x00c0, + 0x1fbd, 0x20e1, 0x9040, 0x7803, 0x0002, 0x7003, 0x0000, 0x0e7f, + 0x0f7f, 0x007c, 0x027e, 0x0c7e, 0x0d7e, 0x0e7e, 0x0f7e, 0x2071, + 0xaa08, 0x2079, 0x0020, 0x7000, 0xa086, 0x0000, 0x0040, 0x2003, + 0x7004, 0x2060, 0x6010, 0x2068, 0x1078, 0x8d16, 0x0040, 0x1fed, + 0x6850, 0xc0b5, 0x6852, 0x680c, 0x7a1c, 0xa206, 0x00c0, 0x1fed, + 0x6808, 0x7a18, 0xa206, 0x0040, 0x2009, 0x2001, 0x0105, 0x2003, + 0x0010, 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, 0x0000, 0x7004, + 0x2060, 0x1078, 0x8a11, 0x20e1, 0x9040, 0x1078, 0x738a, 0x2011, + 0x0000, 0x1078, 0x70ea, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x027f, + 0x007c, 0x6810, 0x6a14, 0xa205, 0x00c0, 0x1fed, 0x684c, 0xc0dc, + 0x684e, 0x2c10, 0x1078, 0x1cf0, 0x2001, 0x0105, 0x2003, 0x0010, + 0x20e1, 0x9040, 0x7803, 0x0004, 0x7003, 0x0000, 0x2069, 0xa9b1, + 0x6833, 0x0000, 0x683f, 0x0000, 0x0078, 0x2003, 0x8840, 0x2804, + 0xa005, 0x00c0, 0x203a, 0x6004, 0xa005, 0x0040, 0x203c, 0x681a, + 0x2060, 0x6034, 0xa084, 0x000f, 0xa080, 0x206a, 0x2044, 0x88ff, + 0x1040, 0x1332, 0x8a51, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50, + 0x8841, 0x2804, 0xa005, 0x00c0, 0x2059, 0x2c00, 0xad06, 0x0040, + 0x204e, 0x6000, 0xa005, 0x00c0, 0x204e, 0x2d00, 0x2060, 0x681a, + 0x6034, 0xa084, 0x000f, 0xa080, 0x207a, 0x2044, 0x88ff, 0x1040, + 0x1332, 0x007c, 0x0000, 0x0011, 0x0015, 0x0019, 0x001d, 0x0021, + 0x0025, 0x0029, 0x0000, 0x000f, 0x0015, 0x001b, 0x0021, 0x0027, + 0x0000, 0x0000, 0x0000, 0x205f, 0x205b, 0x0000, 0x0000, 0x2069, + 0x0000, 0x205f, 0x0000, 0x2066, 0x2063, 0x0000, 0x0000, 0x0000, + 0x2069, 0x2066, 0x0000, 0x2061, 0x2061, 0x0000, 0x0000, 0x2069, + 0x0000, 0x2061, 0x0000, 0x2067, 0x2067, 0x0000, 0x0000, 0x0000, + 0x2069, 0x2067, 0x0a7e, 0x097e, 0x087e, 0x6b2e, 0x6c2a, 0x6858, + 0xa055, 0x0040, 0x212d, 0x2d60, 0x6034, 0xa0cc, 0x000f, 0xa9c0, + 0x206a, 0xa986, 0x0007, 0x0040, 0x20a5, 0xa986, 0x000e, 0x0040, + 0x20a5, 0xa986, 0x000f, 0x00c0, 0x20a9, 0x605c, 0xa422, 0x6060, + 0xa31b, 0x2804, 0xa045, 0x00c0, 0x20b7, 0x0050, 0x20b1, 0x0078, + 0x212d, 0x6004, 0xa065, 0x0040, 0x212d, 0x0078, 0x2094, 0x2804, + 0xa005, 0x0040, 0x20d5, 0xac68, 0xd99c, 0x00c0, 0x20c5, 0x6808, + 0xa422, 0x680c, 0xa31b, 0x0078, 0x20c9, 0x6810, 0xa422, 0x6814, + 0xa31b, 0x0048, 0x20f4, 0x2300, 0xa405, 0x0040, 0x20db, 0x8a51, + 0x0040, 0x212d, 0x8840, 0x0078, 0x20b7, 0x6004, 0xa065, 0x0040, + 0x212d, 0x0078, 0x2094, 0x8a51, 0x0040, 0x212d, 0x8840, 0x2804, + 0xa005, 0x00c0, 0x20ee, 0x6004, 0xa065, 0x0040, 0x212d, 0x6034, + 0xa0cc, 0x000f, 0xa9c0, 0x206a, 0x2804, 0x2040, 0x2b68, 0x6850, + 0xc0fc, 0x6852, 0x0078, 0x2121, 0x8422, 0x8420, 0x831a, 0xa399, + 0x0000, 0x0d7e, 0x2b68, 0x6c6e, 0x6b72, 0x0d7f, 0xd99c, 0x00c0, + 0x210f, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x1048, + 0x1332, 0x6800, 0xa420, 0x6804, 0xa319, 0x0078, 0x211b, 0x6910, + 0x2400, 0xa122, 0x6914, 0x2300, 0xa11b, 0x1048, 0x1332, 0x6800, + 0xa420, 0x6804, 0xa319, 0x2b68, 0x6c1e, 0x6b22, 0x6850, 0xc0fd, + 0x6852, 0x2c00, 0x681a, 0x2800, 0x6832, 0x2a00, 0x6826, 0x007f, + 0x007f, 0x007f, 0xa006, 0x0078, 0x2132, 0x087f, 0x097f, 0x0a7f, + 0xa085, 0x0001, 0x007c, 0x2001, 0x0005, 0x2004, 0xa084, 0x0007, + 0x0079, 0x213a, 0x2142, 0x2143, 0x2146, 0x2149, 0x214e, 0x2151, + 0x2156, 0x215b, 0x007c, 0x1078, 0x1eaa, 0x007c, 0x1078, 0x1913, + 0x007c, 0x1078, 0x1913, 0x1078, 0x1eaa, 0x007c, 0x1078, 0x14be, + 0x007c, 0x1078, 0x1eaa, 0x1078, 0x14be, 0x007c, 0x1078, 0x1913, + 0x1078, 0x14be, 0x007c, 0x1078, 0x1913, 0x1078, 0x1eaa, 0x1078, + 0x14be, 0x007c, 0x127e, 0x2091, 0x2300, 0x2079, 0x0200, 0x2071, + 0xac80, 0x2069, 0xa700, 0x2009, 0x0004, 0x7912, 0x7817, 0x0004, + 0x1078, 0x251f, 0x781b, 0x0002, 0x20e1, 0x8700, 0x127f, 0x007c, + 0x127e, 0x2091, 0x2300, 0x781c, 0xa084, 0x0007, 0x0079, 0x2180, + 0x21a4, 0x2188, 0x218c, 0x2190, 0x2196, 0x219a, 0x219e, 0x21a2, + 0x1078, 0x548e, 0x0078, 0x21a4, 0x1078, 0x54da, 0x0078, 0x21a4, + 0x1078, 0x548e, 0x1078, 0x54da, 0x0078, 0x21a4, 0x1078, 0x21a6, + 0x0078, 0x21a4, 0x1078, 0x21a6, 0x0078, 0x21a4, 0x1078, 0x21a6, + 0x0078, 0x21a4, 0x1078, 0x21a6, 0x127f, 0x007c, 0x007e, 0x017e, + 0x027e, 0x1078, 0xa5e2, 0x7930, 0xa184, 0x0003, 0x0040, 0x21c9, + 0x2001, 0xa9c0, 0x2004, 0xa005, 0x0040, 0x21c5, 0x2001, 0x0133, + 0x2004, 0xa005, 0x1040, 0x1332, 0x0c7e, 0x2001, 0xa9c0, 0x2064, + 0x1078, 0x8a11, 0x0c7f, 0x0078, 0x21f2, 0x20e1, 0x9040, 0x0078, + 0x21f2, 0xa184, 0x0030, 0x0040, 0x21da, 0x6a00, 0xa286, 0x0003, + 0x00c0, 0x21d4, 0x0078, 0x21d6, 0x1078, 0x4224, 0x20e1, 0x9010, + 0x0078, 0x21f2, 0xa184, 0x00c0, 0x0040, 0x21ec, 0x0e7e, 0x037e, + 0x047e, 0x057e, 0x2071, 0xa9e7, 0x1078, 0x1af4, 0x057f, 0x047f, + 0x037f, 0x0e7f, 0x0078, 0x21f2, 0xa184, 0x0300, 0x0040, 0x21f2, + 0x20e1, 0x9020, 0x7932, 0x027f, 0x017f, 0x007f, 0x007c, 0x017e, + 0x0e7e, 0x0f7e, 0x2071, 0xa700, 0x7128, 0x2001, 0xa990, 0x2102, + 0x2001, 0xa998, 0x2102, 0xa182, 0x0211, 0x00c8, 0x220b, 0x2009, + 0x0008, 0x0078, 0x2235, 0xa182, 0x0259, 0x00c8, 0x2213, 0x2009, + 0x0007, 0x0078, 0x2235, 0xa182, 0x02c1, 0x00c8, 0x221b, 0x2009, + 0x0006, 0x0078, 0x2235, 0xa182, 0x0349, 0x00c8, 0x2223, 0x2009, + 0x0005, 0x0078, 0x2235, 0xa182, 0x0421, 0x00c8, 0x222b, 0x2009, + 0x0004, 0x0078, 0x2235, 0xa182, 0x0581, 0x00c8, 0x2233, 0x2009, + 0x0003, 0x0078, 0x2235, 0x2009, 0x0002, 0x2079, 0x0200, 0x7912, + 0x7817, 0x0004, 0x1078, 0x251f, 0x0f7f, 0x0e7f, 0x017f, 0x007c, + 0x127e, 0x2091, 0x2200, 0x2061, 0x0100, 0x2071, 0xa700, 0x6024, + 0x6026, 0x6053, 0x0030, 0x6033, 0x00ef, 0x60e7, 0x0000, 0x60eb, + 0x00ef, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f, + 0x0080, 0x602f, 0x0000, 0x6007, 0x0eaf, 0x600f, 0x00ff, 0x602b, + 0x002f, 0x127f, 0x007c, 0x2001, 0xa730, 0x2003, 0x0000, 0x2001, + 0xa72f, 0x2003, 0x0001, 0x007c, 0x127e, 0x2091, 0x2200, 0x007e, + 0x017e, 0x027e, 0x6124, 0xa184, 0x002c, 0x00c0, 0x227b, 0xa184, + 0x0007, 0x0079, 0x2281, 0xa195, 0x0004, 0xa284, 0x0007, 0x0079, + 0x2281, 0x22ad, 0x2289, 0x228d, 0x2291, 0x2297, 0x229b, 0x22a1, + 0x22a7, 0x1078, 0x5c56, 0x0078, 0x22ad, 0x1078, 0x5d45, 0x0078, + 0x22ad, 0x1078, 0x5d45, 0x1078, 0x5c56, 0x0078, 0x22ad, 0x1078, + 0x22b2, 0x0078, 0x22ad, 0x1078, 0x5c56, 0x1078, 0x22b2, 0x0078, + 0x22ad, 0x1078, 0x5d45, 0x1078, 0x22b2, 0x0078, 0x22ad, 0x1078, + 0x5d45, 0x1078, 0x5c56, 0x1078, 0x22b2, 0x027f, 0x017f, 0x007f, + 0x127f, 0x007c, 0x6124, 0xd1ac, 0x0040, 0x23ac, 0x017e, 0x047e, + 0x0c7e, 0x644c, 0xa486, 0xf0f0, 0x00c0, 0x22c5, 0x2061, 0x0100, + 0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74c6, 0xa48c, 0xff00, + 0x7034, 0xd084, 0x0040, 0x22dd, 0xa186, 0xf800, 0x00c0, 0x22dd, + 0x703c, 0xd084, 0x00c0, 0x22dd, 0xc085, 0x703e, 0x037e, 0x2418, + 0x2011, 0x8016, 0x1078, 0x361b, 0x037f, 0xa196, 0xff00, 0x0040, + 0x231f, 0x6030, 0xa084, 0x00ff, 0x810f, 0xa116, 0x0040, 0x231f, + 0x7130, 0xd184, 0x00c0, 0x231f, 0x2011, 0xa753, 0x2214, 0xd2ec, + 0x0040, 0x22fa, 0xc18d, 0x7132, 0x2011, 0xa753, 0x2214, 0xd2ac, + 0x00c0, 0x231f, 0x6240, 0xa294, 0x0010, 0x0040, 0x2306, 0x6248, + 0xa294, 0xff00, 0xa296, 0xff00, 0x0040, 0x231f, 0x7030, 0xd08c, + 0x0040, 0x2371, 0x7034, 0xd08c, 0x00c0, 0x2316, 0x2001, 0xa70c, + 0x200c, 0xd1ac, 0x00c0, 0x2371, 0xc1ad, 0x2102, 0x037e, 0x73c4, + 0x2011, 0x8013, 0x1078, 0x361b, 0x037f, 0x0078, 0x2371, 0x7034, + 0xd08c, 0x00c0, 0x232b, 0x2001, 0xa70c, 0x200c, 0xd1ac, 0x00c0, + 0x2371, 0xc1ad, 0x2102, 0x037e, 0x73c4, 0x2011, 0x8013, 0x1078, + 0x361b, 0x037f, 0x7130, 0xc185, 0x7132, 0x2011, 0xa753, 0x220c, + 0xd1a4, 0x0040, 0x2355, 0x017e, 0x2009, 0x0001, 0x2011, 0x0100, + 0x1078, 0x5bf1, 0x2019, 0x000e, 0x1078, 0xa1a5, 0xa484, 0x00ff, + 0xa080, 0x29c0, 0x200c, 0xa18c, 0xff00, 0x810f, 0x8127, 0xa006, + 0x2009, 0x000e, 0x1078, 0xa22d, 0x017f, 0xd1ac, 0x00c0, 0x2362, + 0x017e, 0x2009, 0x0000, 0x2019, 0x0004, 0x1078, 0x284f, 0x017f, + 0x0078, 0x2371, 0x157e, 0x20a9, 0x007f, 0x2009, 0x0000, 0x1078, + 0x45c4, 0x00c0, 0x236d, 0x1078, 0x42f8, 0x8108, 0x00f0, 0x2367, + 0x157f, 0x0c7f, 0x047f, 0x0f7e, 0x2079, 0xa9c4, 0x783c, 0xa086, + 0x0000, 0x0040, 0x2383, 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, + 0x0140, 0x7803, 0x0000, 0x0f7f, 0x2011, 0x0003, 0x1078, 0x70e0, + 0x2011, 0x0002, 0x1078, 0x70ea, 0x1078, 0x6fc4, 0x037e, 0x2019, + 0x0000, 0x1078, 0x7058, 0x037f, 0x60e3, 0x0000, 0x017f, 0x2001, + 0xa700, 0x2014, 0xa296, 0x0004, 0x00c0, 0x23a4, 0xd19c, 0x00c0, + 0x23ac, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0xa722, + 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0040, 0x2490, 0x0f7e, + 0x2079, 0xa9c4, 0x783c, 0xa086, 0x0001, 0x00c0, 0x23d0, 0x017e, + 0x6027, 0x0004, 0x783f, 0x0000, 0x2079, 0x0140, 0x7803, 0x1000, + 0x7803, 0x0000, 0x2079, 0xa9b1, 0x7807, 0x0000, 0x7833, 0x0000, + 0x1078, 0x62d1, 0x1078, 0x639b, 0x017f, 0x0f7f, 0x0078, 0x2490, + 0x0f7f, 0x017e, 0x3900, 0xa082, 0xaae3, 0x00c8, 0x23db, 0x017e, + 0x1078, 0x747a, 0x017f, 0x6220, 0xd2b4, 0x0040, 0x2446, 0x1078, + 0x5acb, 0x1078, 0x6e0f, 0x6027, 0x0004, 0x0f7e, 0x2019, 0xa9ba, + 0x2304, 0xa07d, 0x0040, 0x241c, 0x7804, 0xa086, 0x0032, 0x00c0, + 0x241c, 0x0d7e, 0x0c7e, 0x0e7e, 0x2069, 0x0140, 0x618c, 0x6288, + 0x7818, 0x608e, 0x7808, 0x608a, 0x6043, 0x0002, 0x2001, 0x0003, + 0x8001, 0x00c0, 0x2400, 0x6043, 0x0000, 0x6803, 0x1000, 0x6803, + 0x0000, 0x618e, 0x628a, 0x1078, 0x61cd, 0x1078, 0x62d1, 0x7810, + 0x2070, 0x7037, 0x0103, 0x2f60, 0x1078, 0x772d, 0x0e7f, 0x0c7f, + 0x0d7f, 0x0f7f, 0x017f, 0x007c, 0x0f7f, 0x0d7e, 0x2069, 0x0140, + 0x6804, 0xa084, 0x4000, 0x0040, 0x2429, 0x6803, 0x1000, 0x6803, + 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0xa9b1, 0x6028, 0xa09a, 0x00c8, + 0x00c8, 0x2439, 0x8000, 0x602a, 0x0c7f, 0x1078, 0x6e01, 0x0078, + 0x248f, 0x2019, 0xa9ba, 0x2304, 0xa065, 0x0040, 0x2443, 0x2009, + 0x0027, 0x1078, 0x775c, 0x0c7f, 0x0078, 0x248f, 0xd2bc, 0x0040, + 0x248f, 0x1078, 0x5ad8, 0x6017, 0x0010, 0x6027, 0x0004, 0x0d7e, + 0x2069, 0x0140, 0x6804, 0xa084, 0x4000, 0x0040, 0x245b, 0x6803, + 0x1000, 0x6803, 0x0000, 0x0d7f, 0x0c7e, 0x2061, 0xa9b1, 0x6044, + 0xa09a, 0x00c8, 0x00c8, 0x247e, 0x8000, 0x6046, 0x603c, 0x0c7f, + 0xa005, 0x0040, 0x248f, 0x2009, 0x07d0, 0x1078, 0x5ad0, 0xa080, + 0x0007, 0x2004, 0xa086, 0x0006, 0x00c0, 0x247a, 0x6017, 0x0012, + 0x0078, 0x248f, 0x6017, 0x0016, 0x0078, 0x248f, 0x037e, 0x2019, + 0x0001, 0x1078, 0x7058, 0x037f, 0x2019, 0xa9c0, 0x2304, 0xa065, + 0x0040, 0x248e, 0x2009, 0x004f, 0x1078, 0x775c, 0x0c7f, 0x017f, + 0xd19c, 0x0040, 0x24e4, 0x7034, 0xd0ac, 0x00c0, 0x24c1, 0x017e, + 0x157e, 0x6027, 0x0008, 0x602f, 0x0020, 0x20a9, 0x000a, 0x00f0, + 0x249f, 0x602f, 0x0000, 0x6150, 0xa185, 0x1400, 0x6052, 0x20a9, + 0x0320, 0x00e0, 0x24a9, 0x2091, 0x6000, 0x6020, 0xd09c, 0x00c0, + 0x24b8, 0x157f, 0x6152, 0x017f, 0x6027, 0x0008, 0x0078, 0x24e4, + 0x1078, 0x2577, 0x00f0, 0x24a9, 0x157f, 0x6152, 0x017f, 0x6027, + 0x0008, 0x017e, 0x6028, 0xc09c, 0x602a, 0x2011, 0x0003, 0x1078, + 0x70e0, 0x2011, 0x0002, 0x1078, 0x70ea, 0x1078, 0x6fc4, 0x037e, + 0x2019, 0x0000, 0x1078, 0x7058, 0x037f, 0x60e3, 0x0000, 0x1078, + 0xa5bd, 0x1078, 0xa5db, 0x2001, 0xa700, 0x2003, 0x0004, 0x6027, + 0x0008, 0x1078, 0x1246, 0x017f, 0xa18c, 0xffd0, 0x6126, 0x007c, + 0x007e, 0x017e, 0x027e, 0x0e7e, 0x0f7e, 0x127e, 0x2091, 0x8000, + 0x2071, 0xa700, 0x71bc, 0x70be, 0xa116, 0x0040, 0x2518, 0x81ff, + 0x0040, 0x2500, 0x2011, 0x8011, 0x1078, 0x361b, 0x0078, 0x2518, + 0x2011, 0x8012, 0x1078, 0x361b, 0x2001, 0xa772, 0x2004, 0xd0fc, + 0x00c0, 0x2518, 0x037e, 0x0c7e, 0x1078, 0x6f9f, 0x2061, 0x0100, + 0x2019, 0x0028, 0x2009, 0x0000, 0x1078, 0x284f, 0x0c7f, 0x037f, + 0x127f, 0x0f7f, 0x0e7f, 0x027f, 0x017f, 0x007f, 0x007c, 0x0c7e, + 0x0f7e, 0x007e, 0x027e, 0x2061, 0x0100, 0xa190, 0x253b, 0x2204, + 0x60f2, 0x2011, 0x2548, 0x6000, 0xa082, 0x0003, 0x00c8, 0x2534, + 0x2001, 0x00ff, 0x0078, 0x2535, 0x2204, 0x60ee, 0x027f, 0x007f, + 0x0f7f, 0x0c7f, 0x007c, 0x0840, 0x0840, 0x0840, 0x0580, 0x0420, + 0x0348, 0x02c0, 0x0258, 0x0210, 0x01a8, 0x01a8, 0x01a8, 0x01a8, + 0x0140, 0x00f8, 0x00d0, 0x00b0, 0x00a0, 0x2028, 0xa18c, 0x00ff, + 0x2130, 0xa094, 0xff00, 0x00c0, 0x2558, 0x81ff, 0x0040, 0x255c, + 0x1078, 0x5761, 0x0078, 0x2563, 0xa080, 0x29c0, 0x200c, 0xa18c, + 0xff00, 0x810f, 0xa006, 0x007c, 0xa080, 0x29c0, 0x200c, 0xa18c, + 0x00ff, 0x007c, 0x0c7e, 0x2061, 0xa700, 0x6030, 0x0040, 0x2573, + 0xc09d, 0x0078, 0x2574, 0xc09c, 0x6032, 0x0c7f, 0x007c, 0x007e, + 0x157e, 0x0f7e, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd08c, + 0x00c0, 0x2584, 0x00f0, 0x257e, 0x0f7f, 0x157f, 0x007f, 0x007c, + 0x0c7e, 0x007e, 0x2061, 0x0100, 0x6030, 0x007e, 0x6048, 0x007e, + 0x60e4, 0x007e, 0x60e8, 0x007e, 0x6050, 0x007e, 0x60f0, 0x007e, + 0x60ec, 0x007e, 0x600c, 0x007e, 0x6004, 0x007e, 0x6028, 0x007e, + 0x60e0, 0x007e, 0x602f, 0x0100, 0x602f, 0x0000, 0x0005, 0x0005, + 0x0005, 0x0005, 0x602f, 0x0040, 0x602f, 0x0000, 0x007f, 0x60e2, + 0x007f, 0x602a, 0x007f, 0x6006, 0x007f, 0x600e, 0x007f, 0x60ee, + 0x007f, 0x60f2, 0x007f, 0x6052, 0x007f, 0x60ea, 0x007f, 0x60e6, + 0x007f, 0x604a, 0x007f, 0x6032, 0x007f, 0x0c7f, 0x007c, 0x25e7, + 0x25eb, 0x25ef, 0x25f5, 0x25fb, 0x2601, 0x2607, 0x260f, 0x2617, + 0x261d, 0x2623, 0x262b, 0x2633, 0x263b, 0x2643, 0x264d, 0x2657, + 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, + 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x2657, 0x107e, + 0x007e, 0x0078, 0x2670, 0x107e, 0x007e, 0x0078, 0x2670, 0x107e, + 0x007e, 0x1078, 0x226c, 0x0078, 0x2670, 0x107e, 0x007e, 0x1078, + 0x226c, 0x0078, 0x2670, 0x107e, 0x007e... [truncated message content] |
From: <vl...@us...> - 2006-10-12 14:03:25
|
Revision: 2 http://svn.sourceforge.net/scst/?rev=2&view=rev Author: vlnb Date: 2006-10-12 07:02:57 -0700 (Thu, 12 Oct 2006) Log Message: ----------- Initial doc's commit Added Paths: ----------- trunk/doc/ trunk/doc/Makefile trunk/doc/fig1.png trunk/doc/fig2.png trunk/doc/fig3.png trunk/doc/fig4.png trunk/doc/scst_pg.sgml Added: trunk/doc/Makefile =================================================================== --- trunk/doc/Makefile (rev 0) +++ trunk/doc/Makefile 2006-10-12 14:02:57 UTC (rev 2) @@ -0,0 +1,61 @@ +COMMAND=linuxdoc --backend= + +SOURCE_NAME=scst_pg + +SOURCE=$(SOURCE_NAME).sgml + +default: html txt pdf + +all: html txt pdf tex dvi ps info lyx rtf + +txt: $(SOURCE_NAME).txt + +html: $(SOURCE_NAME).html + +tex: $(SOURCE_NAME).tex + +dvi: $(SOURCE_NAME).dvi + +ps: $(SOURCE_NAME).ps + +pdf: $(SOURCE_NAME).pdf + +info: $(SOURCE_NAME).info + +lyx: $(SOURCE_NAME).lyx + +rtf: $(SOURCE_NAME).rtf + +$(SOURCE_NAME).txt: $(SOURCE) + $(COMMAND)txt $(SOURCE) + +$(SOURCE_NAME).html: $(SOURCE) + $(COMMAND)html --split=0 $(SOURCE) + +$(SOURCE_NAME).tex: $(SOURCE) + $(COMMAND)latex -o tex $(SOURCE) + +$(SOURCE_NAME).dvi: $(SOURCE) + $(COMMAND)latex -o dvi $(SOURCE) + +$(SOURCE_NAME).ps: $(SOURCE) + $(COMMAND)latex -o ps $(SOURCE) + +$(SOURCE_NAME).pdf: $(SOURCE) + $(COMMAND)latex -o pdf $(SOURCE) + +$(SOURCE_NAME).info: $(SOURCE) + $(COMMAND)info $(SOURCE) + +$(SOURCE_NAME).lyx: $(SOURCE) + $(COMMAND)lyx $(SOURCE) + +$(SOURCE_NAME).rtf: $(SOURCE) + $(COMMAND)rtf $(SOURCE) + +clean: + rm -f *.txt *.html *.tex *.dvi *.ps *.pdf *.info *.lyx *.rtf + +extraclean: clean + +.PHONY: all default html txt pdf tex dvi ps info lyx rtf clean extraclean Added: trunk/doc/fig1.png =================================================================== (Binary files differ) Property changes on: trunk/doc/fig1.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/doc/fig2.png =================================================================== (Binary files differ) Property changes on: trunk/doc/fig2.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/doc/fig3.png =================================================================== (Binary files differ) Property changes on: trunk/doc/fig3.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/doc/fig4.png =================================================================== (Binary files differ) Property changes on: trunk/doc/fig4.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/doc/scst_pg.sgml =================================================================== --- trunk/doc/scst_pg.sgml (rev 0) +++ trunk/doc/scst_pg.sgml 2006-10-12 14:02:57 UTC (rev 2) @@ -0,0 +1,2278 @@ +<!doctype linuxdoc system> + +<article> + +<title>Generic SCSI Target Middle Level for Linux</title> + +<author> + <name>Vladislav Bolkhovitin <<tt/vst @at@ vlnb .dot. net/></name> +</author> + +<date>Version 0.9.3-pre4 2006/02/07, actual for SCST 0.9.3-pre4 and later</date> + +<abstract> +This document describes SCSI target mid-level for Linux (SCST), its +architecture and drivers from the driver writer's point of view. +</abstract> + +<toc> + +<sect>Introduction + +<p> +SCST is a SCSI target mid-level subsystem for Linux. It is designed to +provide unified, consistent interface between SCSI target drivers and +Linux kernel and simplify target drivers development as much as +possible. It has the following features: + +<itemize> + +<item> Very low overhead, fine-grained locks and simplest commands +processing path, which allow to reach maximum possible performance and +scalability that close to theoretical limit. + +<item> Incoming requests can be processed in the caller's context or in +one of the internal SCST's tasklets, therefore no extra context switches +required. + +<item> Complete SMP support. + +<item> Undertakes most problems, related to execution contexts, thus +practically eliminating one of the most complicated problem in the +kernel drivers development. For example, a target driver for Qlogic +2200/2300 cards, which has all necessary features, is about 2000 +lines of code long, that is at least in several times less, than the +initiator one. + +<item> Performs all required pre- and post- processing of incoming +requests and all necessary error recovery functionality. + +<item> Emulates necessary functionality of SCSI host adapter, because +from a remote initiator's point of view SCST acts as a SCSI host with +its own devices. Some of the emulated functions are the following: + + <itemize> + + <item> Generation of necessary UNIT ATTENTIONs, their storage and + delivery to all connected remote initiators (sessions). + + <item> RESERVE/RELEASE functionality. + + <item> CA/ACA conditions. + + <item> All types of RESETs and other task management functions. + + <item> REPORT LUNS command as well as SCSI address space management + in order to have consistent address space on all remote initiators, + since local SCSI devices could not know about each other to report + via REPORT LUNS command. Additionally, SCST responds with error on + all commands to non-existing devices and provides access control + (not implemented yet), so different remote initiators could see + different set of devices. + + <item> Other necessary functionality (task attributes, etc.) as + specified in SAM-2, SPC-2, SAM-3, SPC-3 and other SCSI standards. + + </itemize> + +<item> Device handlers architecture provides extra reliability and +security via verifying all incoming requests and allows to make any +additional requests processing, which is completely independent from +target drivers, for example, data caching or device dependent +exceptional conditions treatment. + +</itemize> + +Interoperability between SCST and local SCSI initiators (like sd, st) is +the additional issue that SCST is going to address (it is not +implemented yet). It is necessary, because local SCSI initiators can +change the state of the device, for example RESERVE the device, or some +of its parameters and that would be done behind SCST, which could lead +to various problems. Thus, RESERVE/RELEASE commands, locally generated +UNIT ATTENTIONs, etc. should be intercepted and processed as if local +SCSI initiators act as remote SCSI initiators connected to SCST. This +feature requires some the kernel modification. Since in the current +version it is not implemented, SCST and the target drivers are able to +work with any unpatched 2.4 kernel version. + +Interface between SCST and the target drivers is based on work, done by +University of New Hampshire Interoperability Labs (UNH IOL). + +All described below data structures and function could be found in +<bf/scsi_tgt.h/. The SCST's Internet page is +<url url="http://scst.sourceforge.net">. + +<sect>Terms and Definitions + +<p><bf/SCSI initiator device/ + +A SCSI device that originates service and task management requests to be +processed by a SCSI target device and receives device service and task +management responses from SCSI target devices. + +<bf/SCSI target device/ + +A SCSI device that receives device service and task management requests +for processing and sends device service and task management responses +to SCSI initiator devices or drivers. + +<bf/SCST session/ + +SCST session is the object that describes relationship between a remote +initiator and SCST via a target driver. All the commands from the remote +initiator is passed to SCST in the session. For example, for connection +oriented protocols, like iSCSI, SCST session could be mapped to the TCP +connection. SCST session is the close equivalent of I_T nexus object. + +<bf/Local SCSI initiator/ + +A SCSI initiator that is located on the same host as SCST subsystem. +Examples are sg and st drivers. + +<bf/Remote SCSI initiator/ + +A SCSI initiator that is located on the remote host for SCST subsystem +and makes client connections to SCST via SCSI target drivers. + +<bf/SCSI target driver/ + +A Linux hardware or logical driver that acts as a SCSI target for remote +SCSI initiators, i.e. accepts remote connections, passes incoming SCSI +requests to SCST and sends SCSI responses from SCST back to their +originators. + +<bf/Device handler driver/ + +Also known as "device type specific driver" or "dev handler", is plugin +for SCST, which helps SCST to analyze incoming requests and determine +parameters, specific to various types of devices as well as perform some +processing. See appropriate section for details. + +<sect>SCST Architecture + +<p> +SCST accepts commands and passes them to SCSI mid-level at the same +way as SCSI high-level drivers (sg, sd, st) do. Figure 1 shows +interaction between SCST, its drivers and Linux SCSI subsystem. + +<figure> +<eps file="fig1.png"> +<img src="fig1.png"> +<caption> + <newline> Interaction between SCST, its drivers and Linux SCSI subsystem. +</caption> +</figure> + +<sect>Target driver registration + +<p> +To work with SCST a target driver must register its template in SCST by +calling scst_register_target_template(). The template lets SCST know the +target driver's entry points. It is defined as the following: + +<sect1>Structure scst_tgt_template + +<p> +<verb> +struct scst_tgt_template +{ + int sg_tablesize; + const char name[15]; + + unsigned unchecked_isa_dma:1; + unsigned use_clustering:1; + + unsigned xmit_response_atomic:1; + unsigned rdy_to_xfer_atomic:1; + unsigned report_aen_atomic:1; + + int (* detect) (struct scst_tgt_template *tgt_template); + int (* release)(struct scst_tgt *tgt); + + int (* xmit_response)(struct scst_cmd *cmd); + int (* rdy_to_xfer)(struct scst_cmd *cmd); + + void (*on_free_cmd) (struct scst_cmd *cmd); + + void (* task_mgmt_fn_done)(struct scst_mgmt_cmd *mgmt_cmd); + void (* report_aen)(int mgmt_fn, const uint8_t *lun, int lun_len); + + int (*proc_info) (char *buffer, char **start, off_t offset, + int length, int *eof, struct scst_tgt *tgt, int inout); +} +</verb> + +Where: + +<itemize> + +<item><bf/sg_tablesize/ - allows checking whether scatter/gather can be +used or not and, if yes, sets the maximum supported count of +scatter/gather entries + +<item><bf/name/ - the name of the template. Must be unique to identify +the template. Must be defined. + +<item><bf/unchecked_isa_dma/ - true, if this target adapter uses +unchecked DMA onto an ISA bus. + +<item><bf/use_clustering/ - true, if this target adapter wants to use +clustering (i.e. smaller number of segments). + +<item><bf/xmit_response_atomic/, <bf/rdy_to_xfer_atomic/ - true, if the +corresponding function supports execution in the atomic (non-sleeping) +context. + +<item><bf/int (* detect) (struct scst_tgt_template *tgt_template)/ - this +function is intended to detect the target adapters that are present in +the system. Each found adapter should be registered by calling +<bf/scst_register()/. The function should return a value >= 0 to signify +the number of detected target adapters. A negative value should be +returned whenever there is an error. Must be defined. + +<item><bf/int (* release)(struct scst_tgt *tgt)/ - this function is +intended to free up the resources allocated to the device. The function +should return 0 to indicate successful release or a negative value if +there are some issues with the release. In the current version of SCST +the return value is ignored. Must be defined. + +<item><bf/int (* xmit_response)(struct scst_cmd *cmd)/ - this +function is equivalent to the SCSI queuecommand(). The target should +transmit the response data and the status in the struct scst_cmd. See +below for details. Must be defined. + +<item><bf/int (* rdy_to_xfer)(struct scst_cmd *cmd)/ - this function +informs the driver that data buffer corresponding to the said command +have now been allocated and it is OK to receive data for this command. +This function is necessary because a SCSI target does not have any +control over the commands it receives. Most lower-level protocols have a +corresponding function which informs the initiator that buffers have +been allocated e.g., XFER_RDY in Fibre Channel. After the data is +actually received the low-level driver should call <bf/scst_rx_data()/ +in order to continue processing this command. Returns one of the +<bf/SCST_TGT_RES_*/ constants, described below. Pay attention to +"atomic" attribute of the command, which can be get via +<bf/scst_cmd_atomic()/: it is true if the function called in the atomic +(non-sleeping) context. Must be defined. + +<item><bf/void (*on_free_cmd)(struct scst_cmd *cmd)/ - this function +called to notify the driver that the command is about to be freed. +Necessary, because for aborted commands <bf/xmit_response()/ could not be +called. Could be used on IRQ context. Must be defined. + +<item><bf/void (* task_mgmt_fn_done)(struct scst_mgmt_cmd *mgmt_cmd)/ - +this function informs the driver that a received task management +function has been completed. Completion status could be get via +<bf/scst_mgmt_cmd_get_status()/. No return value expected. Must be +defined, if the target supports task management functionality. + +<item><bf/int (* report_aen)(int mgmt_fn, const uint8_t *lun, int +lun_len)/ - this function is used for Asynchronous Event Notification. +It is the responsibility of the driver to notify any/all initiators +about the Asynchronous Event reported. Returns one of the +<bf/SCST_TGT_RES_*/ constants, described below. Must be defined, if +low-level protocol supports AEN. This feature is not implemented yet. + +<item><bf/int (*proc_info) (char *buffer, char **start, off_t offset, +int length, int *eof, struct scst_tgt *tgt, int inout)/ - this function +can be used to export the driver's statistics and other information to +the world outside the kernel. Parameters: + + <enum> + + <item> <bf/buffer, start, offset, length, eof/ - have the same + meaning as for <bf/read_proc_t/ function of the kernel + + <item> <bf/tgt/ - pointer to the target, for which the function + is called + + <item> <bf/inout/ - read/write direction flag, 0 - for reads, other + value - for writes + + </enum> + +If the driver needs to create additional files in its /proc +subdirectory, it can use <bf/scst_proc_get_tgt_root()/ function to get +the root proc_dir_entry. + +</itemize> + +Functions <bf/xmit_response()/, <bf/rdy_to_xfer()/ are expected to be +non-blocking, i.e. return immediately and don't wait for actual data +transfer to finish. Blocking in such command could negatively impact on +overall system performance. If blocking is necessary, it is worth to +consider creating dedicated thread(s) in target driver, to which the +commands would be passed and which would perform blocking operations +instead of SCST. If the function allowed to sleep or not is defined by +"atomic" attribute of the cmd that can be get via +<bf/scst_cmd_atomic()/, which is true, if sleeping is not allowed. In +this case, if the function requires sleeping, it can return +<bf/SCST_TGT_RES_NEED_THREAD_CTX/ in order to be recalled in the thread +context, where sleeping is allowed. + +Functions <bf/task_mgmt_fn_done()/ and <bf/report_aen()/ are recommended +to be non-blocking as well. Blocking there will stop all management +processing for all target drivers in the system (there is only one +management thread in the system). + +Functions <bf/xmit_response()/, <bf/rdy_to_xfer()/ and <bf/report_aen()/ +can return the following error codes: + +<itemize> + +<item><bf/SCST_TGT_RES_SUCCESS/ - success. + +<item><bf/SCST_TGT_RES_QUEUE_FULL/ - internal device queue is full, retry +again later. + +<item><bf/SCST_TGT_RES_NEED_THREAD_CTX/ - it is impossible to complete +requested task in atomic context. The command should be restarted in the +thread context as described above. + +<item><bf/SCST_TGT_RES_FATAL_ERROR/ - fatal error, i.e. it is unable to +perform requested operation. If returned by <bf/xmit_response()/ the +command will be destroyed, if by <bf/rdy_to_xfer()/, +<bf/xmit_response()/ will be called with <bf/HARDWARE ERROR/ sense data. + +</itemize> + +<sect2>More about <bf/xmit_response()/ + +<p> +As already written above, function <bf/xmit_response()/ should transmit +the response data and the status from the cmd parameter. Either it +should transmit the data or the status is defined by bits of the value, +returned by <bf/scst_cmd_get_tgt_resp_flags()/. They are: + +<itemize> + +<item><bf/SCST_TSC_FLAG_DATA/ - set if there are data to be sent + +<item><bf/SCST_TSC_FLAG_STATUS/ - set if the command is finished and +there is status/sense to be sent + +</itemize> + +If <bf/SCST_TSC_FLAG_DATA/ is set, the data contained in the buffer, +returned by <bf/scst_cmd_get_buffer()/ (pay attention to +<bf/scst_cmd_get_use_sg()/ for scatter/gather) with length, returned by +<bf/scst_cmd_get_resp_data_len()/. It is recommended to use +<bf/scst_get_buf_*()/scst_put_buf()/ family of function instead of +direct access to the data buffers, because they hide all HIGHMEM and +SG/plain buffer issues. + +If <bf/SCST_TSC_FLAG_STATUS/ is set the status could be received by the +appropriate <bf/scst_cmd_get_*_status()/ functions (see below). + +The sense, if any, is contained in the buffer, returned by +<bf/scst_cmd_get_sense_buffer()/, with length, returned by +<bf/scst_cmd_get_sense_buffer_len()/. SCST always works in +<bf/autosense/ mode. If a low-level SCSI driver/device doesn't support +autosense mode, SCST will issue REQUEST SENSE command, if necessary. +Thus, if CHECK CONDITION established, target driver will always see +sense in the sense buffer and isn't required to request the sense +manually. + +It is possible, that <bf/SCST_TSC_FLAG_DATA/ is set, but +<bf/SCST_TSC_FLAG_STATUS/ is not set. In this case the driver should +only transmit the data, but not finish the command and transmit the +status. Function <bf/xmit_response()/ will be called again either to +transmit the status or data once more. + +After the response is completely sent, the target should call +<bf/scst_tgt_cmd_done()/ function in order to allow SCST to free the +command. + +Function <bf/xmit_response()/ returns one of the <bf/SCST_TGT_RES_*/ +constants, described above. Pay attention to "atomic" attribute of the +cmd, which can be get via <bf/scst_cmd_atomic()/: it is true if the +function called in the atomic (non-sleeping) context. + +<sect1>Target driver registration functions + +<sect2>scst_register_target_template() + +<p> +Function <bf/scst_register_target_template()/ is defined as the following: + +<verb> +int scst_register_target_template( + struct scst_tgt_template *vtt) +</verb> + +Where: + +<itemize> +<item><bf/vtt/ - pointer to the target driver template +</itemize> + +Returns 0 on success or appropriate error code otherwise. + +<sect2>scst_register() + +<p> +Function <bf/scst_register()/ is defined as the following: + +<verb> +struct scst_tgt *scst_register( + struct scst_tgt_template *vtt) +</verb> + +Where: + +<itemize> +<item><bf/vtt/ - pointer to the target driver template +</itemize> + +Returns target structure based on template vtt or NULL in case of error. + +<sect>Target driver unregistration + +<p> +In order to unregister itself target driver should at first call +<bf/scst_unregister()/ for all its adapters and then call +<bf/scst_unregister_target_template()/ for its template. + +<sect1>scst_unregister() + +<p> +Function <bf/scst_unregister()/ is defined as the following: + +<verb> +void scst_unregister( + struct scst_tgt *tgt) +</verb> + +Where: + +<itemize> +<item><bf/tgt/ - pointer to the target driver structure +</itemize> + +<sect1>scst_unregister_target_template() + +<p> +Function <bf/scst_unregister_target_template()/ is defined as the following: + +<verb> +void scst_unregister_target_template( + struct scst_tgt_template *vtt) +</verb> + +Where: + +<itemize> +<item><bf/vtt/ - pointer to the target driver template +</itemize> + +<sect>SCST session registration + +<p> +When target driver determines that it needs to create new SCST session +(for example, by receiving new TCP connection), it should call +<bf/scst_register_session()/, that is defined as the following: + +<verb> +struct scst_session *scst_register_session( + struct scst_tgt *tgt, + int atomic, + const char *initiator_name, + void *data, + void (*result_fn) ( + struct scst_session *sess, + void *data, + int result)); +</verb> + +Where: + +<itemize> + +<item><bf/tgt/ - target + +<item><bf/atomic/ - true, if the function called in the atomic context + +<item><bf/initiator_name/ - remote initiator's name, any NULL-terminated +string, e.g. iSCSI name, which used as the key to found appropriate +access control group. Could be NULL, then "default" group is used. The +groups are set up via /proc interface. + +<item><bf/data/ - data that will be used as the second +parameter for <bf/bf/result_fn/()/ function + +<item><bf/result_fn/ - pointer to the function that will be +asynchronously called when session initialization finishes. Can be NULL. +Parameters: + + <itemize> + + <item><bf/sess/ - session + + <item><bf/data/ - target driver supplied to + <bf/scst_register_session()/ data + + <item><bf/result/ - session initialization result, 0 on success or + appropriate error code otherwise + + </itemize> + +</itemize> + +A session creation and initialization is a complex task, which requires +sleeping state, so it can't be fully done in interrupt context. +Therefore the "bottom half" of it, if <bf/scst_register_session()/ is +called from atomic context, will be done in SCST thread context. In this +case <bf/scst_register_session()/ will return not completely initialized +session, but the target driver can supply commands to this session via +<bf/scst_rx_cmd()/. Those commands processing will be delayed inside +SCST until the session initialization is finished, then their processing +will be restarted. The target driver will be notified about finish of +the session initialization by function <bf/result_fn()/. On success the +target driver could do nothing, but if the initialization fails, the +target driver must ensure that no more new commands being sent or will +be sent to SCST after <bf/result_fn()/ returns. All already sent to SCST +commands for failed session will be returned in <bf/xmit_response()/ +with BUSY status. In case of failure the driver shall call +<bf/scst_unregister_session()/ inside <bf/result_fn()/, it will NOT be +called automatically. Thus, <bf/scst_register_session()/ can be called +even on IRQ context. + +Session registration is illustrated on Figure 2 and Figure 3. + +<figure> +<eps file="fig2.png"> +<img src="fig2.png"> +<caption> + <newline> Session registration when <bf/atomic/ parameter is false +</caption> +</figure> + +<figure> +<eps file="fig3.png"> +<img src="fig3.png"> +<caption> + <newline> Session registration when <bf/atomic/ parameter is true +</caption> +</figure> + +<sect>SCST session unregistration + +<p> +SCST session unregistration basically is the same, except that instead of +atomic parameter there is <bf/wait/ one. + +<verb> +void scst_unregister_session( + struct scst_session *sess, + int wait, + void (* unreg_done_fn)( + struct scst_session *sess)) +</verb> + +Where: + +<itemize> + +<item><bf/sess/ - session to be unregistered + +<item><bf/wait/ - if true, instructs to wait until all commands, which +currently executing and belonged to the session, finished. Otherwise, +target driver should be prepared to receive <bf/xmit_response()/ for +the session after <bf/scst_unregister_session()/ returns. + +<item><bf/unreg_done_fn/ - pointer to the function that will be +asynchronously called when the last session's command finishes and the +session is about to be completely freed. Can be NULL. Parameter: + + <itemize> + + <item><bf/sess/ - session + + </itemize> + +</itemize> + +All outstanding commands will be finished regularly. After +<bf/scst_unregister_session()/ returned no new commands must be sent to +SCST via <bf/scst_rx_cmd()/. Also, the caller must ensure that no +<bf/scst_rx_cmd()/ or <bf/scst_rx_mgmt_fn_*()/ is called in paralell +with <bf/scst_unregister_session()/. + +Function <bf/scst_unregister_session()/ can be called before +<bf/result_fn()/ of <bf/scst_register_session()/ called, i.e. during the +session registration/initialization. + +<sect>The commands processing and interaction between SCST and its drivers + +<p> +The commands processing by SCST started when target driver calls +<bf/scst_rx_cmd()/. This function returns SCST's command. Then the target +driver finishes the command's initialization, if necessary, for +example, storing necessary target driver specific data there, and calls +<bf/scst_cmd_init_done()/ telling SCST that it can start the processing. +Then SCST translates the command's LUN to local device, determines the +command's data direction and required data buffer size by calling +appropriate device handler's <bf/parse()/ function. Then: + +<itemize> + +<item>If the command required no data transfer, it will be passed to +SCSI mid-level directly or via device handler's <bf/exec()/ call. + +<item>If the command is <bf/READ/ command (data to the target), +necessary space will be allocated and then the command will be passed +to SCSI mid-level directly or via device handler's <bf/exec()/ call. + +<item>If the command is <bf/WRITE/ command (data from the target), +necessary space will be allocated, then the target's <bf/rdy_to_xfer()/ +function will be called, telling the target that the space is ready and +it can start data transferring. When all the data are read from the +target, it will call <bf/scst_rx_data()/, and the command will be passed +to SCSI mid-level directly or via device handler's <bf/exec()/ call. + +</itemize> + +When the command is finished by SCSI mid-level, device handler's +<bf/dev_done()/ is called to notify it about the command's +completion. Then in order to send the response the target's +<bf/xmit_response()/ is called. When the response, including data, if +any, is transmitted, the target will call <bf/scst_tgt_cmd_done()/ +telling SCST that it can free the command and its data buffer. + +Then during the command's deallocation device handler's and the target's +<bf/on_free_cmd()/ will be called in this order, if set. + +This sequence is illustrated on Figure 4. To simplify the picture, sign +"..." means SCST's waiting state for the corresponding command to +complete. During this state SCST and its drivers continue processing of +other commands, if there are any. One way arrow, for example to +<bf/xmit_response()/, means that after this function returns, nothing +valuable for the current command will be done and SCST goes sleeping or +to the next command processing until corresponding event happens. + +<figure> +<eps file="fig4.png"> +<img src="fig4.png"> +<caption> + <newline> The commands processing flow +</caption> +</figure> + +Additionally, before calling <bf/scst_cmd_init_done()/ the target driver can +set the following the command's flags or parameters: + +<itemize> + +<item> <bf/DATA_BUF_ALLOCED/ - set if the data buffer is already +allocated. The flag is set via <bf/scst_cmd_set_data_buff_alloced()/ and +get via <bf/scst_cmd_get_data_buff_alloced()/. Useful, for instance, for +iSCSI unsolicited data. + +<item> Expected transfer length and direction via +<bf/scst_cmd_set_expected()/ as supplied by remote initiator, if any. +This values will be used only if the command's opcode is unknown for +SCST, for example for vendor-specific commands. If these values not set +and opcode isn't known, the command will be completed by SCST in +preprocessing phase with <bf/INVALID OPCODE/ sense. + +</itemize> + +<sect1>The commands processing functions + +<sect2>scst_rx_cmd() + +<p> +Function <bf/scst_rx_cmd()/ creates and sends new command to SCST. Returns +the command on success or NULL otherwise. It is defined as the +following: + +<verb> +struct scst_cmd *scst_rx_cmd( + struct scst_session *sess, + const uint8_t *lun, + int lun_len, + const uint8_t *cdb, + int cdb_len, + int atomic) +</verb> + +Where: + +<itemize> + +<item><bf/sess/ - SCST's session + +<item><bf/lun/ - pointer to device's LUN as specified in SCSI +Architecture Model 2/3 without any byte order translation. Extended +addressing method is not supported. + +<item><bf/lun_len/ - LUN's length + +<item><bf/cdb/ - SCSI CDB + +<item><bf/cdb_len/ - CDB's length + +<item><bf/atomic/ - if true, the command will be allocated with +GFP_ATOMIC flag, otherwise GFP_KERNEL will be used + +</itemize> + +<sect2>scst_cmd_init_done() + +<p> +Function <bf/scst_cmd_init_done()/ notifies SCST that the driver finished +its part of the command initialization, and the command is ready for +execution. It is defined as the following: + +<verb> +void scst_cmd_init_done( + struct scst_cmd *cmd, + int pref_context) +</verb> + +Where: + +<itemize> + +<item><bf/cmd/ - the command + +<item><bf/pref_context/ - preferred command execution context. See +<bf/SCST_CONTEXT_*/ constants below for details. + +</itemize> + +<sect2>scst_rx_data() + +<p> +Function <bf/scst_rx_data()/ notifies SCST that the driver received all +the necessary data and the command is ready for further processing. It +is defined as the following: + +<verb> +void scst_rx_data( + struct scst_cmd *cmd, + int status, + int pref_context) +</verb> + +Where: + +<itemize> + +<item><bf/cmd/ - the command + +<item><bf/status/ - completion status, see below. + +<item><bf/pref_context/ - preferred command execution context. See +<bf/SCST_CONTEXT_*/ constants below for details. + +</itemize> + +Parameter <bf/status/ can have one of the following values: + +<itemize> + +<item><bf/SCST_RX_STATUS_SUCCESS/ - success + +<item><bf/SCST_RX_STATUS_ERROR/ - data receiving finished with error, so +SCST should set the sense and finish the command by calling +<bf/xmit_response()/ + +<item><bf/SCST_RX_STATUS_ERROR_SENSE_SET/ - data receiving finished with +error and the sense is set, so SCST should finish the command by calling +<bf/xmit_response()/ + +<item><bf/SCST_RX_STATUS_ERROR_FATAL/ - data receiving finished with +fatal error, so SCST should finish the command, but don't call +<bf/xmit_response()/. In this case the driver must free all associated +with the command data before calling <bf/scst_rx_data()/. + +</itemize> + +<sect2>scst_tgt_cmd_done() + +<p> +Function <bf/scst_tgt_cmd_done()/ notifies SCST that the driver sent the +data and/or response. It must not been called if there are an error and +<bf/xmit_response()/ returned something other, than +<bf/SCST_TGT_RES_SUCCESS/. It is defined as the following: + +<verb> +void scst_tgt_cmd_done( + struct scst_cmd *cmd) +</verb> + +Where: +<itemize> +<item><bf/cmd/ - the command +</itemize> + +<sect1>The commands processing context + +<p> +Execution context often is a major problem in the kernel drivers +development, because many contexts, like IRQ one, greatly limit +available functionality, therefore require additional complex code in +order to pass processing to more simple context. SCST does its best to +undertake most of the context handling. + +On the initialization time SCST creates for internal command processing +as many threads as there are processors in the system or specified by +user via <bf/scst_threads/ module parameter. Similarly, as many tasklets +created as there are processors in the system. + +Each command can be processed in one of four contexts: + +<enum> +<item>Directly, i.e. in the caller's context, without limitations +<item>Directly atomically, i.e. with sleeping forbidden +<item>In the SCST's internal per processor or per session thread +<item>In the SCST's per processor tasklet +</enum> + +The target driver sets this context as pref_context parameter for +<bf/scst_cmd_init_done()/ and <bf/scst_rx_data()/. Additionally, target's +template's <bf/xmit_response_atomic/ and <bf/rdy_to_xfer_atomic/ flags +have direct influence on the context. If one of them is false, the +corresponding function will never be called in the atomic context and, +if necessary, the command will be rescheduled to one of the SCST's +threads. + +SCST in some circumstances can change preferred context to less +restrictive one, for example, for large data buffer allocation, if +there is not enough GFP_ATOMIC memory. + +<sect2>Preferred context constants + +<p> +There are the following preferred context constants: + +<itemize> + +<item><bf/SCST_CONTEXT_DIRECT/ - sets direct command processing (i.e. +regular function calls in the current context) sleeping is allowed, no +context restrictions. Supposed to be used when calling from thread +context where no locks are held and the driver's architecture allows +sleeping without performance degradation or anything like that. + +<item><bf/SCST_CONTEXT_DIRECT_ATOMIC/ - sets direct command processing +(i.e. regular function calls in the current context), sleeping is not +allowed. Supposed to be used when calling on thread context where there +are locks held, when calling on softirq context or the driver's +architecture does not allow sleeping without performance degradation or +anything like that. + +<item><bf/SCST_CONTEXT_TASKLET/ - tasklet or thread context required for +the command processing. Supposed to be used when calling from IRQ +context. + +<item><bf/SCST_CONTEXT_THREAD/ - thread context required for the +command processing. Supposed to be used if the driver's architecture +does not allow using any of above. + +</itemize> + +<sect>Task management functions + +<p> +There are the following task management functions supported: + +<itemize> + +<item> <bf/SCST_ABORT_TASK/ - <bf/ABORT_TASK/ task management function, +aborts the specified task (command). Returns completion status via +<bf/task_mgmt_fn_done()/ when the command (task) is actually aborted. + +<item> <bf/SCST_ABORT_TASK_SET/ - <bf/ABORT_TASK_SET/ task management +function, aborts all tasks (commands) on the specified device. Returns +the success via <bf/task_mgmt_fn_done()/ immediately, not waiting for +the commands being actually aborted. + +<item> <bf/SCST_CLEAR_ACA/ - <bf/CLEAR_ACA/ task management function, +currently does nothing. + +<item> <bf/SCST_CLEAR_TASK_SET/ - <bf/CLEAR_TASK_SET/ task management +function, the same as <bf/SCST_ABORT_TASK_SET/. + +<item> <bf/SCST_LUN_RESET/ - <bf/LUN_RESET/ task management function, +implemented via <bf/scsi_reset_provider()/ call for the specified device +with <bf/SCSI_TRY_RESET_DEVICE/ parameter. + +<item> <bf/SCST_TARGET_RESET/ - <bf/TARGET_RESET/ task management +function, implemented via <bf/scsi_reset_provider()/ call for all the +hosts in the system (one device per each host) with +<bf/SCSI_TRY_RESET_BUS/ parameter at first and then, if failed, with +<bf/SCSI_TRY_RESET_HOST/. + +</itemize> + +<sect1>scst_rx_mgmt_fn_tag() + +<p> +Function <bf/scst_rx_mgmt_fn_tag()/ tells SCST to perform the specified +task management function, based on the command's tag. Can be used only +for <bf/SCST_ABORT_TASK/. + +It is defined as the following: + +<verb> +int scst_rx_mgmt_fn_tag( + struct scst_session *sess, + int fn, + uint32_t tag, + int atomic, + void *tgt_specific) +</verb> + +Where: + +<itemize> + +<item> <bf/sess/ - the session, on which the command should be performed. + +<item> <bf/fn/ - task management function, one of the constants above. + +<item> <bf/tag/ - the command's tag. + +<item> <bf/atomic/ - true, if the function called in the atomic context. + +<item> <bf/tgt_specific/ - pointer to the target driver specific data, +can be retrieved in <bf/task_mgmt_fn_done()/ via +<bf/scst_mgmt_cmd_get_status()/ function. + +</itemize> + +Returns 0 if the command was successfully created and scheduled for +execution, error code otherwise. On success, the completion status of +the command will be reported asynchronously via <bf/task_mgmt_fn_done()/ +driver's callback. + +<sect1>scst_rx_mgmt_fn_lun() + +<p> +Function <bf/scst_rx_mgmt_fn_lun()/ tells SCST to perform the specified +task management function, based on the LUN. Currently it can be used for +any function, except <bf/SCST_ABORT_TASK/. + +It is defined as the following: + +<verb> +int scst_rx_mgmt_fn_lun( + struct scst_session *sess, + int fn, + const uint8_t *lun, + int lun_len, + int atomic, + void *tgt_specific); +</verb> + +Where: + +<itemize> + +<item> <bf/sess/ - the session, on which the command should be performed. + +<item> <bf/fn/ - task management function, one of the constants above. + +<item> <bf/lun/ - LUN, the format is the same as for <bf/scst_rx_cmd()/. + +<item> <bf/lun_len/ - LUN's length. + +<item> <bf/atomic/ - true, if the function called in the atomic context. + +<item> <bf/tgt_specific/ - pointer to the target driver specific data, +can be retrieved in <bf/task_mgmt_fn_done()/ via +<bf/scst_mgmt_cmd_get_status()/ function. + +</itemize> + +Returns 0 if the command was successfully created and scheduled for +execution, error code otherwise. On success, the completion status of +the command will be reported asynchronously via <bf/task_mgmt_fn_done()/ +driver's callback. + +<sect>Device specific drivers (device handlers) + +<p> +Device specific drivers are plugins for SCST, which help SCST to analyze +incoming requests and determine parameters, specific to various types +of devices. Device handlers are intended for the following: + +<itemize> + +<item>To get data transfer length and direction directly from CDB and +current device's configuration exactly as an end-target SCSI device +does. This serves two purposes: + + <itemize> + + <item> Improves security and reliability by not trusting the data + supplied by remote initiator via SCSI low-level protocol. + + <item> Some low-level SCSI protocols don't provide data transfer + length and direction, so that information can be get only + directly from CDB and current device's configuration. For + example, for tape devices to get data transfer size it might be + necessary to know block size setting. + + </itemize> + +<item>To process some exceptional conditions, like ILI on tape devices. + +<item>To initialize incoming commands with some device-specific +parameters, like timeout value. + +<item>To allow some additional device-specific commands pre-, post- +processing or alternative execution, like copying data from system +cache, and do that completely independently from target drivers. + +</itemize> + +Device handlers performs very lightweight processing and therefore +should not considerably affect performance or CPU load. They are +considered to be part of SCST, so they could directly access any fields +in SCST's structures as well as use the corresponding functions. + +Without appropriate device handler SCST hides devices of this type from +remote initiators and returns <bf/HARDWARE ERROR/ sense data to any +requests to them. + +<sect1>Device specific driver registration + +<sect2>scst_register_dev_driver() + +<p> +To work with SCST a device specific driver must register itself in SCST by +calling <bf/scst_register_dev_driver()/. It is defined as the following: + +<verb> +int scst_register_dev_driver( + struct scst_dev_type *dev_type) +</verb> + +Where: + +<itemize> +<item><bf/dev_type/ - device specific driver's description structure +</itemize> + +The function returns 0 on success or appropriate error code otherwise. + +<sect2>Structure <bf/scst_dev_type/ + +<p> +Structure <bf/scst_dev_type/ is defined as the following: + +<verb> +struct scst_dev_type +{ + char name[15]; + int type; + + unsigned parse_atomic:1; + unsigned exec_atomic:1; + unsigned dev_done_atomic:1; + + int (*init) (struct scst_dev_type *dev_type); + void (*release) (struct scst_dev_type *dev_type); + + int (*attach) (struct scst_device *dev); + void (*detach) (struct scst_device *dev); + + int (*attach_tgt) (struct scst_tgt_device *tgt_dev); + void (*detach_tgt) (struct scst_tgt_device *tgt_dev); + + int (*parse) (struct scst_cmd *cmd); + int (*exec) (struct scst_cmd *cmd, + void (*scst_cmd_done)(struct scsi_cmnd *cmd, int next_state)); + int (*dev_done) (struct scst_cmd *cmd); + int (*task_mgmt_fn) (struct scst_mgmt_cmd *mgmt_cmd, + struct scst_tgt_dev *tgt_dev, struct scst_cmd *cmd_to_abort); + int (*on_free_cmd) (struct scst_cmd *cmd); + + int (*proc_info) (char *buffer, char **start, off_t offset, + int length, int *eof, struct scst_dev_type *dev_type, + int inout) + + struct module *module; +} +</verb> + +Where: + +<itemize> + +<item><bf/name/ - the name of the device handler. Must be defined and +unique + +<item><bf/type/ - SCSI type of the supported device. Must be defined. + +<item><bf/parse_atomic/, <bf/exec_atomic/, <bf/dev_done_atomic/ - true, +if corresponding function supports execution in the atomic +(non-sleeping) context + +<item><bf/int (*init) (struct scst_dev_type *dev_type)/ - called on the +device handler load, before the first attach(). Returns 0 on success, +error code otherwise. + +<item><bf/void (*release) (struct scst_dev_type *dev_type)/ - called on +the device handler unload, after final detach() + +<item><bf/int (*attach) (struct scst_device *dev)/ - called when new +device is attaching to the device handler + +<item><bf/void (*detach) (struct scst_device *dev)/ - called when new +device is detaching from the device handler + +<item><bf/int (*attach_tgt) (struct scst_tgt_device *tgt_dev)/ - called +when new tgt_device (session) is attaching to the device handler + +<item><bf/void (*detach_tgt) (struct scst_tgt_device *tgt_dev)/ - called +when tgt_device (session) is detaching from the device handler + +<item><bf/int (*parse) (struct scst_cmd *cmd, const struct scst_info_cdb +*cdb_info)/ - called to parse CDB from the command. It should initialize +<bf/cmd->bufflen/ and <bf/cmd->data_direction/ (see below +<bf/SCST_DATA_*/ constants) if necessary, otherwise defaults based on +<bf/cdb_info/ will be used. Parameter <bf/cdb_info/ provides some info +about the CDB (see below). Pay attention to "atomic" attribute of the +cmd, which can be via by <bf/scst_cmd_atomic()/: it is true if the +function called in the atomic (non-sleeping) context. Returns the +command's next state or <bf/SCST_CMD_STATE_DEFAULT/, if the next default +state should be used, or <bf/SCST_CMD_STATE_NEED_THREAD_CTX/ if the +function called in atomic context, but requires sleeping. In the last +case, the function will be recalled in the thread context, where +sleeping is allowed. Additionally, <bf/SCST_CMD_DATA_BUF_ALLOCED/ flag +can be set by <bf/parse()/ (see above). Must be defined. + +<item><bf/int (*exec) (struct scst_cmd *cmd, void (*scst_cmd_done)( struct +scst_cmd *cmd, int next_state))/ - called to execute CDB. The result of +the CDB execution is reported via <bf/scst_cmd_done()/ callback. Pay +attention to "atomic" attribute of the command, which can be get via +<bf/scst_cmd_atomic()/: it is true if the function called in the +atomic (non-sleeping) context. For <bf/scst_cmd_done()/ parameter +<bf/next_state/ is the command's next state or +<bf/SCST_CMD_STATE_DEFAULT/, if the next default state should be used. +Using this function modules <bf/devdisk_perf/ and <bf/devtape_perf/ were +implemented. These modules in their <bf/exec()/ method skip (pretend to +execute) all READ and WRITE operations and thus allow direct link +performance measurements without overhead of actual data transferring +from/to underlying SCSI device. See also <bf/scst_is_cmd_local()/ below. +Returns: + + <itemize> + + <item><bf/SCST_EXEC_COMPLETED/ - the command is done, go to + other ones + + <item><bf/SCST_EXEC_NEED_THREAD/ - thread context is required to + execute the command. <bf/Exec()/ will be called again in the + thread context. + + <item><bf/SCST_EXEC_NOT_COMPLETED/ - the command should be sent + to SCSI mid-level. + + </itemize> + +<item><bf/int (*dev_done) (struct scst_cmd *cmd)/ - called to notify +device handler about the result of the command's execution and perform +some post processing. If <bf/parse()/ function is called, +<bf/dev_done()/ is guaranteed to be called as well. The command's fields +<bf/tgt_resp_flags/ and <bf/resp_data_len/ should be set by this +function, but SCST offers good defaults. Pay attention to "atomic" +attribute of the command, which can be get via +<bf/scst_cmd_atomic()/: it is true if the function called in the +atomic (non-sleeping) context. Returns the command's next state or +<bf/SCST_CMD_STATE_DEFAULT/, if the next default state should be used, +or <bf/SCST_CMD_STATE_NEED_THREAD_CTX/ if the function called in atomic +context, but requires sleeping. In the last case, the function will be +recalled in the thread context, where sleeping is allowed. + +<item><bf/int (*task_mgmt_fn) (struct scst_mgmt_cmd *mgmt_cmd, struct +scst_tgt_dev *tgt_dev, struct scst_cmd *cmd_to_abort)/ - called to +execute a task management command. Returns: + + <itemize> + + <item><bf/SCST_DEV_TM_COMPLETED_SUCCESS/ - the command is done + with success, no firther actions required + + <item><bf/SCST_DEV_TM_COMPLETED_FAILED/ - the command is failed, + no firther actions required + + <item><bf/SCST_DEV_TM_NOT_COMPLETED/ - regular standard actions + for the command should be done + + </itemize> + +<bf/NOTE/: for <bf/SCST_ABORT_TASK/ called under spinlock + +<item><bf/void (*on_free_cmd) (struct scst_cmd *cmd)/ - called to notify +device handler that the command is about to be freed. Could be called on +IRQ context. + +<item><bf/int (*proc_info) (char *buffer, char **start, off_t offset, +int length, int *eof, struct scst_dev_type *dev_type, int inout)/ - this +function can be used to export the handler's statistics and other +information to the world outside the kernel. Parameters: + + <enum> + + <item> <bf/buffer, start, offset, length, eof/ - have the same + meaning as for <bf/read_proc_t/ function of the kernel + + <item> <bf/dev_type/ - pointer to the device handler, for which + the function is called + + <item> <bf/inout/ - read/write direction flag, 0 - for reads, other + value - for writes + + </enum> + +If the driver needs to create additional files in its /proc +subdirectory, it can use <bf/scst_proc_get_dev_type_root()/ function to get +the root proc_dir_entry. + +<item><bf/struct module *module/ - pointer to device handler's module + +</itemize> + +Structure <bf/scst_info_cdb/ is defined as the following: + +<verb> +struct scst_info_cdb +{ + enum scst_cdb_flags flags; + scst_data_direction direction; + unsigned int transfer_len; + unsigned short cdb_len; + const char *op_name; +} +</verb> + +Where: + +<itemize> + +<item><bf/flags/ - CDB's flags can be (OR'ed): + + <itemize> + + <item><bf/SCST_TRANSFER_LEN_TYPE_FIXED/ - set if data length in + CDB set in blocks + + <item><bf/SCST_SMALL_TIMEOUT/ - set if CDB requires small timeout + + <item><bf/SCST_LONG_TIMEOUT/ - set if CDB requires long timeout + + </itemize> + +<item><bf/direction/ - one of the <bf/SCST_DATA_*/ constants (see below) + +<item><bf/transfer_len/ - CDB's data length as set in CDB + +<item><bf/cdb_len/ - CDB's length + +<item><bf/op_name/ - the name of the command + +</itemize> + +Field <bf/cmd->data_direction/, set by <bf/parse()/, can have one of the +following values: + +<itemize> + +<item><bf/SCST_DATA_UNKNOWN/ - data flow direction is unknown + +<item><bf/SCST_DATA_WRITE/ - data flow direction is <bf/WRITE/ (from +target to initiator) + +<item><bf/SCST_DATA_READ/ - data flow direction is <bf/READ/ (from +initiator to target) + +<item><bf/SCST_DATA_NONE/ - there is no data transfer + +</itemize> + +<sect1>Device specific driver unregistration + +<p> +Device specific driver is unregistered by calling +<bf/scst_unregister_dev_driver()/. It is defined as the following: + +<verb> +void scst_unregister_dev_driver( + struct scst_dev_type *dev_type) +</verb> + +Where: + +<itemize> +<item><bf/dev_type/ - device specific driver's description structure +</itemize> + +<sect>SCST commands' states + +<p> +There are the following states, which a SCST command passes through +during execution and which could be returned by device handler's +<bf/parse()/ and <bf/dev_done()/ (but not all states are allowed to be +returned): + +<itemize> + +<item><bf/SCST_CMD_STATE_INIT_WAIT/ - the command is created, but +<bf/scst_cmd_init_done()/ not called + +<item><bf/SCST_CMD_STATE_INIT/ - LUN translation (i.e. <bf/cmd->tgt_dev/ +assignment) state + +<item><bf/SCST_CMD_STATE_REINIT/ - again LUN translation, used if device +handler wants to restart the command on another LUN + +<item><bf/SCST_CMD_STATE_DEV_PARSE/ - device handler's <bf/parse()/ is going +to be called + +<item><bf/SCST_CMD_STATE_PREPARE_SPACE/ - allocation of the command's +data buffer + +<item><bf/SCST_CMD_STATE_RDY_TO_XFER/ - target driver's +<bf/rdy_to_xfer()/ is going to be called + +<item><bf/SCST_CMD_STATE_DATA_WAIT/ - waiting for data from the initiator +(until <bf/scst_rx_data()/ called) + +<item><bf/SCST_CMD_STATE_SEND_TO_MIDLEV/ - the command is going to be +sent to SCSI mid-level for execution + +<item><bf/SCST_CMD_STATE_EXECUTING/ - waiting for the command's execution +finish + +<item><bf/SCST_CMD_STATE_DEV_DONE/ - device handler's <bf/dev_done()/ is +going to be called + +<item><bf/SCST_CMD_STATE_XMIT_RESP/ - target driver's +<bf/xmit_response()/ is going to be called + +<item><bf/SCST_CMD_STATE_XMIT_WAIT/ - waiting for data/response's +transmission finish (until <bf/scst_tgt_cmd_done()/ called) + +<item><bf/SCST_CMD_STATE_FINISHED/ - the command finished and going to be +freed + +</itemize> + +<sect>SCST's structures manipulation functions + +<p> +Target drivers must not directly access any fields in SCST's structures, +they must use only described below functions. + +<sect1>SCST target driver manipulation functions + +<sect2>scst_tgt_get_tgt_specific() and scst_tgt_set_tgt_specific() + +<p> +Function <bf/scst_tgt_get_tgt_specific()/ returns pointer to the target +driver specific data, set by <bf/scst_tgt_set_tgt_specific()/. It is +defined as the following: + +<verb> +void *scst_tgt_get_tgt_specific( + struct scst_tgt *tgt) +</verb> + +Function <bf/scst_tgt_set_tgt_specific()/ stores the target driver +specific data that could be retrieved later by +by<bf/scst_tgt_get_tgt_specific()/. It is defined as the following: + +<verb> +void scst_tgt_set_tgt_specific( + struct scst_tgt *tgt, + void *val) +</verb> + +Where: + +<itemize> +<item><bf/tgt/ - pointer to the SCST target structure +<item><bf/val/ - pointer to the target driver specific data +</itemize> + +<sect1>SCST session manipulation functions + +<sect2>scst_sess_get_tgt_specific() and scst_sess_set_tgt_specific() + +<p> +Function <bf/scst_sess_get_tgt_specific()/ returns pointer to the target +driver specific data, set by <bf/scst_sess_set_tgt_specific()/. It is +defined as the following: + +<verb> +void *scst_sess_get_tgt_specific( + struct scst_session *sess) +</verb> + +Function <bf/scst_sess_set_tgt_specific()/ stores the target driver +specific data that could be retrieved later by +by<bf/scst_sess_get_tgt_specific()/. It is defined as the following: + +<verb> +void scst_sess_set_tgt_specific( + struct scst_session *sess, + void *val) +</verb> + +Where: + +<itemize> +<item><bf/sess/ - pointer to the SCST session structure +<item><bf/val/ - pointer to the target driver specific data +</itemize> + +<sect1>SCST command manipulation functions + +<sect2>scst_cmd_atomic() + +<p> +Function <bf/scst_cmd_atomic()/ returns true if the command is +being executed in the atomic context or false otherwise. It is defined +as the following: + +<verb> +int scst_cmd_atomic( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command to check +</itemize> + +<sect2>scst_cmd_get_session() + +<p> +Function <bf/scst_cmd_get_session()/ returns the command's session. It +is defined as the following: + +<verb> +struct scst_session *scst_cmd_get_session( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_resp_data_len() + +<p> +Function <bf/scst_cmd_get_resp_data_len()/ returns the command's +response data length. It is defined as the following: + +<verb> +unsigned int scst_cmd_get_resp_data_len( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_tgt_resp_flags() + +<p> +Function <bf/scst_cmd_get_tgt_resp_flags()/ returns the command's +response data response flags (SCST_TSC_FLAG_* constants). It is defined +as the following: + +<verb> +int scst_cmd_get_tgt_resp_flags( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_buffer() + +<p> +Function <bf/scst_cmd_get_buffer()/ returns the command's data buffer. +It is defined as the following: + +<verb> +void *scst_cmd_get_buffer( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +It is recommended to use <bf/scst_get_buf_*()/scst_put_buf()/ family of +function instead of direct access to the data buffers, because they hide +all HIGHMEM and SG/plain buffer issues. + +<sect2>scst_cmd_get_bufflen() + +<p> +Function <bf/scst_cmd_get_bufflen()/ returns the command's data buffer +length. It is defined as the following: + +<verb> +unsigned int scst_cmd_get_bufflen( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +It is recommended to use <bf/scst_get_buf_*()/scst_put_buf()/ family of +function instead of direct access to the data buffers, because they hide +all HIGHMEM and SG/plain buffer issues. + +<sect2>scst_cmd_get_use_sg() + +<p> +Function <bf/scst_cmd_get_use_sg()/ returns the command's <bf/use_sg/ +value. Its meaning is the same as for <bf/scsi_cmnd/. The function is +defined as the following: + +<verb> +unsigned short scst_cmd_get_use_sg( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +It is recommended to use <bf/scst_get_buf_*()/scst_put_buf()/ family of +function instead of direct access to the data buffers, because they hide +all HIGHMEM and SG/plain buffer issues. + +<sect2>scst_cmd_get_data_direction() + +<p> +Function <bf/scst_cmd_get_data_direction()/ returns the command's data +direction (SCST_DATA_* constants). It is defined as the following: + +<verb> +scst_data_direction scst_cmd_get_data_direction( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_status() + +<p> +Functions <bf/scst_cmd_get_status()/ returns the status byte from +host device. It is defined as the following: + +<verb> +uint8_t scst_cmd_get_status( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_masked_status() + +<p> +Functions <bf/scst_cmd_get_masked_status()/ returns the status byte set +from host device by status_byte(). It is defined as the following: + +<verb> +uint8_t scst_cmd_get_masked_status( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_msg_status() + +<p> +Functions <bf/scst_cmd_get_msg_status()/ returns the status from host +adapter itself. It is defined as the following: + +<verb> +uint8_t scst_cmd_get_msg_status( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_host_status() + +<p> +Functions <bf/scst_cmd_get_host_status()/ returns the status set by +low-level driver to indicate its status. It is defined as the following: + +<verb> +uint16_t scst_cmd_get_host_status( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_driver_status() + +<p> +Functions <bf/scst_cmd_get_driver_status()/ returns the status set by +SCSI mid-level. It is defined as the following: + +<verb> +uint16_t scst_cmd_get_driver_status( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_sense_buffer() + +<p> +Functions <bf/scst_cmd_get_sense_buffer()/ returns pointer to the sense +buffer. It is defined as the following: + +<verb> +uint8_t *scst_cmd_get_sense_buffer( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_sense_buffer_len() + +<p> +Functions <bf/scst_cmd_get_sense_buffer_len()/ returns the sense buffer +length. It is defined as the following: + +<verb> +int scst_cmd_get_sense_buffer_len( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_get_tag() and scst_cmd_set_tag() + +<p> Function <bf/scst_cmd_get_tag()/ returns the command's tag, set by +<bf/scst_cmd_set_tag()/. It is defined as the following: + +<verb> +uint32_t scst_cmd_get_tag( + struct scst_cmd *cmd) +</verb> + +Function <bf/scst_cmd_set_tag()/ sets command's tag that could be +retrieved later by <bf/scst_cmd_get_tag()/. It is defined as the +following: + +<verb> +void scst_cmd_set_tag( + struct scst_cmd *cmd, + uint32_t tag) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +<item><bf/tag/ - the tag +</itemize> + +<sect2>scst_cmd_get_tgt_specific() and scst_cmd_get_tgt_specific_lock() + +<p> +Functions <bf/scst_cmd_get_tgt_specific()/ and +<bf/scst_cmd_get_tgt_specific_lock()/ return pointer to the target +driver specific data, set by <bf/scst_cmd_set_tgt_specific()/ or +<bf/scst_cmd_set_tgt_specific_lock()/. Both function are basically the +same, but the later one additionally takes lock, which helps to prevent +some races. See <bf/scst_find_cmd()/ below for details. + +They are defined as the following: + +<verb> +void *scst_cmd_get_tgt_specific( + struct scst_cmd *cmd) +</verb> + +<verb> +void *scst_cmd_get_tgt_specific_lock( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_set_tgt_specific() and scst_cmd_set_tgt_specific_lock() + +<p> +Functions <bf/scst_cmd_set_tgt_specific()/ and +<bf/scst_cmd_set_tgt_specific_lock()/ store the target driver specific +data, that could be retrieved later by <bf/scst_cmd_get_tgt_specific()/ +or <bf/scst_cmd_get_tgt_specific_lock()/. Both function are basically +the same, but the later one additionally takes lock, which helps to +prevent some races. See <bf/scst_find_cmd()/ below for details. + +They are defined as the following: + +<verb> +void *scst_cmd_set_tgt_specific( + struct scst_cmd *cmd, + void *val) +</verb> + +<verb> +void *scst_cmd_set_tgt_specific_lock( + struct scst_cmd *cmd, + void *val) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +<item><bf/val/ - pointer to the target driver specific data +</itemize> + +<sect2>scst_cmd_get_data_buff_alloced() and scst_cmd_set_data_buff_alloced() + +<p> +Function <bf/scst_cmd_get_data_buff_alloced()/ returns the state of the +<bf/SCST_CMD_DATA_BUF_ALLOCED/ flag. It is defined as the following: + +<verb> +int scst_cmd_get_data_buff_alloced( + struct scst_cmd *cmd) +</verb> + +Function <bf/scst_cmd_set_data_buff_alloced()/ tells SCST that the data +buffer is alloced by target driver or device handler by setting the +<bf/SCST_CMD_DATA_BUF_ALLOCED/ flag on. Could be useful, for instance, +for iSCSI unsolicited data. It is defined as the following: + +<verb> +void scst_cmd_set_data_buff_alloced( + struct scst_cmd *cmd) +</verb> + +Where: + +<itemize> +<item><bf/cmd/ - pointer to the command +</itemize> + +<sect2>scst_cmd_set_expected(), scst_cmd_is_expected_set(), +scst_cmd_get_expected_data_direction() and +scst_cmd_get_expected_transfer_len() + +<p> +Function <bf/scst_cmd_set_expected()/ tells SCST expected data transfer +direction and its length, as supplied by remote initiator. It is defined +as the following: + +<verb> +void scst_cmd_set_expected( + struct scst_cmd *cmd, + scst_data_direction expected_data_direction, + unsigned int expected_transfer_len) +</verb> + +Function <bf/scst_cmd_is_expected_set()/ returns true, if the expected +values were set by target driver and false ot... [truncated message content] |
From: <vl...@us...> - 2006-10-12 14:19:13
|
Revision: 3 http://svn.sourceforge.net/scst/?rev=3&view=rev Author: vlnb Date: 2006-10-12 07:18:50 -0700 (Thu, 12 Oct 2006) Log Message: ----------- Property svn:ignore set Property Changed: ---------------- / branches/ tags/ trunk/ trunk/doc/ trunk/qla2x00t/ trunk/qla2x00t/qla2x00-target/ trunk/scst/ trunk/scst/include/ trunk/scst/kernel/ trunk/scst/kernel/in-tree/ trunk/scst/src/ trunk/scst/src/dev_handlers/ Property changes on: ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: branches ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: tags ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk/doc ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk/qla2x00t ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk/qla2x00t/qla2x00-target ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk/scst ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk/scst/include ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk/scst/kernel ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk/scst/kernel/in-tree ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk/scst/src ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Property changes on: trunk/scst/src/dev_handlers ___________________________________________________________________ Name: svn:ignore + *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2006-10-12 15:15:55
|
Revision: 5 http://svn.sourceforge.net/scst/?rev=5&view=rev Author: vlnb Date: 2006-10-12 08:15:46 -0700 (Thu, 12 Oct 2006) Log Message: ----------- Initial commit on SCST WWW page Added Paths: ----------- trunk/www/ trunk/www/scst_page.html Added: trunk/www/scst_page.html =================================================================== --- trunk/www/scst_page.html (rev 0) +++ trunk/www/scst_page.html 2006-10-12 15:15:46 UTC (rev 5) @@ -0,0 +1,246 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> + <meta http-equiv="content-type" + content="text/html; charset=ISO-8859-1"> + <title>SCST: Generic SCSI Target Middle Level for Linux</title> + <meta name="Keywords" + content="SCST, Linux, SCSI target, Qlogic, QLA2200, QLA2300, iSCSI, SCSI"> +</head> +<body> +<a href="http://sourceforge.net"> <img + src="http://sourceforge.net/sflogo.php?group_id=110471&type=5" + alt="SourceForge.net Logo" border="0" height="62" width="210"></a> +<h1><small>Generic SCSI Target Middle Level for Linux</small><br> +</h1> +<p style="text-align: justify;">The SCSI target mid-level subsystem for +Linux (SCST) is a new subsystem of the Linux kernel that provides a +standard framework for SCSI target drivers development. It is designed +to +provide unified, consistent interface between SCSI target drivers and +Linux kernel and simplify target drivers development as much as +possible. A system with a SCSI target device is able to share its local +or virtual devices with other systems on a network with SCSI protocol +support, e.g. SCSI bus, Fibre Channel, TCP/IP with iSCSI. This is +commonly used for data storage virtualization.<br> +</p> +<p style="text-align: justify;">SCST has the following features:</p> +<div style="text-align: justify;"> +</div> +<p style="text-align: justify;"> +</p> +<div style="text-align: justify;"> +</div> +<ul style="text-align: justify;"> + <li>Simple, easy to use interface with target drivers. Particularly, +SCST performs all required pre- and post- processing of incoming +requests and all necessary error recovery.</li> + <li>Undertakes most problems, related to execution contexts, thus +practically eliminating one of the most complicated problem in the +kernel drivers development. For example, a target driver for Qlogic +2200/2300 cards, which has all necessary features, is only ~2000 lines +of code long.</li> + <li> Very low overhead, fine-grained locks and simplest commands +processing path, which allow to reach maximum possible performance and +scalability. Particularly, incoming +requests can be processed in the caller's context or in +one of the internal SCST's tasklets, therefore no extra context +switches +required.</li> + <li>Provides advanced per-initiator device visibility management, +which allows different initiators could see different set of devices +with different access permissions. For instance, initiator A could see +exported from +target T devices Da and Db read-writable, and initiator B from the same +target T could see devices Db read-only and Dc read-writable.<br> + </li> + <li> Complete SMP support.<br> + </li> + <li> Emulates necessary functionality of SCSI host adapter, because +from a remote initiator's point of view SCST acts as a SCSI host with +its +own devices. Some of the emulated functions are the following: + <ul> + <li> Generation of necessary UNIT ATTENTIONs, their storage and +delivery to all connected remote initiators (sessions). </li> + <li> RESERVE/RELEASE functionality. </li> + <li> CA/ACA conditions. </li> + <li> All types of RESETs and other task management functions. </li> + <li> REPORT LUNS command as well as SCSI address space management +in order to have consistent address space on all remote initiators, +since local SCSI devices could not know about each other to report +via REPORT LUNS command. Additionally, SCST responds with error on +all commands to non-existing devices and provides access control +(not implemented yet), so different remote initiators could see +different set of devices. </li> + <li> Other necessary functionality (task attributes, etc.) as +specified in SAM-2, SPC-2, SAM-3, SPC-3 and other SCSI standards. </li> + </ul> + </li> + <li> Device handlers (i.e. plugins) architecture provides extra +flexibility by allowing to make any additional +requests processing, which is completely independent from target +drivers and SCST core, like, for instance, device dependent exceptional +conditions treatment, data caching or passing commands in the user +space for device emulation. Example of such plugin is FILEIO device +handler (see below) .<br> + </li> + <li>Well documented.<br> + </li> +</ul> +<div style="text-align: justify;"> +</div> +<p style="text-align: justify;">Interoperability between SCST and local +SCSI initiators (like sd, st) is +the additional issue that SCST is going to address (it is not +implemented yet). It is necessary, because local SCSI initiators can +change the state of the device, for example RESERVE the device, or some +of its parameters and that would be done behind SCST, which could lead +to various problems. Thus, RESERVE/RELEASE commands, locally generated +UNIT ATTENTIONs, etc. should be intercepted and processed as if local +SCSI initiators act as remote SCSI initiators connected to SCST. This +feature requires some the kernel modification. Since in the current +version it is not implemented, SCST and target drivers are +able to work with any 2.4 or 2.6 kernel version.<br> +</p> +<p style="text-align: justify;">Interface between SCST and target +drivers is based on work, done by <a href="http://www.iol.unh.edu/">University +of New Hampshire Interoperability Labs (UNH IOL)</a> for the <a + href="http://www.iol.unh.edu/consortiums/iscsi/index.html">UNH-iSCSI +project</a>, which is currently developed on <a + href="http://unh-iscsi.sourceforge.net/">SourceForge.net</a>.<br> +</p> +<p style="text-align: justify;">The latest stable version is 0.9.4. It +supports SCSI disks (type 0), tapes (type 1), processors (type +3), CDROMs (type 5), MO disks (type 7), medium changers (type 8) and +RAID controllers (type 0xC). Also it supports FILEIO and "performance" +device handlers. FILEIO device handler allows to use files on file +systems or block devices as virtual remotely available SCSI disks or +CDROM's. "Performance" device handlers provide a way for direct +performance measurements without overhead of actual data transferring +from/to underlying SCSI device. Requires Linux kernel 2.6.14 or higher. +Tested on i386 and x86_64 only, +but should also +work on any other +supported by Linux platform. More detail information you could find in +the project README file.<br> +</p> +<p style="text-align: justify;">Starting from version 0.9.4 2.4 Linux +kernels are not supported anymore, although there could be new SCST +releases those kernels with very important bug fixes. The latest stable +version of SCST with 2.4 kernels support is 0.9.3.1-24.</p> +<p style="text-align: justify;">If you have any questions you can ask +them on the SCST SF.net page either using forum, or scst-devel mailing +list.<br> +</p> +<a href="http://sourceforge.net/project/showfiles.php?group_id=110471">Download</a><br> +<a href="http://www.sourceforge.net/projects/scst">SCST SF.net project +page</a><br> +<a href="ChangeLog.scst">Change Log</a><br> +Documentation: <a href="doc/scst_pg.html">HTML</a>, <a + href="doc/scst_pg.pdf">PDF</a><br> +<p>The latest development versions of SCST and its drivers are +available directly from the +project's SVN. You can access it using either <a + href="http://svn.sourceforge.net/scst">web-based SVN +repository viewer</a> or using anonymous access: </p> +<p> <tt> svn co https://svn.sourceforge.net/svnroot/scst<br> +</tt></p> +<p>More information about accessing SVN repository may be found <a + href="http://sourceforge.net/docs/E09">here</a>.<br> +</p> +<p>History of the pre-SVN SCST development is available in SCST CVS +repository, which is accessible using <a + href="http://cvs.sourceforge.net/viewcvs.py/scst">web-based CVS +repository viewer</a> or anonymous CVS access.<br> +</p> +<hr + style="width: 100%; height: 2px; margin-left: 0px; margin-right: 0px;"> +<h1><small>Target driver for Qlogic 2200/2300 cards for 2.6 kernels<br> +</small></h1> +<div style="text-align: justify;"> +<p>This is ported version of the +previous target driver for 2.4 kernels (see below) to the in-tree 2.6 +Qlogic 2x00 initiator +driver. The port was done by Nathaniel Clark. This is stable and +functional driver with +the larger feature set, than the parent driver has.</p> +<p style="text-align: justify;">The latest version is 0.9.3.8. Requires +Linux kernel version 2.6.15.X and SCST version 0.9.4 or higher. +For usage with other kernel versions you will need to port the +initiator patch to that version of the kernel.<br> +</p> +<p style="text-align: justify;">You can find the latest development +version of this driver in the SCST CVS. See above how to setup access +to it.<br> +</p> +<p style="text-align: justify;"><a + href="http://sourceforge.net/project/showfiles.php?group_id=110471">Download</a><br> +<a href="ChangeLog.qla26">Change Log</a><br> +</p> +</div> +<hr style="width: 100%; height: 2px;"> +<h1><small>Target driver for Qlogic 2200/2300 cards<br> +</small></h1> +<div style="text-align: justify;">Target driver for Qlogic 2200/2300 +cards has all required features and +looks to be quite stable. It is designed to work in conjunction with +the initiator +driver, which is intended to perform all the initialization and +shutdown tasks. In the current release as a base for the initiator +driver was taken Red Hat's driver from the stock 2.4.20 kernel. Then it +was patched, basically, to enable the target mode and provide all +necessary callbacks, and it's still able to work as initiator only. +Mode, when a host acts as the initiator and the target simultaneously, +is also supported. This driver is going to be obsolete soon in favor of +2.6-based driver (see above).<br> +<br> +The latest version is 0.9.3.4. Requires Linux kernel versions 2.4.20 or +higher and SCST version 0.9.3-pre4 or higher. If you are lucky, it +works also on 2.6 kernels, see README file +for details. Tested on i386 only, but +should work on any other supported by Linux platform.<br> +<br> +</div> +<a href="http://sourceforge.net/project/showfiles.php?group_id=110471">Download</a><br> +<a href="ChangeLog.qla">Change Log</a> +<p style="text-align: justify;"></p> +<hr style="width: 100%; height: 2px;"> +<span style="font-weight: bold;"></span> +<h1><small>Target drivers for Adaptec 7xxx, LSI/MPT and Qlogic QLA12xx +cards</small></h1> +Target drivers for Adaptec 7xxx, LSI/MPT and Qlogic QLA12xx cards have +being developed by Hu Gang and they available for download from <a + href="http://bj.soulinfo.com/%7Ehugang/scst/tgt/">http://bj.soulinfo.com/~hugang/scst/tgt/</a>. +These drivers are not completed, but looks to be a good starting point +if you are going to use one of these cards. +SCST team don't have the appropriate hardware, therefore have not +tested and don't support these drivers. Send all questions to Hu Gang +<hugang +% soulinfo.com>. If some of these drivers don't compile for you, try +again with SCST version 0.9.3-pre2.<br> +<br> +<a href="http://bj.soulinfo.com/%7Ehugang/scst/tgt/">Download</a><br> +<br> +<hr style="width: 100%; height: 2px;"> +<h1><small>Patches for UNH-iSCSI Target 1.5.03 and 1.6.00 to work over +SCST</small></h1> +SCST is much more advanced, than the internal mid-level of <a + href="http://sourceforge.net/projects/unh-iscsi">UNH-iSCSI target +driver</a>. +With SCST the iSCSI target benefits from all its features and gets +ability to use all its advantages, like high performance and +scalability, SMP support, required SCSI functionality emulation, etc.<br> +<br> +Since the interface between SCST and the target drivers is based on +work, done by UNH IOL, it was relatively simple to update UNH-iSCSI +target to work over SCST. Mostly it was "search and replace" job. The +built-in scsi_target remains available as a compile-time option.<br> +<br> +Requires Linux kernel versions 2.4.20 or +higher or 2.6.7 or higher and SCST version 0.9.2 or higher.<br> +<br> +<a href="http://sourceforge.net/project/showfiles.php?group_id=110471">Download</a><br> +<br> +</body> +</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2006-10-12 15:25:42
|
Revision: 6 http://svn.sourceforge.net/scst/?rev=6&view=rev Author: vlnb Date: 2006-10-12 08:25:28 -0700 (Thu, 12 Oct 2006) Log Message: ----------- - Versions changed from "pre1" on "pre2" - Note added in qla2x00-target/README how to deal with full patched initiator driver Modified Paths: -------------- trunk/qla2x00t/qla2x00-target/README trunk/qla2x00t/qla2x00-target/qla2x00t.h trunk/scst/include/scsi_tgt.h Modified: trunk/qla2x00t/qla2x00-target/README =================================================================== --- trunk/qla2x00t/qla2x00-target/README 2006-10-12 15:15:46 UTC (rev 5) +++ trunk/qla2x00t/qla2x00-target/README 2006-10-12 15:25:28 UTC (rev 6) @@ -1,7 +1,7 @@ Target driver for Qlogic 2200/2300 Fibre Channel cards ====================================================== -Version 0.9.5-pre1, XX XXX 2006 +Version 0.9.5-pre2, XX XXX 2006 ------------------------------- This driver has all required features and looks to be quite stable (for @@ -13,6 +13,11 @@ a host acts as the initiator and the target simultaneously, is supported as well. +If you have a driver's version (e.g. development) without the patch, but +with the full patched initiator source code, you should replace by it +qla2xxx subdirectory in kernel_source/drivers/scsi/ and then rebuild the +kernels or only its modules. + This version is compatible with SCST version 0.9.5 and higher. Tested on stable kernels from http://www.kernel.org Modified: trunk/qla2x00t/qla2x00-target/qla2x00t.h =================================================================== --- trunk/qla2x00t/qla2x00-target/qla2x00t.h 2006-10-12 15:15:46 UTC (rev 5) +++ trunk/qla2x00t/qla2x00-target/qla2x00t.h 2006-10-12 15:25:28 UTC (rev 6) @@ -31,7 +31,7 @@ /* Version numbers, the same as for the kernel */ #define Q2T_VERSION(a,b,c,d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d)) #define Q2T_VERSION_CODE Q2T_VERSION(0,9,5,0) -#define Q2T_VERSION_STRING "0.9.5-pre1" +#define Q2T_VERSION_STRING "0.9.5-pre2" #define Q2T_MAX_CDB_LEN 16 #define Q2T_TIMEOUT 10 /* in seconds */ Modified: trunk/scst/include/scsi_tgt.h =================================================================== --- trunk/scst/include/scsi_tgt.h 2006-10-12 15:15:46 UTC (rev 5) +++ trunk/scst/include/scsi_tgt.h 2006-10-12 15:25:28 UTC (rev 6) @@ -32,7 +32,7 @@ /* Version numbers, the same as for the kernel */ #define SCST_VERSION_CODE 0x000905 #define SCST_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define SCST_VERSION_STRING "0.9.5-pre1" +#define SCST_VERSION_STRING "0.9.5-pre2" /************************************************************* ** States of command processing state machine This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2006-10-26 16:59:08
|
Revision: 17 http://svn.sourceforge.net/scst/?rev=17&view=rev Author: vlnb Date: 2006-10-26 09:58:44 -0700 (Thu, 26 Oct 2006) Log Message: ----------- Property svn:ignore set Property Changed: ---------------- / branches/ tags/ trunk/ trunk/doc/ trunk/qla2x00t/ trunk/qla2x00t/qla2x00-target/ trunk/scst/ trunk/scst/include/ trunk/scst/kernel/ trunk/scst/kernel/in-tree/ trunk/scst/src/ trunk/scst/src/dev_handlers/ trunk/www/ Property changes on: ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: branches ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: tags ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/doc ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/qla2x00t ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/qla2x00t/qla2x00-target ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/scst ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/scst/include ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/scst/kernel ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/scst/kernel/in-tree ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/scst/src ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/scst/src/dev_handlers ___________________________________________________________________ Name: svn:ignore - *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers Property changes on: trunk/www ___________________________________________________________________ Name: svn:ignore + *.o *.mod.c *.ko *.ko.cmd *.o.cmd .tmp_versions Modules.symvers Module.symvers This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2006-10-27 09:45:34
|
Revision: 18 http://svn.sourceforge.net/scst/?rev=18&view=rev Author: vlnb Date: 2006-10-27 02:45:12 -0700 (Fri, 27 Oct 2006) Log Message: ----------- Renamed tgt_dev_specific to dh_priv as well as all *_specific to *_priv Modified Paths: -------------- trunk/qla2x00t/qla2x00-target/qla2x00t.c trunk/scst/include/scsi_tgt.h trunk/scst/src/dev_handlers/scst_cdrom.c trunk/scst/src/dev_handlers/scst_disk.c trunk/scst/src/dev_handlers/scst_fileio.c trunk/scst/src/dev_handlers/scst_modisk.c trunk/scst/src/dev_handlers/scst_tape.c trunk/scst/src/scst.c trunk/scst/src/scst_targ.c Modified: trunk/qla2x00t/qla2x00-target/qla2x00t.c =================================================================== --- trunk/qla2x00t/qla2x00-target/qla2x00t.c 2006-10-26 16:58:44 UTC (rev 17) +++ trunk/qla2x00t/qla2x00-target/qla2x00t.c 2006-10-27 09:45:12 UTC (rev 18) @@ -297,7 +297,7 @@ TRACE_ENTRY(); BUG_ON(scst_sess == NULL); - sess = (struct q2t_sess *)scst_sess_get_tgt_specific(scst_sess); + sess = (struct q2t_sess *)scst_sess_get_tgt_priv(scst_sess); BUG_ON(sess == NULL); tgt = sess->tgt; @@ -387,8 +387,7 @@ static int q2t_target_release(struct scst_tgt *scst_tgt) { int res = 0; - struct q2t_tgt *tgt = - (struct q2t_tgt *)scst_tgt_get_tgt_specific(scst_tgt); + struct q2t_tgt *tgt = (struct q2t_tgt *)scst_tgt_get_tgt_priv(scst_tgt); scsi_qla_host_t *ha = tgt->ha; unsigned long flags = 0; @@ -412,7 +411,7 @@ "sess_count=%d", tgt, list_empty(&tgt->sess_list), atomic_read(&tgt->sess_count)); - scst_tgt_set_tgt_specific(scst_tgt, NULL); + scst_tgt_set_tgt_priv(scst_tgt, NULL); TRACE_MEM("kfree for tgt %p", tgt); kfree(tgt); @@ -698,9 +697,9 @@ TRACE_ENTRY(); TRACE(TRACE_SCSI, "tag=%d", scst_cmd_get_tag(scst_cmd)); - prm.cmd = (struct q2t_cmd *)scst_cmd_get_tgt_specific(scst_cmd); + prm.cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd); sess = (struct q2t_sess *) - scst_sess_get_tgt_specific(scst_cmd_get_session(scst_cmd)); + scst_sess_get_tgt_priv(scst_cmd_get_session(scst_cmd)); if (unlikely(scst_cmd_aborted(scst_cmd))) { scsi_qla_host_t *ha = sess->tgt->ha; @@ -844,9 +843,9 @@ TRACE_ENTRY(); TRACE(TRACE_SCSI, "tag=%d", scst_cmd_get_tag(scst_cmd)); - prm.cmd = (struct q2t_cmd *)scst_cmd_get_tgt_specific(scst_cmd); + prm.cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd); sess = (struct q2t_sess *) - scst_sess_get_tgt_specific(scst_cmd_get_session(scst_cmd)); + scst_sess_get_tgt_priv(scst_cmd_get_session(scst_cmd)); prm.sg = scst_cmd_get_sg(scst_cmd); prm.bufflen = scst_cmd_get_bufflen(scst_cmd); @@ -967,13 +966,12 @@ void q2t_on_free_cmd(struct scst_cmd *scst_cmd) { - struct q2t_cmd *cmd = - (struct q2t_cmd *)scst_cmd_get_tgt_specific(scst_cmd); + struct q2t_cmd *cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd); TRACE_ENTRY(); TRACE(TRACE_SCSI, "END Command tag %d", scst_cmd_get_tag(scst_cmd)); - scst_cmd_set_tgt_specific(scst_cmd, NULL); + scst_cmd_set_tgt_priv(scst_cmd, NULL); q2t_free_cmd(cmd); @@ -1082,7 +1080,7 @@ } else goto out; - cmd = (struct q2t_cmd *)scst_cmd_get_tgt_specific(scst_cmd); + cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd); if (cmd->state == Q2T_STATE_PROCESSED) { TRACE_DBG("Command %p finished", cmd); @@ -1205,7 +1203,7 @@ } scst_cmd_set_tag(cmd->scst_cmd, le16_to_cpu(cmd->atio.exchange_id)); - scst_cmd_set_tgt_specific(cmd->scst_cmd, cmd); + scst_cmd_set_tgt_priv(cmd->scst_cmd, cmd); if (cmd->atio.execution_codes & ATIO_EXEC_READ) dir = SCST_DATA_READ; @@ -1402,7 +1400,7 @@ res = -EFAULT; goto out_free_sess; } - scst_sess_set_tgt_specific(sess->scst_sess, sess); + scst_sess_set_tgt_priv(sess->scst_sess, sess); /* add session data to host data structure */ list_add(&sess->list, &tgt->sess_list); @@ -1591,7 +1589,7 @@ TRACE(TRACE_MGMT, "scst_mcmd (%p) status %#x state %#x", scst_mcmd, scst_mcmd->status, scst_mcmd->state); - mcmd = scst_mgmt_cmd_get_tgt_specific(scst_mcmd); + mcmd = scst_mgmt_cmd_get_tgt_priv(scst_mcmd); if (unlikely(mcmd == NULL)) { PRINT_ERROR("scst_mcmd %p tgt_spec is NULL", mcmd); goto out; @@ -1603,8 +1601,8 @@ ? 0 : FC_TM_FAILED, 1); spin_unlock_irqrestore(&mcmd->sess->tgt->ha->hardware_lock, flags); - /* scst_mgmt_cmd_set_tgt_specific(scst_mcmd, NULL); */ - scst_mcmd->tgt_specific = NULL; + /* scst_mgmt_cmd_set_tgt_priv(scst_mcmd, NULL); */ + scst_mcmd->tgt_priv = NULL; TRACE_MEM("kfree for mcmd %p", mcmd); kfree(mcmd); @@ -2008,7 +2006,7 @@ goto out; } - scst_tgt_set_tgt_specific(tgt->scst_tgt, tgt); + scst_tgt_set_tgt_priv(tgt->scst_tgt, tgt); spin_lock_irqsave(&ha->hardware_lock, flags); ha->tgt = tgt; Modified: trunk/scst/include/scsi_tgt.h =================================================================== --- trunk/scst/include/scsi_tgt.h 2006-10-26 16:58:44 UTC (rev 17) +++ trunk/scst/include/scsi_tgt.h 2006-10-27 09:45:12 UTC (rev 18) @@ -832,8 +832,8 @@ /* Maximum SG table size */ int sg_tablesize; - /* Used for storage of target specific stuff */ - void *tgt_specific; + /* Used for storage of target driver private stuff */ + void *tgt_priv; }; struct scst_session @@ -870,8 +870,8 @@ /* List entry for the sessions list inside ACG */ struct list_head acg_sess_list_entry; - /* Used for storage of target specific stuff */ - void *tgt_specific; + /* Used for storage of target driver private stuff */ + void *tgt_priv; /* * List of cmds in this session. Used to find a cmd in the @@ -1114,11 +1114,11 @@ struct list_head fileio_cmd_list_entry; int fileio_in_list; - /* Used for storage of target specific stuff */ - void *tgt_specific; + /* Used for storage of target driver private stuff */ + void *tgt_priv; - /* Used for storage of dev handler specific stuff */ - void *tgt_dev_specific; + /* Used for storage of dev handler private stuff */ + void *dh_priv; /* * Used to store previous tgt_dev if dev handler returns @@ -1162,8 +1162,8 @@ /* completition status, one of the SCST_MGMT_STATUS_* constants */ int status; - /* Used for storage of target specific stuff */ - void *tgt_specific; + /* Used for storage of target driver private stuff */ + void *tgt_priv; }; struct scst_device @@ -1211,8 +1211,8 @@ /* Corresponding real SCSI device, could be NULL for virtual devices */ struct scsi_device *scsi_dev; - /* Used for storage of dev handler specific stuff */ - void *tgt_dev_specific; + /* Used for storage of dev handler private stuff */ + void *dh_priv; /* Used to wait for requested amount of "on_dev" commands */ wait_queue_head_t on_dev_waitQ; @@ -1262,8 +1262,8 @@ unsigned long tgt_dev_flags; /* tgt_dev's flags */ - /* Used for storage of dev handler specific stuff */ - void *tgt_dev_specific; + /* Used for storage of dev handler private stuff */ + void *dh_priv; /* * Used to execute cmd's in order of arrival. @@ -1553,7 +1553,7 @@ * same sess. Returns 0 for success, error code otherwise. */ int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn, uint32_t tag, - int atomic, void *tgt_specific); + int atomic, void *tgt_priv); /* * Creates new management command using LUN and sends it for execution. @@ -1563,7 +1563,7 @@ */ int scst_rx_mgmt_fn_lun(struct scst_session *sess, int fn, const uint8_t *lun, int lun_len, - int atomic, void *tgt_specific); + int atomic, void *tgt_priv); /* * Provides various CDB info @@ -1649,30 +1649,30 @@ void scst_unregister_virtual_device(int id); /* - * Get/Set functions for tgt's target specific data + * Get/Set functions for tgt's target private data */ -static inline void *scst_tgt_get_tgt_specific(struct scst_tgt *tgt) +static inline void *scst_tgt_get_tgt_priv(struct scst_tgt *tgt) { - return tgt->tgt_specific; + return tgt->tgt_priv; } -static inline void scst_tgt_set_tgt_specific(struct scst_tgt *tgt, void *val) +static inline void scst_tgt_set_tgt_priv(struct scst_tgt *tgt, void *val) { - tgt->tgt_specific = val; + tgt->tgt_priv = val; } /* - * Get/Set functions for session's target specific data + * Get/Set functions for session's target private data */ -static inline void *scst_sess_get_tgt_specific(struct scst_session *sess) +static inline void *scst_sess_get_tgt_priv(struct scst_session *sess) { - return sess->tgt_specific; + return sess->tgt_priv; } -static inline void scst_sess_set_tgt_specific(struct scst_session *sess, +static inline void scst_sess_set_tgt_priv(struct scst_session *sess, void *val) { - sess->tgt_specific = val; + sess->tgt_priv = val; } /* Returns TRUE if cmd is being executed in atomic context */ @@ -1811,23 +1811,23 @@ } /* - * Get/Set functions for cmd's target specific data. + * Get/Set functions for cmd's target private data. * Variant with *_lock must be used if target driver uses * scst_find_cmd() to avoid race with it, except inside scst_find_cmd()'s * callback, where lock is already taken. */ -static inline void *scst_cmd_get_tgt_specific(struct scst_cmd *cmd) +static inline void *scst_cmd_get_tgt_priv(struct scst_cmd *cmd) { - return cmd->tgt_specific; + return cmd->tgt_priv; } -static inline void scst_cmd_set_tgt_specific(struct scst_cmd *cmd, void *val) +static inline void scst_cmd_set_tgt_priv(struct scst_cmd *cmd, void *val) { - cmd->tgt_specific = val; + cmd->tgt_priv = val; } -void *scst_cmd_get_tgt_specific_lock(struct scst_cmd *cmd); -void scst_cmd_set_tgt_specific_lock(struct scst_cmd *cmd, void *val); +void *scst_cmd_get_tgt_priv_lock(struct scst_cmd *cmd); +void scst_cmd_set_tgt_priv_lock(struct scst_cmd *cmd, void *val); /* * Get/Set functions for data_buf_tgt_alloc flag @@ -1897,17 +1897,17 @@ } /* - * Get/Set function for mgmt cmd's target specific data + * Get/Set function for mgmt cmd's target private data */ -static inline void *scst_mgmt_cmd_get_tgt_specific(struct scst_mgmt_cmd *mcmd) +static inline void *scst_mgmt_cmd_get_tgt_priv(struct scst_mgmt_cmd *mcmd) { - return mcmd->tgt_specific; + return mcmd->tgt_priv; } -static inline void scst_mgmt_cmd_set_tgt_specific(struct scst_mgmt_cmd *mcmd, +static inline void scst_mgmt_cmd_set_tgt_priv(struct scst_mgmt_cmd *mcmd, void *val) { - mcmd->tgt_specific = val; + mcmd->tgt_priv = val; } /* Modified: trunk/scst/src/dev_handlers/scst_cdrom.c =================================================================== --- trunk/scst/src/dev_handlers/scst_cdrom.c 2006-10-26 16:58:44 UTC (rev 17) +++ trunk/scst/src/dev_handlers/scst_cdrom.c 2006-10-27 09:45:12 UTC (rev 18) @@ -163,7 +163,7 @@ out_free_cdrom: if (res == 0) - dev->tgt_dev_specific = cdrom; + dev->dh_priv = cdrom; else { TRACE_MEM("kfree for cdrom: %p", cdrom); kfree(cdrom); @@ -185,14 +185,13 @@ ************************************************************/ void cdrom_detach(struct scst_device *dev) { - struct cdrom_params *cdrom = - (struct cdrom_params *)dev->tgt_dev_specific; + struct cdrom_params *cdrom = (struct cdrom_params *)dev->dh_priv; TRACE_ENTRY(); TRACE_MEM("kfree for cdrom: %p", cdrom); kfree(cdrom); - dev->tgt_dev_specific = NULL; + dev->dh_priv = NULL; TRACE_EXIT(); return; @@ -277,7 +276,7 @@ * No need for locks here, since *_detach() can not be * called, when there are existing commands. */ - cdrom = (struct cdrom_params *)cmd->dev->tgt_dev_specific; + cdrom = (struct cdrom_params *)cmd->dev->dh_priv; cmd->bufflen = info_cdb->transfer_len * cdrom->sector_size; } @@ -341,8 +340,7 @@ * No need for locks here, since *_detach() can not be * called, when there are existing commands. */ - cdrom = - (struct cdrom_params *)cmd->dev->tgt_dev_specific; + cdrom = (struct cdrom_params *)cmd->dev->dh_priv; sector_size = ((buffer[4] << 24) | (buffer[5] << 16) | (buffer[6] << 8) | (buffer[7] << 0)); Modified: trunk/scst/src/dev_handlers/scst_disk.c =================================================================== --- trunk/scst/src/dev_handlers/scst_disk.c 2006-10-26 16:58:44 UTC (rev 17) +++ trunk/scst/src/dev_handlers/scst_disk.c 2006-10-27 09:45:12 UTC (rev 18) @@ -236,7 +236,7 @@ out_free_disk: if (res == 0) - dev->tgt_dev_specific = disk; + dev->dh_priv = disk; else { TRACE_MEM("kfree for disk: %p", disk); kfree(disk); @@ -258,13 +258,13 @@ ************************************************************/ void disk_detach(struct scst_device *dev) { - struct disk_params *disk = (struct disk_params *)dev->tgt_dev_specific; + struct disk_params *disk = (struct disk_params *)dev->dh_priv; TRACE_ENTRY(); TRACE_MEM("kfree for disk: %p", disk); kfree(disk); - dev->tgt_dev_specific = NULL; + dev->dh_priv = NULL; TRACE_EXIT(); return; @@ -337,7 +337,7 @@ * No need for locks here, since *_detach() can not be * called, when there are existing commands. */ - disk = (struct disk_params *)cmd->dev->tgt_dev_specific; + disk = (struct disk_params *)cmd->dev->dh_priv; cmd->bufflen = info_cdb->transfer_len * disk->sector_size; } @@ -401,7 +401,7 @@ * No need for locks here, since *_detach() can not be * called, when there are existing commands. */ - disk = (struct disk_params *)cmd->dev->tgt_dev_specific; + disk = (struct disk_params *)cmd->dev->dh_priv; sector_size = ((buffer[4] << 24) | (buffer[5] << 16) | (buffer[6] << 8) | (buffer[7] << 0)); Modified: trunk/scst/src/dev_handlers/scst_fileio.c =================================================================== --- trunk/scst/src/dev_handlers/scst_fileio.c 2006-10-26 16:58:44 UTC (rev 17) +++ trunk/scst/src/dev_handlers/scst_fileio.c 2006-10-27 09:45:12 UTC (rev 18) @@ -341,7 +341,7 @@ virt_dev->name); } - dev->tgt_dev_specific = virt_dev; + dev->dh_priv = virt_dev; out: TRACE_EXIT(); @@ -364,7 +364,7 @@ static void fileio_detach(struct scst_device *dev) { struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)dev->tgt_dev_specific; + (struct scst_fileio_dev *)dev->dh_priv; TRACE_ENTRY(); @@ -374,7 +374,7 @@ virt_dev->name, virt_dev->file_name); /* virt_dev will be freed by the caller */ - dev->tgt_dev_specific = NULL; + dev->dh_priv = NULL; TRACE_EXIT(); return; @@ -388,7 +388,7 @@ loff_t loff; struct scst_device *dev = cmd->dev; struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)dev->tgt_dev_specific; + (struct scst_fileio_dev *)dev->dh_priv; int fua = 0; TRACE_ENTRY(); @@ -481,7 +481,7 @@ int do_fsync = 0; struct scst_fileio_tgt_dev *ftgt_dev = (struct scst_fileio_tgt_dev*) - cmd->tgt_dev->tgt_dev_specific; + cmd->tgt_dev->dh_priv; if ((cmd->queue_type == SCST_CMD_QUEUE_ORDERED) && !virt_dev->wt_flag) { TRACE(TRACE_SCSI/*|TRACE_SPECIAL*/, "ORDERED WRITE: " @@ -508,7 +508,7 @@ int do_fsync = 0; struct scst_fileio_tgt_dev *ftgt_dev = (struct scst_fileio_tgt_dev*) - cmd->tgt_dev->tgt_dev_specific; + cmd->tgt_dev->dh_priv; if ((cmd->queue_type == SCST_CMD_QUEUE_ORDERED) && !virt_dev->wt_flag) { TRACE(TRACE_SCSI/*|TRACE_SPECIAL*/, "ORDERED " @@ -535,7 +535,7 @@ int immed = cmd->cdb[1] & 0x2; struct scst_fileio_tgt_dev *ftgt_dev = (struct scst_fileio_tgt_dev*) - cmd->tgt_dev->tgt_dev_specific; + cmd->tgt_dev->dh_priv; TRACE(TRACE_SCSI, "SYNCHRONIZE_CACHE: " "loff=%Ld, data_len=%Ld, immed=%d", (uint64_t)loff, (uint64_t)data_len, immed); @@ -664,7 +664,7 @@ static int fileio_attach_tgt(struct scst_tgt_dev *tgt_dev) { struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)tgt_dev->acg_dev->dev->tgt_dev_specific; + (struct scst_fileio_dev *)tgt_dev->acg_dev->dev->dh_priv; struct scst_fileio_tgt_dev *ftgt_dev; int res = 0; @@ -710,7 +710,7 @@ res = 0; atomic_inc(&ftgt_dev->threads_count); - tgt_dev->tgt_dev_specific = ftgt_dev; + tgt_dev->dh_priv = ftgt_dev; down(&virt_dev->ftgt_list_mutex); list_add_tail(&ftgt_dev->ftgt_list_entry, @@ -734,9 +734,9 @@ static void fileio_detach_tgt(struct scst_tgt_dev *tgt_dev) { struct scst_fileio_tgt_dev *ftgt_dev = - (struct scst_fileio_tgt_dev *)tgt_dev->tgt_dev_specific; + (struct scst_fileio_tgt_dev *)tgt_dev->dh_priv; struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)tgt_dev->acg_dev->dev->tgt_dev_specific; + (struct scst_fileio_dev *)tgt_dev->acg_dev->dev->dh_priv; TRACE_ENTRY(); @@ -759,7 +759,7 @@ TRACE_MEM("kfree ftgt_dev: %p", ftgt_dev); kfree(ftgt_dev); - tgt_dev->tgt_dev_specific = NULL; + tgt_dev->dh_priv = NULL; TRACE_EXIT(); } @@ -781,7 +781,7 @@ int res = SCST_CMD_STATE_DEFAULT; int fixed; struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + (struct scst_fileio_dev *)cmd->dev->dh_priv; TRACE_ENTRY(); @@ -842,7 +842,7 @@ static inline void fileio_queue_cmd(struct scst_cmd *cmd) { struct scst_fileio_tgt_dev *ftgt_dev = - (struct scst_fileio_tgt_dev *)cmd->tgt_dev->tgt_dev_specific; + (struct scst_fileio_tgt_dev *)cmd->tgt_dev->dh_priv; spin_lock_bh(&ftgt_dev->fdev_lock); TRACE_DBG("Pushing cmd %p to IO thread", cmd); list_add_tail(&cmd->fileio_cmd_list_entry, @@ -963,7 +963,7 @@ int res = SCST_CMD_STATE_DEFAULT; int fixed; struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + (struct scst_fileio_dev *)cmd->dev->dh_priv; TRACE_ENTRY(); @@ -1029,7 +1029,7 @@ int delayed = 0; int opcode = cmd->cdb[0]; struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + (struct scst_fileio_dev *)cmd->dev->dh_priv; TRACE_ENTRY(); @@ -1129,7 +1129,7 @@ uint8_t *address; uint8_t *buf; struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + (struct scst_fileio_dev *)cmd->dev->dh_priv; /* ToDo: Performance Boost: * 1. remove kzalloc, buf @@ -1378,7 +1378,7 @@ goto out; } - virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv; blocksize = virt_dev->block_size; nblocks = virt_dev->nblocks; @@ -1560,7 +1560,7 @@ TRACE_ENTRY(); - virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv; mselect_6 = (MODE_SELECT == cmd->cdb[0]); length = scst_get_buf_first(cmd, &address); @@ -1640,7 +1640,7 @@ TRACE_ENTRY(); - virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv; blocksize = virt_dev->block_size; nblocks = virt_dev->nblocks; @@ -1691,7 +1691,7 @@ TRACE_ENTRY(); - virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv; blocksize = virt_dev->block_size; nblocks = virt_dev->nblocks; @@ -1763,7 +1763,7 @@ goto out; } - virt_dev = (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + virt_dev = (struct scst_fileio_dev *)cmd->dev->dh_priv; /* FIXME when you have > 8TB ROM device. */ nblocks = (uint32_t)virt_dev->nblocks; @@ -1806,7 +1806,7 @@ static void fileio_exec_prevent_allow_medium_removal(struct scst_cmd *cmd) { struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + (struct scst_fileio_dev *)cmd->dev->dh_priv; TRACE_DBG("PERSIST/PREVENT 0x%02x", cmd->cdb[4]); @@ -1889,9 +1889,9 @@ ssize_t length, full_len; uint8_t *address; struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + (struct scst_fileio_dev *)cmd->dev->dh_priv; struct scst_fileio_tgt_dev *ftgt_dev = - (struct scst_fileio_tgt_dev *)cmd->tgt_dev->tgt_dev_specific; + (struct scst_fileio_tgt_dev *)cmd->tgt_dev->dh_priv; struct file *fd = ftgt_dev->fd; struct iovec *iv; int iv_count, i; @@ -1974,9 +1974,9 @@ ssize_t length, full_len; uint8_t *address; struct scst_fileio_dev *virt_dev = - (struct scst_fileio_dev *)cmd->dev->tgt_dev_specific; + (struct scst_fileio_dev *)cmd->dev->dh_priv; struct scst_fileio_tgt_dev *ftgt_dev = - (struct scst_fileio_tgt_dev *)cmd->tgt_dev->tgt_dev_specific; + (struct scst_fileio_tgt_dev *)cmd->tgt_dev->dh_priv; struct file *fd = ftgt_dev->fd; struct iovec *iv, *eiv; int iv_count, eiv_count; @@ -2092,7 +2092,7 @@ uint8_t *address_sav, *address; int compare; struct scst_fileio_tgt_dev *ftgt_dev = - (struct scst_fileio_tgt_dev *)cmd->tgt_dev->tgt_dev_specific; + (struct scst_fileio_tgt_dev *)cmd->tgt_dev->dh_priv; struct file *fd = ftgt_dev->fd; uint8_t *mem_verify = NULL; @@ -2205,8 +2205,7 @@ unsigned long flags; struct scst_cmd *cmd_to_abort = mcmd->cmd_to_abort; struct scst_fileio_tgt_dev *ftgt_dev = - (struct scst_fileio_tgt_dev *)cmd_to_abort->tgt_dev-> - tgt_dev_specific; + (struct scst_fileio_tgt_dev *)cmd_to_abort->tgt_dev->dh_priv; /* * Actually, _bh lock is enough here. But, since we * could be called with IRQ off, the in-kernel debug check Modified: trunk/scst/src/dev_handlers/scst_modisk.c =================================================================== --- trunk/scst/src/dev_handlers/scst_modisk.c 2006-10-26 16:58:44 UTC (rev 17) +++ trunk/scst/src/dev_handlers/scst_modisk.c 2006-10-27 09:45:12 UTC (rev 18) @@ -250,7 +250,7 @@ out_free_modisk: if (res == 0) - dev->tgt_dev_specific = modisk; + dev->dh_priv = modisk; else { TRACE_MEM("kfree for modisk: %p", modisk); kfree(modisk); @@ -272,14 +272,13 @@ ************************************************************/ void modisk_detach(struct scst_device *dev) { - struct modisk_params *modisk = - (struct modisk_params *)dev->tgt_dev_specific; + struct modisk_params *modisk = (struct modisk_params *)dev->dh_priv; TRACE_ENTRY(); TRACE_MEM("kfree for modisk: %p", modisk); kfree(modisk); - dev->tgt_dev_specific = NULL; + dev->dh_priv = NULL; TRACE_EXIT(); return; @@ -364,7 +363,7 @@ * No need for locks here, since *_detach() can not be * called, when there are existing commands. */ - modisk = (struct modisk_params *)cmd->dev->tgt_dev_specific; + modisk = (struct modisk_params *)cmd->dev->dh_priv; cmd->bufflen = info_cdb->transfer_len * modisk->sector_size; } @@ -428,8 +427,7 @@ * No need for locks here, since *_detach() can not be * called, when there are existing commands. */ - modisk = - (struct modisk_params *)cmd->dev->tgt_dev_specific; + modisk = (struct modisk_params *)cmd->dev->dh_priv; sector_size = ((buffer[4] << 24) | (buffer[5] << 16) | (buffer[6] << 8) | (buffer[7] << 0)); Modified: trunk/scst/src/dev_handlers/scst_tape.c =================================================================== --- trunk/scst/src/dev_handlers/scst_tape.c 2006-10-26 16:58:44 UTC (rev 17) +++ trunk/scst/src/dev_handlers/scst_tape.c 2006-10-27 09:45:12 UTC (rev 18) @@ -248,7 +248,7 @@ out_free_req: if (res == 0) - dev->tgt_dev_specific = tape; + dev->dh_priv = tape; else { TRACE_MEM("kfree for tape: %p", tape); kfree(tape); @@ -270,13 +270,13 @@ ************************************************************/ void tape_detach(struct scst_device *dev) { - struct tape_params *tape = (struct tape_params *)dev->tgt_dev_specific; + struct tape_params *tape = (struct tape_params *)dev->dh_priv; TRACE_ENTRY(); TRACE_MEM("kfree for tape: %p", tape); kfree(tape); - dev->tgt_dev_specific = NULL; + dev->dh_priv = NULL; TRACE_EXIT(); return; @@ -337,7 +337,7 @@ * No need for locks here, since *_detach() can not be called, * when there are existing commands. */ - tape = (struct tape_params *)cmd->dev->tgt_dev_specific; + tape = (struct tape_params *)cmd->dev->dh_priv; cmd->bufflen = info_cdb->transfer_len * tape->block_size; } @@ -400,7 +400,7 @@ * can not be called, when there are * existing commands. */ - tape = (struct tape_params *)cmd->dev->tgt_dev_specific; + tape = (struct tape_params *)cmd->dev->dh_priv; spin_lock_bh(&tape->tp_lock); if (buffer[3] == 8) { tape->block_size = (buffer[9] << 16) | @@ -419,7 +419,7 @@ * No need for locks here, since *_detach() can not be * called, when there are existing commands. */ - tape = (struct tape_params *)cmd->dev->tgt_dev_specific; + tape = (struct tape_params *)cmd->dev->dh_priv; spin_lock_bh(&tape->tp_lock); if (buffer[3] == 8) { tape->block_size = @@ -477,7 +477,7 @@ * *_detach() can not be called, when * there are existing commands. */ - tape = (struct tape_params *)cmd->dev->tgt_dev_specific; + tape = (struct tape_params *)cmd->dev->dh_priv; resp_data_len *= tape->block_size; } scst_set_resp_data_len(cmd, resp_data_len); Modified: trunk/scst/src/scst.c =================================================================== --- trunk/scst/src/scst.c 2006-10-26 16:58:44 UTC (rev 17) +++ trunk/scst/src/scst.c 2006-10-27 09:45:12 UTC (rev 18) @@ -1280,8 +1280,8 @@ * Other Commands */ EXPORT_SYMBOL(scst_get_cdb_info); -EXPORT_SYMBOL(scst_cmd_get_tgt_specific_lock); -EXPORT_SYMBOL(scst_cmd_set_tgt_specific_lock); +EXPORT_SYMBOL(scst_cmd_get_tgt_priv_lock); +EXPORT_SYMBOL(scst_cmd_set_tgt_priv_lock); #ifdef DEBUG EXPORT_SYMBOL(scst_random); Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2006-10-26 16:58:44 UTC (rev 17) +++ trunk/scst/src/scst_targ.c 2006-10-27 09:45:12 UTC (rev 18) @@ -3400,7 +3400,7 @@ break; } - mcmd->tgt_specific = NULL; + mcmd->tgt_priv = NULL; TRACE_EXIT(); return; @@ -3535,7 +3535,7 @@ } static struct scst_mgmt_cmd *scst_pre_rx_mgmt_cmd(struct scst_session - *sess, int fn, int atomic, void *tgt_specific) + *sess, int fn, int atomic, void *tgt_priv) { struct scst_mgmt_cmd *mcmd = NULL; @@ -3554,7 +3554,7 @@ mcmd->sess = sess; mcmd->fn = fn; mcmd->state = SCST_MGMT_CMD_STATE_INIT; - mcmd->tgt_specific = tgt_specific; + mcmd->tgt_priv = tgt_priv; out: TRACE_EXIT(); @@ -3623,7 +3623,7 @@ */ int scst_rx_mgmt_fn_lun(struct scst_session *sess, int fn, const uint8_t *lun, int lun_len, int atomic, - void *tgt_specific) + void *tgt_priv) { int res = -EFAULT; struct scst_mgmt_cmd *mcmd = NULL; @@ -3636,7 +3636,7 @@ goto out; } - mcmd = scst_pre_rx_mgmt_cmd(sess, fn, atomic, tgt_specific); + mcmd = scst_pre_rx_mgmt_cmd(sess, fn, atomic, tgt_priv); if (mcmd == NULL) goto out; @@ -3666,7 +3666,7 @@ * same sess */ int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn, uint32_t tag, - int atomic, void *tgt_specific) + int atomic, void *tgt_priv) { int res = -EFAULT; struct scst_mgmt_cmd *mcmd = NULL; @@ -3679,7 +3679,7 @@ goto out; } - mcmd = scst_pre_rx_mgmt_cmd(sess, fn, atomic, tgt_specific); + mcmd = scst_pre_rx_mgmt_cmd(sess, fn, atomic, tgt_priv); if (mcmd == NULL) goto out; @@ -4024,20 +4024,20 @@ return cmd; } -void *scst_cmd_get_tgt_specific_lock(struct scst_cmd *cmd) +void *scst_cmd_get_tgt_priv_lock(struct scst_cmd *cmd) { void *res; unsigned long flags; spin_lock_irqsave(&scst_list_lock, flags); - res = cmd->tgt_specific; + res = cmd->tgt_priv; spin_unlock_irqrestore(&scst_list_lock, flags); return res; } -void scst_cmd_set_tgt_specific_lock(struct scst_cmd *cmd, void *val) +void scst_cmd_set_tgt_priv_lock(struct scst_cmd *cmd, void *val) { unsigned long flags; spin_lock_irqsave(&scst_list_lock, flags); - cmd->tgt_specific = val; + cmd->tgt_priv = val; spin_unlock_irqrestore(&scst_list_lock, flags); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2006-11-10 12:39:31
|
Revision: 31 http://svn.sourceforge.net/scst/?rev=31&view=rev Author: vlnb Date: 2006-11-10 04:39:12 -0800 (Fri, 10 Nov 2006) Log Message: ----------- Documentaion updates Modified Paths: -------------- trunk/qla2x00t/qla2x00-target/README trunk/scst/Makefile trunk/scst/README Modified: trunk/qla2x00t/qla2x00-target/README =================================================================== --- trunk/qla2x00t/qla2x00-target/README 2006-11-09 11:07:14 UTC (rev 30) +++ trunk/qla2x00t/qla2x00-target/README 2006-11-10 12:39:12 UTC (rev 31) @@ -5,19 +5,14 @@ ------------------------------- This driver has all required features and looks to be quite stable (for -beta) and useful. It is designed to work in conjunction with the -initiator driver from Linux kernel version 2.6, which is intended to -perform all the initialization and shutdown tasks. This driver needs to -be patched to enable the target mode and provide all necessary -callbacks, but it's still capable to work as initiator only. Mode, when -a host acts as the initiator and the target simultaneously, is supported -as well. +beta) and useful. It consists from two parts: the target mode driver +itself and the changed initiator driver from Linux kernel, which is, +particularly, intended to perform all the initialization and shutdown +tasks. This driver was changed to provide the target mode support and +all necessary callbacks, but it's still capable to work as initiator +only. Mode, when a host acts as the initiator and the target +simultaneously, is supported as well. -If you have a driver's version (e.g. development) without the patch, but -with the full patched initiator source code, you should replace by it -qla2xxx subdirectory in kernel_source/drivers/scsi/ and then rebuild the -kernel or only its modules. - This version is compatible with SCST version 0.9.5 and higher. Tested on stable kernels from http://www.kernel.org. The original @@ -33,28 +28,24 @@ At first, make sure that the link "/lib/modules/`you_kernel_version`/build" points to the source code for your currently running kernel. -Then, edit Makefile and set SCST_INC_DIR variable to point to the +Then you should replace (or link) by the initiator driver from this +package "qla2xxx" subdirectory in kernel_source/drivers/scsi/ and then +rebuild the kernel and its modules. + +Then edit Makefile and set SCST_INC_DIR variable to point to the directory, where SCST's public include files are located. If you install QLA2x00 target driver's source code in the SCST's directory, then SCST_INC_DIR will be set correctly for you ("../include"). -The driver consists of two parts: the patch for initiator driver -"linux-2.6-qla2xxx-target.patch" and target driver in the -"qla2x00-target" directory. - -Patch the kernel tree with "linux-2.6-qla2xxx-target.patch" patch. - To compile, type 'make'. It will build qla2x00tgt.ko module. To install, type 'make install'. The target driver will be installed in -/lib/modules/`you_kernel_version`/kernel/drivers/scsi/scsi_tgt. +/lib/modules/`you_kernel_version`/extra. To uninstall, type 'make uninstall'. -The initiator driver must be loaded before the target one. - -Then the target mode should be enabled via a sysfs interface on a per -card basis. Under the appropriate scsi_host there is an entry +The target mode should be enabled via a sysfs interface on a per card +basis. Under the appropriate scsi_host there is an entry target_mode_enabled, where you should write "1", like: echo "1" >/sys/class/scsi_host/host0/target_mode_enabled Modified: trunk/scst/Makefile =================================================================== --- trunk/scst/Makefile 2006-11-09 11:07:14 UTC (rev 30) +++ trunk/scst/Makefile 2006-11-10 12:39:12 UTC (rev 31) @@ -43,6 +43,8 @@ @echo " install : install" @echo " uninstall : uninstall" @echo " Notes :" - @echo " - install and uninstall must be made as root" + @echo " - install and uninstall must be made as root." + @echo " - be sure to compile qla against the correct initiator" + @echo " driver. Read its README for details." .PHONY: all install uninstall clean extraclean help Modified: trunk/scst/README =================================================================== --- trunk/scst/README 2006-11-09 11:07:14 UTC (rev 30) +++ trunk/scst/README 2006-11-10 12:39:12 UTC (rev 31) @@ -12,8 +12,8 @@ SCST looks to be quite stable (for beta) and useful. It supports disks (SCSI type 0), tapes (type 1), processor (type 3), CDROM's (type 5), MO -disks (type 7), medium changers (type 8) and RAID controller (type 0xC). -There are also FILEIO and "performance" device handlers. In addition, it +disks (type 7), medium changers (type 8) and RAID controller (type 0xC) +as well as FILEIO and "performance" device handlers. In addition, it supports advanced per-initiator access and devices visibility management, so different initiators could see different set of devices with different access permissions. See below for details. @@ -22,64 +22,25 @@ Tested mostly on "vanilla" 2.6.17.8 kernel from kernel.org. -Device handlers ---------------- - -Device specific drivers (device handlers) are plugins for SCST, which -help SCST to analyze incoming requests and determine parameters, -specific to various types of devices. If an appropriate device handler -for a SCSI device type isn't loaded, SCST doesn't know how to handle -devices of this type, so they will be invisible for remote initiators -(more precisely, "LUN not supported" sense code will be returned). - -In addition to device handlers for real devices, there are FILEIO and -"performance" ones. - -FILEIO device handler works over files on file systems and makes from -them virtual remotely available SCSI disks or CDROM's. In addition, it -allows to work directly over a block device, e.g. local IDE or SCSI disk -or ever disk partition, where there is no file systems overhead. Using -block devices comparing to sending SCSI commands directly to SCSI -mid-level via scsi_do_req() has advantage that data are transfered via -system cache, so it is possible to fully benefit from caching and read -ahead performed by Linux's VM subsystem. The only disadvantage here that -there is superfluous data copying between the cache and SCST's buffers. -This issue is going to be addressed in the next release. Virtual CDROM's -are useful for remote installation. See below for details how to setup -and use FILEIO device handler. - -"Performance" device handlers for disks, MO disks and tapes in their -exec() method skip (pretend to execute) all READ and WRITE operations -and thus provide a way for direct link performance measurements without -overhead of actual data transferring from/to underlying SCSI device. - -NOTE: Since "perf" device handlers on READ operations don't touch the -==== commands' data buffer, it is returned to remote initiators as it - was allocated, without even being zeroed. Thus, "perf" device - handlers impose some security risk, so use them with caution. - Installation ------------ At first, make sure that the link "/lib/modules/`you_kernel_version`/build" points to the source code for your currently running kernel. -Then, if you are going to work on 2.6 kernels, since in those kernels -scsi_do_req() works in LIFO order, instead of expected and required -FIFO, SCST needs a new function scsi_do_req_fifo() to be added in the -kernel. Patch 26_scst.patch (or 26_scst-2.6.14-.patch for early kernels) -from "kernel" directory does that. If it doesn't apply to your kernel -version, apply it manually, it only adds that function and nothing more. -You may not patch the kernel if STRICT_SERIALIZING is defined during the -compilation (see its description below). +Then, since in the mainstream kernels scsi_do_req()/scsi_execute_async() +work in LIFO order, instead of expected and required FIFO, SCST needs a +new functions scsi_do_req_fifo()/scsi_execute_async_fifo() to be added +in the kernel. Patch 26_scst-2.6.X.patch from "kernel" directory does +that. If it doesn't apply to your kernel, apply it manually, it only +adds one of those functions and nothing more. You may not patch the +kernel if STRICT_SERIALIZING or FILEIO_ONLY are defined during the +compilation (see their description below). -To compile SCST go to 'src' directory and type 'make' on 2.6 kernels and -'make -f Makefile-24' on 2.4 ones. It will build SCST itself and its -device handlers. To install them type 'make install'. The driver modules -will be installed in -'/lib/modules/`you_kernel_version`/kernel/drivers/scsi/scsi_tgt' on 2.4 -kernels and in '/lib/modules/`you_kernel_version`/extra' on 2.6 ones. In -addition, scsi_tgt.h, scst_debug.h and scst_debug.c will be copied to +To compile SCST type 'make'. It will build SCST itself and its device +handlers. To install them type 'make install'. The driver modules will +be installed in '/lib/modules/`you_kernel_version`/extra'. In addition, +scsi_tgt.h, scst_debug.h and scst_debug.c will be copied to '/usr/local/include/scst'. The first file contains all SCST's public data definition, which are used by target drivers. The other ones support debug messages logging. @@ -115,19 +76,53 @@ important for execution via sg and st commands that change the state of devices and their parameters, because that could lead to data corruption. If any such command is done, at - least related device handler driver(s) must be restarted. For - block devices READ/WRITE commands using direct disk handler - look to be safe. + least related device handler(s) must be restarted. For block + devices READ/WRITE commands using direct disk handler look to + be safe. -To uninstall, type 'make uninstall'. It is not implemented for 2.6 -kernels. +To uninstall, type 'make uninstall'. If you install QLA2x00 target driver's source code in this directory, then you can build, install or uninstall it by typing 'make qla', 'make -qla_install' or 'make qla_uninstall' correspondingly. Or 'make qla26', -'make qla26_install' or 'make qla26_uninstall' for new 2.6 driver. For -more details about QLA2x00 target drivers see their README files. +qla_install' or 'make qla_uninstall' correspondingly. For more details +about QLA2x00 target drivers see their README files. +Device handlers +--------------- + +Device specific drivers (device handlers) are plugins for SCST, which +help SCST to analyze incoming requests and determine parameters, +specific to various types of devices. If an appropriate device handler +for a SCSI device type isn't loaded, SCST doesn't know how to handle +devices of this type, so they will be invisible for remote initiators +(more precisely, "LUN not supported" sense code will be returned). + +In addition to device handlers for real devices, there are FILEIO and +"performance" ones. + +FILEIO device handler works over files on file systems and makes from +them virtual remotely available SCSI disks or CDROM's. In addition, it +allows to work directly over a block device, e.g. local IDE or SCSI disk +or ever disk partition, where there is no file systems overhead. Using +block devices comparing to sending SCSI commands directly to SCSI +mid-level via scsi_do_req()/scsi_execute_async() has advantage that data +are transfered via system cache, so it is possible to fully benefit from +caching and read ahead performed by Linux's VM subsystem. The only +disadvantage here that there is superfluous data copying between the +cache and SCST's buffers. This issue is going to be addressed in the +next release. Virtual CDROM's are useful for remote installation. See +below for details how to setup and use FILEIO device handler. + +"Performance" device handlers for disks, MO disks and tapes in their +exec() method skip (pretend to execute) all READ and WRITE operations +and thus provide a way for direct link performance measurements without +overhead of actual data transferring from/to underlying SCSI device. + +NOTE: Since "perf" device handlers on READ operations don't touch the +==== commands' data buffer, it is returned to remote initiators as it + was allocated, without even being zeroed. Thus, "perf" device + handlers impose some security risk, so use them with caution. + Compilation options ------------------- @@ -175,7 +170,7 @@ SCST_HIGHMEM isn't required for HIGHMEM systems and SCST will work fine on them with SCST_HIGHMEM off. Untested. - - SCST_STRICT_SECURITY - if defined, makes SCST zero allocated data + - SCST_STRICT_SECURITY - if defined, makes SCST clean allocated data buffers. Undefining it (default) considerably improves performance and eases CPU load, but could create a security hole (information leakage), so enable it, if you have strict security requirements. @@ -209,6 +204,13 @@ on device with host:channel:id:lun - "sessions" file, which lists currently connected initiators (open sessions) + + - "sgv" file provides some statistic about with which block sizes + commands from remote initiators come and how effective sgv_pool in + serving those allocations from the cache, i.e. without memory + allocations requests to the kernel. "Size" - is the commands data + size upper rounded to power of 2, "Hit" - how many there are + allocations from the cache, "Total" - total number of allocations. - "threads" file, which allows to read and set number of SCST's threads @@ -303,10 +305,11 @@ information of currently open device files. On write it supports the following command: - * "open NAME PATH [BLOCK_SIZE] [FLAGS]" - opens file "PATH" as + * "open NAME [PATH] [BLOCK_SIZE] [FLAGS]" - opens file "PATH" as device "NAME" with block size "BLOCK_SIZE" bytes with flags - "FLAGS". The block size must be power of 2 and >= 512 bytes - Default is 512. Possible flags: + "FLAGS". "PATH" could be empty only for FILEIO CDROM. "BLOCK_SIZE" + and "FLAGS" are valid only for disk FILEIO. The block size must be + power of 2 and >= 512 bytes Default is 512. Possible flags: - WRITE_THROUGH - write back caching disabled @@ -337,6 +340,8 @@ * "close NAME" - closes device "NAME". + * "change NAME [PATH]" - changes a virtual CD in the FILEIO CDROM. + For example, "echo "open disk1 /vdisks/disk1" >/proc/scsi_tgt/disk_fileio/disk_fileio" will open file /vdisks/disk1 as virtual FILEIO disk with name "disk1". @@ -359,19 +364,20 @@ correspondingly. Note, that usually it turned off by default and the status of barriers usage isn't reported anywhere in the system logs as well as there is no way to know it on the - mounted file system (at least we don't know how). Also note + mounted file system (at least no known one). Also note that on some real-life workloads write through caching might - perform better, than write back one with barrier protection + perform better, than write back one with the barrier protection turned on. IMPORTANT: Many disk and partition table mananagement utilities don't support ========= block sizes >512 bytes, therefore make sure that your favorite one supports it. Also, if you export disk file or device with - another block size, than one, with which it was already - divided on partitions, you could get various weird things - like utilities hang up or other unexpected behaviour. Thus, to - be sure, zero the exported file or device before the first - access to it from the remote initiator with another block size. + some block size, different from one, with which it was + already divided on partitions, you could get various weird + things like utilities hang up or other unexpected behaviour. + Hence, to be sure, zero the exported file or device before the + first access to it from the remote initiator with another + block size. Performance ----------- @@ -379,10 +385,9 @@ Before doing any performance measurements note that: I. Maximum performance is possible only with real SCSI devices or -performance handlers. FILEIO handler isn't optimized for performance -yet, although, if you have enough CPU power, it could provide very -acceptable results, when aggregate throughput is close to aggregate -throuput locally on the target on the same disks. +performance handlers. If you have enough CPU power, FILEIO handler could +provide the same results, when aggregate throughput is close to +aggregate throuput locally on the target on the same disks. II. In order to get the maximum performance you should: @@ -411,7 +416,7 @@ for locally attached disks, therefore they are not optimal if they attached remotly (our case), which sometimes could lead to unexpectedly low throughput. You should increase read-ahead size - (/sys/block/device/queue/read_ahead_kb) for at least 256Kb or even + (/sys/block/device/queue/read_ahead_kb) to at least 256Kb or even more on all initiators and the target. Also experiment with other parameters in /sys/block/device directory, they also affect the performance. If you find the best values, please share them with us. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2006-12-01 19:01:37
|
Revision: 38 http://svn.sourceforge.net/scst/?rev=38&view=rev Author: vlnb Date: 2006-12-01 11:01:35 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Release 0.9.5 of both SCST and Qlogic target driver Modified Paths: -------------- trunk/doc/scst_pg.sgml trunk/qla2x00t/qla2x00-target/ChangeLog trunk/qla2x00t/qla2x00-target/Makefile trunk/qla2x00t/qla2x00-target/README trunk/qla2x00t/qla2x00-target/qla2x00t.h trunk/scst/ChangeLog trunk/scst/README trunk/scst/include/scsi_tgt.h trunk/scst/src/Makefile trunk/scst/src/dev_handlers/Makefile trunk/www/scst_page.html Modified: trunk/doc/scst_pg.sgml =================================================================== --- trunk/doc/scst_pg.sgml 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/doc/scst_pg.sgml 2006-12-01 19:01:35 UTC (rev 38) @@ -8,7 +8,7 @@ <name>Vladislav Bolkhovitin <<tt/vst @at@ vlnb .dot. net/></name> </author> -<date>Version 0.9.3-pre4 2006/02/07, actual for SCST 0.9.3-pre4 and later</date> +<date>Version 0.9.5 2006/12/01, actual for SCST 0.9.5 and later</date> <abstract> This document describes SCSI target mid-level for Linux (SCST), its @@ -122,7 +122,8 @@ initiator and SCST via a target driver. All the commands from the remote initiator is passed to SCST in the session. For example, for connection oriented protocols, like iSCSI, SCST session could be mapped to the TCP -connection. SCST session is the close equivalent of I_T nexus object. +connection (as well as iSCSI session). SCST session is the close +equivalent of I_T nexus object. <bf/Local SCSI initiator/ Modified: trunk/qla2x00t/qla2x00-target/ChangeLog =================================================================== --- trunk/qla2x00t/qla2x00-target/ChangeLog 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/qla2x00t/qla2x00-target/ChangeLog 2006-12-01 19:01:35 UTC (rev 38) @@ -42,11 +42,10 @@ - Include MEMSET, MEMCPY definitions - - Patched to compile on 64bit cleanly (thanks to Ming Zhang <mi...@el...> -for patch) + - Patched to compile on 64bit cleanly (thanks to Ming Zhang for patch) - Fixed possible race during initial enabling of Target Mode (thanks to -Mark Buechler <mar...@gm...> for finding) +Mark Buechler for finding) Summary of changes between versions 0.9.3.4 and 0.9.3.5 ------------------------------------------------------- @@ -61,8 +60,7 @@ - Added Module Info - Fixed module counting with initiator module preventing it from going -away w/out telling us (pointed out by Vladislav Bolkhovitin -<vs...@vl...>) +away w/out telling us (pointed out by Vladislav Bolkhovitin) - Some minor debugging changes @@ -70,7 +68,7 @@ --------------------------------------------------------------------- - Support for the latest in-tree Qlogic initiator added by Nathaniel -Clark <na...@mi...> +Clark - Only one module is build and it interacts with a patched kernel qla2xxx driver. The single module is called qla2x00tgt.ko instead of Modified: trunk/qla2x00t/qla2x00-target/Makefile =================================================================== --- trunk/qla2x00t/qla2x00-target/Makefile 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/qla2x00t/qla2x00-target/Makefile 2006-12-01 19:01:35 UTC (rev 38) @@ -26,16 +26,17 @@ # - install and uninstall must be made as root # -#SCST_INC_DIR := /usr/local/include/scst -SCST_INC_DIR := $(SUBDIRS)/../../scst/include -SCST_DIR := $(shell pwd)/../../scst/src +SCST_INC_DIR := /usr/local/include/scst +#SCST_INC_DIR := $(SUBDIRS)/../../scst/include +#SCST_DIR := $(shell pwd)/../../scst/src +SCST_DIR := $(shell pwd)/../../scst-0.9.5/src EXTRA_CFLAGS += -I$(SCST_INC_DIR) -DFC_TARGET_SUPPORT INSTALL_DIR := /lib/modules/$(shell uname -r)/extra EXTRA_CFLAGS += -DEXTRACHECKS -#EXTRA_CFLAGS += -DTRACING -EXTRA_CFLAGS += -DDEBUG_TGT +EXTRA_CFLAGS += -DTRACING +#EXTRA_CFLAGS += -DDEBUG_TGT #EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD ifeq ($(KVER),) Modified: trunk/qla2x00t/qla2x00-target/README =================================================================== --- trunk/qla2x00t/qla2x00-target/README 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/qla2x00t/qla2x00-target/README 2006-12-01 19:01:35 UTC (rev 38) @@ -1,8 +1,8 @@ Target driver for Qlogic 2200/2300 Fibre Channel cards ====================================================== -Version 0.9.5-pre2, XX XXX 2006 -------------------------------- +Version 0.9.5, 01 Dec 2006 +-------------------------- This driver has all required features and looks to be quite stable (for beta) and useful. It consists from two parts: the target mode driver @@ -29,24 +29,34 @@ points to the source code for your currently running kernel. Then you should replace (or link) by the initiator driver from this -package "qla2xxx" subdirectory in kernel_source/drivers/scsi/ and then -rebuild the kernel and its modules. +package "qla2xxx" subdirectory in kernel_source/drivers/scsi/ of the +currently running kernel and using your favorite kernel configuration +tool enable in the QLogic QLA2XXX Fibre Channel driver target mode +support (CONFIG_SCSI_QLA2XXX_TARGET). Then rebuild the kernel and its +modules. During this step you will compile the initiator driver. To +install it, install the built kernel and its modules. -Then edit Makefile and set SCST_INC_DIR variable to point to the -directory, where SCST's public include files are located. If you install -QLA2x00 target driver's source code in the SCST's directory, then -SCST_INC_DIR will be set correctly for you ("../include"). +Then edit qla2x00-target/Makefile and set SCST_INC_DIR variable to point +to the directory, where SCST's public include files are located. If you +install QLA2x00 target driver's source code in the SCST's directory, +then SCST_INC_DIR will be set correctly for you. -To compile, type 'make'. It will build qla2x00tgt.ko module. +Also you can set SCST_DIR variable to the directory, where SCST was +built, but this is optional. If you don't set it or set incorrectly, +during the compilation you will get a bunch of harmless warnings like +"WARNING: "scst_rx_data" [/XXX/qla2x00tgt.ko] undefined!" -To install, type 'make install'. The target driver will be installed in -/lib/modules/`you_kernel_version`/extra. +To compile the target driver, type 'make' in qla2x00-target/ +subdirectory. It will build qla2x00tgt.ko module. -To uninstall, type 'make uninstall'. +To install the target driver, type 'make install' in qla2x00-target/ +subdirectory. The target driver will be installed in +/lib/modules/`you_kernel_version`/extra. To uninstall it, type 'make +uninstall'. -The target mode should be enabled via a sysfs interface on a per card -basis. Under the appropriate scsi_host there is an entry -target_mode_enabled, where you should write "1", like: +After the drivers are loaded, the target mode should be enabled via a +sysfs interface on a per card basis. Under the appropriate scsi_host +there is an entry target_mode_enabled, where you should write "1", like: echo "1" >/sys/class/scsi_host/host0/target_mode_enabled Modified: trunk/qla2x00t/qla2x00-target/qla2x00t.h =================================================================== --- trunk/qla2x00t/qla2x00-target/qla2x00t.h 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/qla2x00t/qla2x00-target/qla2x00t.h 2006-12-01 19:01:35 UTC (rev 38) @@ -31,7 +31,7 @@ /* Version numbers, the same as for the kernel */ #define Q2T_VERSION(a,b,c,d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d)) #define Q2T_VERSION_CODE Q2T_VERSION(0,9,5,0) -#define Q2T_VERSION_STRING "0.9.5-pre2" +#define Q2T_VERSION_STRING "0.9.5" #define Q2T_MAX_CDB_LEN 16 #define Q2T_TIMEOUT 10 /* in seconds */ Modified: trunk/scst/ChangeLog =================================================================== --- trunk/scst/ChangeLog 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/scst/ChangeLog 2006-12-01 19:01:35 UTC (rev 38) @@ -41,8 +41,7 @@ - Function alloc_data_buf() added to struct scst_tgt_template as well as data_buf_tgt_alloc added to struct scst_cmd to allow a target - driver implement own memory management handler (by Arne Redlich - <arn...@xi...>). + driver implement own memory management handler (by Arne Redlich). - Exported symbols are now not GPL'ed @@ -57,8 +56,7 @@ - Fixed BUG() on task aborts. - - Fixed WCE (Write Cache Enabled) handling in FILEIO - (by Ming Zhang <mi...@el...>) + - Fixed WCE (Write Cache Enabled) handling in FILEIO (by Ming Zhang) - Minor cleanups and bug fixes. @@ -71,10 +69,9 @@ - Fixed "deadlock" on sessions creation. - - Fixed support for > 2TB storage device in FILEIO handler - (by Ming Zhang <mi...@el...>) + - Fixed support for > 2TB storage device in FILEIO handler (by Ming Zhang) - - NULLIO added to FILEIO handler (by Ming Zhang <mi...@el...>) + - NULLIO added to FILEIO handler (by Ming Zhang) - Commands serialization now per-(session, device), i.e. tgt_dev. @@ -87,8 +84,7 @@ interface with target drivers changed (made much more simple, but incompatible). - - Some kmalloc()'s converted to SLAB caches (by Nathaniel Clark - <na...@mi...>) + - Some kmalloc()'s converted to SLAB caches (by Nathaniel Clark) - Too low timeouts for management operations in scst_disk were increased @@ -129,7 +125,7 @@ * Management interface via /proc added * Various defects using devices/files larger 2Gb were fixed. Thanks - to Mark Buechler <mar...@gm...> + to Mark Buechler. * New CDROM FILEIO handler added. Modified: trunk/scst/README =================================================================== --- trunk/scst/README 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/scst/README 2006-12-01 19:01:35 UTC (rev 38) @@ -1,7 +1,7 @@ Generic SCSI target mid-level for Linux (SCST) ============================================== -Version 0.9.5, XX XXX 2006 +Version 0.9.5, 01 Dec 2006 -------------------------- SCST is designed to provide unified, consistent interface between SCSI @@ -430,6 +430,9 @@ parameters in /sys/block/device directory, they also affect the performance. If you find the best values, please share them with us. + - Also it is recommended to turn the kernel preemption off, i.e. set + the kernel preemption model to "No Forced Preemption (Server)". + 5. For hardware. - Make sure that your target hardware (e.g. target FC card) and underlaying Modified: trunk/scst/include/scsi_tgt.h =================================================================== --- trunk/scst/include/scsi_tgt.h 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/scst/include/scsi_tgt.h 2006-12-01 19:01:35 UTC (rev 38) @@ -32,7 +32,7 @@ /* Version numbers, the same as for the kernel */ #define SCST_VERSION_CODE 0x000905 #define SCST_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define SCST_VERSION_STRING "0.9.5-pre2" +#define SCST_VERSION_STRING "0.9.5" /************************************************************* ** States of command processing state machine Modified: trunk/scst/src/Makefile =================================================================== --- trunk/scst/src/Makefile 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/scst/src/Makefile 2006-12-01 19:01:35 UTC (rev 38) @@ -76,13 +76,13 @@ #EXTRA_CFLAGS += -DSTRICT_SERIALIZING EXTRA_CFLAGS += -DEXTRACHECKS -#EXTRA_CFLAGS += -DFILEIO_ONLY +EXTRA_CFLAGS += -DFILEIO_ONLY #EXTRA_CFLAGS += -fno-inline -#EXTRA_CFLAGS += -DTRACING +EXTRA_CFLAGS += -DTRACING -EXTRA_CFLAGS += -DDEBUG +#EXTRA_CFLAGS += -DDEBUG #EXTRA_CFLAGS += -DDEBUG_TM -DTM_DBG_GO_OFFLINE=0 #EXTRA_CFLAGS += -DDEBUG_RETRY #EXTRA_CFLAGS += -DDEBUG_OOM Modified: trunk/scst/src/dev_handlers/Makefile =================================================================== --- trunk/scst/src/dev_handlers/Makefile 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/scst/src/dev_handlers/Makefile 2006-12-01 19:01:35 UTC (rev 38) @@ -51,9 +51,9 @@ EXTRA_CFLAGS += -I$(SUBDIRS) -I$(SUBDIRS)/../include #EXTRA_CFLAGS += -I$(SUBDIRS) -I$(SUBDIRS)/../../include -I$(SUBDIRS)/.. -#EXTRA_CFLAGS += -DTRACING +EXTRA_CFLAGS += -DTRACING -EXTRA_CFLAGS += -DDEBUG +#EXTRA_CFLAGS += -DDEBUG clean: rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend Modules.symvers Module.symvers Modified: trunk/www/scst_page.html =================================================================== --- trunk/www/scst_page.html 2006-11-30 16:44:59 UTC (rev 37) +++ trunk/www/scst_page.html 2006-12-01 19:01:35 UTC (rev 38) @@ -110,7 +110,7 @@ project</a>, which is currently developed on <a href="http://unh-iscsi.sourceforge.net/">SourceForge.net</a>.<br> </p> -<p style="text-align: justify;">The latest stable version is 0.9.4. It +<p style="text-align: justify;">The latest stable version is 0.9.5. It supports SCSI disks (type 0), tapes (type 1), processors (type 3), CDROMs (type 5), MO disks (type 7), medium changers (type 8) and RAID controllers (type 0xC). Also it supports FILEIO and "performance" @@ -165,13 +165,15 @@ driver. The port was done by Nathaniel Clark. This is stable and functional driver with the larger feature set, than the parent driver has.</p> -<p style="text-align: justify;">The latest version is 0.9.3.8. Requires -Linux kernel version 2.6.15.X and SCST version 0.9.4 or higher. -For usage with other kernel versions you will need to port the -initiator patch to that version of the kernel.<br> +<p style="text-align: justify;">The latest version is 0.9.5. Requires +Linux kernel version 2.6.16.X and SCST version 0.9.5 or higher. +For usage with other kernel versions you need to port the +initiator patch to that version of the kernel. Tested on i386 and +x86_64 only, but +should work on any other supported by Linux platform. </p> <p style="text-align: justify;">You can find the latest development -version of this driver in the SCST CVS. See above how to setup access +version of this driver in the SCST SVN. See above how to setup access to it.<br> </p> <p style="text-align: justify;"><a @@ -192,7 +194,7 @@ was patched, basically, to enable the target mode and provide all necessary callbacks, and it's still able to work as initiator only. Mode, when a host acts as the initiator and the target simultaneously, -is also supported. This driver is going to be obsolete soon in favor of +is also supported. This driver is obsoleted in favor of 2.6-based driver (see above).<br> <br> The latest version is 0.9.3.4. Requires Linux kernel versions 2.4.20 or This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2006-12-14 15:42:12
|
Revision: 54 http://svn.sourceforge.net/scst/?rev=54&view=rev Author: vlnb Date: 2006-12-14 07:42:11 -0800 (Thu, 14 Dec 2006) Log Message: ----------- - Switch kmem_cache_alloc() -> kmem_cache_zalloc() - Minor changes M trunk/qla2x00t/qla2x00-target/qla2x00t.h M trunk/qla2x00t/qla2x00-target/qla2x00t.c M trunk/scst/src/scst_lib.c M trunk/Makefile Modified Paths: -------------- trunk/Makefile trunk/qla2x00t/qla2x00-target/qla2x00t.c trunk/qla2x00t/qla2x00-target/qla2x00t.h trunk/scst/src/scst_lib.c Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2006-12-14 10:13:51 UTC (rev 53) +++ trunk/Makefile 2006-12-14 15:42:11 UTC (rev 54) @@ -26,7 +26,7 @@ all: cd $(SCST_DIR) && $(MAKE) $@ @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi - @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi +# @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi install: cd $(SCST_DIR) && $(MAKE) $@ Modified: trunk/qla2x00t/qla2x00-target/qla2x00t.c =================================================================== --- trunk/qla2x00t/qla2x00-target/qla2x00t.c 2006-12-14 10:13:51 UTC (rev 53) +++ trunk/qla2x00t/qla2x00-target/qla2x00t.c 2006-12-14 15:42:11 UTC (rev 54) @@ -1348,15 +1348,21 @@ goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) cmd = kmem_cache_alloc(q2t_cmd_cachep, GFP_ATOMIC); +#else + cmd = kmem_cache_zalloc(q2t_cmd_cachep, GFP_ATOMIC); +#endif if (cmd == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of cmd failed"); res = -ENOMEM; goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + memset(cmd, 0, sizeof(*cmd)); +#endif TRACE_BUFFER("ATIO Coming Up", atio, sizeof(*atio)); - memset(cmd, 0, sizeof(*cmd)); memcpy(&cmd->atio, atio, sizeof(*atio)); cmd->state = Q2T_STATE_NEW; Modified: trunk/qla2x00t/qla2x00-target/qla2x00t.h =================================================================== --- trunk/qla2x00t/qla2x00-target/qla2x00t.h 2006-12-14 10:13:51 UTC (rev 53) +++ trunk/qla2x00t/qla2x00-target/qla2x00t.h 2006-12-14 15:42:11 UTC (rev 54) @@ -30,7 +30,7 @@ /* Version numbers, the same as for the kernel */ #define Q2T_VERSION(a,b,c,d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d)) -#define Q2T_VERSION_CODE Q2T_VERSION(0,9,5,0) +#define Q2T_VERSION_CODE Q2T_VERSION(0,9,6,0) #define Q2T_VERSION_STRING "0.9.6-pre1" #define Q2T_MAX_CDB_LEN 16 Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2006-12-14 10:13:51 UTC (rev 53) +++ trunk/scst/src/scst_lib.c 2006-12-14 15:42:11 UTC (rev 54) @@ -196,13 +196,19 @@ struct scst_acg_dev *res; TRACE_ENTRY(); - + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) res = kmem_cache_alloc(scst_acgd_cachep, GFP_KERNEL); +#else + res = kmem_cache_zalloc(scst_acgd_cachep, GFP_KERNEL); +#endif if (res == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of scst_acg_dev failed"); goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) memset(res, 0, sizeof(*res)); +#endif res->dev = dev; res->acg = acg; @@ -321,14 +327,19 @@ TRACE_ENTRY(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) tgt_dev = kmem_cache_alloc(scst_tgtd_cachep, GFP_KERNEL); - if (tgt_dev != NULL) - memset(tgt_dev, 0, sizeof(*tgt_dev)); - else { +#else + tgt_dev = kmem_cache_zalloc(scst_tgtd_cachep, GFP_KERNEL); +#endif + if (tgt_dev == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of scst_tgt_dev failed"); goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + memset(tgt_dev, 0, sizeof(*tgt_dev)); +#endif tgt_dev->acg_dev = acg_dev; tgt_dev->sess = sess; @@ -922,14 +933,19 @@ TRACE_ENTRY(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) sess = kmem_cache_alloc(scst_sess_cachep, gfp_mask); - if (sess != NULL) - memset(sess, 0, sizeof(*sess)); - else { +#else + sess = kmem_cache_zalloc(scst_sess_cachep, gfp_mask); +#endif + if (sess == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of scst_session failed"); goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + memset(sess, 0, sizeof(*sess)); +#endif sess->init_phase = SCST_SESS_IPH_INITING; atomic_set(&sess->refcnt, 0); @@ -1031,13 +1047,18 @@ TRACE_ENTRY(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) cmd = kmem_cache_alloc(scst_cmd_cachep, gfp_mask); - if (cmd != NULL) - memset(cmd, 0, sizeof(*cmd)); - else { +#else + cmd = kmem_cache_zalloc(scst_cmd_cachep, gfp_mask); +#endif + if (cmd == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of scst_cmd failed"); goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + memset(cmd, 0, sizeof(*cmd)); +#endif cmd->queue_type = SCST_CMD_QUEUE_UNTAGGED; cmd->timeout = SCST_DEFAULT_TIMEOUT; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2006-12-15 16:49:16
|
Revision: 65 http://svn.sourceforge.net/scst/?rev=65&view=rev Author: vlnb Date: 2006-12-15 08:49:15 -0800 (Fri, 15 Dec 2006) Log Message: ----------- ChangeLog updated Modified Paths: -------------- trunk/qla2x00t/qla2x00-target/ChangeLog trunk/scst/ChangeLog Modified: trunk/qla2x00t/qla2x00-target/ChangeLog =================================================================== --- trunk/qla2x00t/qla2x00-target/ChangeLog 2006-12-15 16:30:30 UTC (rev 64) +++ trunk/qla2x00t/qla2x00-target/ChangeLog 2006-12-15 16:49:15 UTC (rev 65) @@ -1,8 +1,12 @@ Summary of changes between versions 0.9.5 and 0.9.6 --------------------------------------------------- + - Update to work on 2.6.19.x. + - Updated to work with SCST 0.9.6. + - Cleanups and minor bug fixes. + Summary of changes between versions 0.9.3.8 and 0.9.5 ----------------------------------------------------- Modified: trunk/scst/ChangeLog =================================================================== --- trunk/scst/ChangeLog 2006-12-15 16:30:30 UTC (rev 64) +++ trunk/scst/ChangeLog 2006-12-15 16:49:15 UTC (rev 65) @@ -1,3 +1,20 @@ +Summary of changes between versions 0.9.5 and 0.9.6 +--------------------------------------------------- + + - Updated to work on 2.6.19.x, thanks to Ming Zhang. + + - Internal threads management reimplemented based on kthread*() API, + thanks to Ming Zhang. + + - /proc implementation moved to seq_*() library, thanks to Ming Zhang. + Target drivers need to be updated accordingly. + + - Building from the Linux kernel tree updated, inside kernel building fixed. + + - Support for CPU cache flushing before doing DMA to target devices added. + + - Various cleanups and bug fixes. + Summary of changes between versions 0.9.4 and 0.9.5 --------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-01-09 14:52:32
|
Revision: 74 http://svn.sourceforge.net/scst/?rev=74&view=rev Author: vlnb Date: 2007-01-09 06:52:16 -0800 (Tue, 09 Jan 2007) Log Message: ----------- Atomic memory barriers cleanup. Inspired by Ming Zhang. Modified Paths: -------------- trunk/qla2x00t/qla2x00-target/qla2x00t.c trunk/scst/src/scst_priv.h Modified: trunk/qla2x00t/qla2x00-target/qla2x00t.c =================================================================== --- trunk/qla2x00t/qla2x00-target/qla2x00t.c 2007-01-08 17:56:35 UTC (rev 73) +++ trunk/qla2x00t/qla2x00-target/qla2x00t.c 2007-01-09 14:52:16 UTC (rev 74) @@ -287,11 +287,8 @@ tgt->handle, list_empty(&tgt->sess_list), atomic_read(&tgt->sess_count)); - smp_mb__before_atomic_dec(); - if (atomic_dec_and_test(&tgt->sess_count)) { - smp_mb__after_atomic_dec(); + if (atomic_dec_and_test(&tgt->sess_count)) wake_up_all(&tgt->waitQ); - } out: TRACE_EXIT(); @@ -1415,7 +1412,6 @@ out_free_sess: kfree(sess); - smp_mb__before_atomic_dec(); if (atomic_dec_and_test(&tgt->sess_count)) wake_up_all(&tgt->waitQ); /* go through */ Modified: trunk/scst/src/scst_priv.h =================================================================== --- trunk/scst/src/scst_priv.h 2007-01-08 17:56:35 UTC (rev 73) +++ trunk/scst/src/scst_priv.h 2007-01-09 14:52:16 UTC (rev 74) @@ -433,6 +433,7 @@ static inline void scst_inc_cmd_count(void) { atomic_inc(&scst_cmd_count); + /* It's needed to be before test_bit(SCST_FLAG_SUSPENDED) */ smp_mb__after_atomic_inc(); TRACE_DBG("Incrementing scst_cmd_count(%d)", atomic_read(&scst_cmd_count)); @@ -442,7 +443,6 @@ { int f; f = atomic_dec_and_test(&scst_cmd_count); - smp_mb__after_atomic_dec(); if (f && unlikely(test_bit(SCST_FLAG_SUSPENDED, &scst_flags))) wake_up_all(&scst_dev_cmd_waitQ); TRACE_DBG("Decrementing scst_cmd_count(%d)", @@ -458,11 +458,8 @@ static inline void scst_sess_put(struct scst_session *sess) { - smp_mb__before_atomic_dec(); - if (atomic_dec_and_test(&sess->refcnt)) { - smp_mb__after_atomic_dec(); + if (atomic_dec_and_test(&sess->refcnt)) scst_sched_session_free(sess); - } } void __scst_suspend_activity(void); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-02-16 11:11:38
|
Revision: 87 http://svn.sourceforge.net/scst/?rev=87&view=rev Author: vlnb Date: 2007-02-16 03:11:18 -0800 (Fri, 16 Feb 2007) Log Message: ----------- Update to work on 2.6.20 + minor fix Modified Paths: -------------- trunk/qla2x00t/qla2x00-target/qla2x00t.c trunk/qla2x00t/qla_init.c trunk/qla2x00t/qla_os.c trunk/scst/src/scst.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_mem.c trunk/scst/src/scst_mem.h trunk/scst/src/scst_priv.h trunk/scst/src/scst_targ.c Modified: trunk/qla2x00t/qla2x00-target/qla2x00t.c =================================================================== --- trunk/qla2x00t/qla2x00-target/qla2x00t.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/qla2x00t/qla2x00-target/qla2x00t.c 2007-02-16 11:11:18 UTC (rev 87) @@ -114,7 +114,7 @@ task_mgmt_fn_done:q2t_task_mgmt_fn_done, }; -kmem_cache_t *q2t_cmd_cachep = NULL; +struct kmem_cache *q2t_cmd_cachep = NULL; static struct qla2x_tgt_target tgt_data; /* Modified: trunk/qla2x00t/qla_init.c =================================================================== --- trunk/qla2x00t/qla_init.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/qla2x00t/qla_init.c 2007-02-16 11:11:18 UTC (rev 87) @@ -1725,17 +1725,33 @@ } static void +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) qla2x00_rport_add(void *data) +#else +qla2x00_rport_add(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) fc_port_t *fcport = data; +#else + fc_port_t *fcport = container_of(work, struct fc_port, rport_add_work); +#endif qla2x00_reg_remote_port(fcport->ha, fcport); } static void +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) qla2x00_rport_del(void *data) +#else +qla2x00_rport_del(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) fc_port_t *fcport = data; +#else + fc_port_t *fcport = container_of(work, struct fc_port, rport_del_work); +#endif struct fc_rport *rport; unsigned long flags; @@ -1774,8 +1790,13 @@ fcport->flags = FCF_RLC_SUPPORT; fcport->supported_classes = FC_COS_UNSPECIFIED; spin_lock_init(&fcport->rport_lock); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&fcport->rport_add_work, qla2x00_rport_add, fcport); INIT_WORK(&fcport->rport_del_work, qla2x00_rport_del, fcport); +#else + INIT_WORK(&fcport->rport_add_work, qla2x00_rport_add); + INIT_WORK(&fcport->rport_del_work, qla2x00_rport_del); +#endif return (fcport); } @@ -2116,7 +2137,11 @@ unsigned long flags; if (fcport->drport) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) qla2x00_rport_del(fcport); +#else + qla2x00_rport_del(&fcport->rport_del_work); +#endif if (fcport->rport) return; @@ -3031,7 +3056,11 @@ /* Go with deferred removal of rport references. */ list_for_each_entry(fcport, &ha->fcports, list) if (fcport->drport) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) qla2x00_rport_del(fcport); +#else + qla2x00_rport_del(&fcport->rport_del_work); +#endif } /* Modified: trunk/qla2x00t/qla_os.c =================================================================== --- trunk/qla2x00t/qla_os.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/qla2x00t/qla_os.c 2007-02-16 11:11:18 UTC (rev 87) @@ -29,7 +29,7 @@ /* * SRB allocation cache */ -static kmem_cache_t *srb_cachep; +static struct kmem_cache *srb_cachep; /* * Ioctl related information. Modified: trunk/scst/src/scst.c =================================================================== --- trunk/scst/src/scst.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst.c 2007-02-16 11:11:18 UTC (rev 87) @@ -49,18 +49,18 @@ LIST_HEAD(scst_dev_list); LIST_HEAD(scst_dev_type_list); -kmem_cache_t *scst_mgmt_cachep; +struct kmem_cache *scst_mgmt_cachep; mempool_t *scst_mgmt_mempool; -kmem_cache_t *scst_ua_cachep; +struct kmem_cache *scst_ua_cachep; mempool_t *scst_ua_mempool; -kmem_cache_t *scst_tgtd_cachep; -kmem_cache_t *scst_sess_cachep; -kmem_cache_t *scst_acgd_cachep; +struct kmem_cache *scst_tgtd_cachep; +struct kmem_cache *scst_sess_cachep; +struct kmem_cache *scst_acgd_cachep; LIST_HEAD(scst_acg_list); struct scst_acg *scst_default_acg; -kmem_cache_t *scst_cmd_cachep; +struct kmem_cache *scst_cmd_cachep; unsigned long scst_flags; atomic_t scst_cmd_count = ATOMIC_INIT(0); @@ -77,7 +77,11 @@ struct scst_sgv_pools scst_sgv; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) DECLARE_WORK(scst_cmd_mem_work, scst_cmd_mem_work_fn, 0); +#else +DECLARE_DELAYED_WORK(scst_cmd_mem_work, scst_cmd_mem_work_fn); +#endif unsigned long scst_max_cmd_mem; Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_lib.c 2007-02-16 11:11:18 UTC (rev 87) @@ -1362,6 +1362,8 @@ } if (cmd->no_sgv) { + if (atomic) + goto out; cmd->sg = scst_alloc(cmd->bufflen, gfp_mask, use_clustering, &cmd->sg_cnt); } else { Modified: trunk/scst/src/scst_mem.c =================================================================== --- trunk/scst/src/scst_mem.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_mem.c 2007-02-16 11:11:18 UTC (rev 87) @@ -316,7 +316,7 @@ goto out; } -static void sgv_ctor(void *data, kmem_cache_t *c, unsigned long flags) +static void sgv_ctor(void *data, struct kmem_cache *c, unsigned long flags) { struct sgv_pool_obj *obj = data; @@ -339,7 +339,7 @@ } #define SGV_DTOR_NAME(order) sgv_dtor##order -#define SGV_DTOR(order) static void sgv_dtor##order(void *d, kmem_cache_t *k, \ +#define SGV_DTOR(order) static void sgv_dtor##order(void *d, struct kmem_cache *k, \ unsigned long f) { __sgv_dtor(d, 1 << order); } SGV_DTOR(0); @@ -354,7 +354,7 @@ SGV_DTOR(9); SGV_DTOR(10); -typedef void (*dtor_t)(void *, kmem_cache_t *, unsigned long); +typedef void (*dtor_t)(void *, struct kmem_cache *, unsigned long); dtor_t cache_dtors[SGV_POOL_ELEMENTS] = { SGV_DTOR_NAME(0), SGV_DTOR_NAME(1), SGV_DTOR_NAME(2), SGV_DTOR_NAME(3), Modified: trunk/scst/src/scst_mem.h =================================================================== --- trunk/scst/src/scst_mem.h 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_mem.h 2007-02-16 11:11:18 UTC (rev 87) @@ -36,7 +36,7 @@ struct sgv_pool_obj { - kmem_cache_t *owner_cache; + struct kmem_cache *owner_cache; int eorder; int orig_sg; int orig_length; @@ -56,7 +56,7 @@ struct sgv_pool_acc cache_acc[SGV_POOL_ELEMENTS]; unsigned int clustered:1; /* 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 */ - kmem_cache_t *caches[SGV_POOL_ELEMENTS]; + struct kmem_cache *caches[SGV_POOL_ELEMENTS]; char cache_names[SGV_POOL_ELEMENTS][25]; }; Modified: trunk/scst/src/scst_priv.h =================================================================== --- trunk/scst/src/scst_priv.h 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_priv.h 2007-02-16 11:11:18 UTC (rev 87) @@ -110,24 +110,24 @@ } #define SCST_MGMT_CMD_CACHE_STRING "scst_mgmt_cmd" -extern kmem_cache_t *scst_mgmt_cachep; +extern struct kmem_cache *scst_mgmt_cachep; extern mempool_t *scst_mgmt_mempool; #define SCST_UA_CACHE_STRING "scst_ua" -extern kmem_cache_t *scst_ua_cachep; +extern struct kmem_cache *scst_ua_cachep; extern mempool_t *scst_ua_mempool; #define SCST_CMD_CACHE_STRING "scst_cmd" -extern kmem_cache_t *scst_cmd_cachep; +extern struct kmem_cache *scst_cmd_cachep; #define SCST_SESSION_CACHE_STRING "scst_session" -extern kmem_cache_t *scst_sess_cachep; +extern struct kmem_cache *scst_sess_cachep; #define SCST_TGT_DEV_CACHE_STRING "scst_tgt_dev" -extern kmem_cache_t *scst_tgtd_cachep; +extern struct kmem_cache *scst_tgtd_cachep; #define SCST_ACG_DEV_CACHE_STRING "scst_acg_dev" -extern kmem_cache_t *scst_acgd_cachep; +extern struct kmem_cache *scst_acgd_cachep; extern struct scst_sgv_pools scst_sgv; @@ -151,7 +151,11 @@ extern spinlock_t scst_cmd_mem_lock; extern unsigned long scst_max_cmd_mem, scst_cur_max_cmd_mem, scst_cur_cmd_mem; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) extern struct work_struct scst_cmd_mem_work; +#else +extern struct delayed_work scst_cmd_mem_work; +#endif /* The following lists protected by scst_list_lock as well */ extern struct list_head scst_mgmt_cmd_list; @@ -225,7 +229,11 @@ void scst_cmd_tasklet(long p); int scst_mgmt_cmd_thread(void *arg); int scst_mgmt_thread(void *arg); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) void scst_cmd_mem_work_fn(void *p); +#else +void scst_cmd_mem_work_fn(struct work_struct *work); +#endif struct scst_device *scst_alloc_device(int gfp_mask); void scst_free_device(struct scst_device *tgt_dev); Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_targ.c 2007-02-16 11:11:18 UTC (rev 87) @@ -495,7 +495,11 @@ goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) void scst_cmd_mem_work_fn(void *p) +#else +void scst_cmd_mem_work_fn(struct work_struct *work) +#endif { TRACE_ENTRY(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-04-03 14:49:36
|
Revision: 106 http://svn.sourceforge.net/scst/?rev=106&view=rev Author: vlnb Date: 2007-04-03 07:49:33 -0700 (Tue, 03 Apr 2007) Log Message: ----------- Fixed depmod to work for the necessary kernel, not the current one Modified Paths: -------------- trunk/qla2x00t/Makefile trunk/qla2x00t/qla2x00-target/Makefile trunk/scst/src/Makefile trunk/scst/src/dev_handlers/Makefile Modified: trunk/qla2x00t/Makefile =================================================================== --- trunk/qla2x00t/Makefile 2007-04-03 14:47:47 UTC (rev 105) +++ trunk/qla2x00t/Makefile 2007-04-03 14:49:33 UTC (rev 106) @@ -21,7 +21,8 @@ else ifeq ($(KVER),) ifeq ($(KDIR),) - KDIR := /lib/modules/$(shell uname -r)/build + KVER = $(shell uname -r) + KDIR := /lib/modules/$(KVER)/build endif else KDIR := /lib/modules/$(KVER)/build @@ -36,7 +37,7 @@ uninstall: rm -f $(INSTALL_DIR)/qla2[2-3]00.ko $(INSTALL_DIR)/qla2xxx.ko - -/sbin/depmod -a + -/sbin/depmod -a $(KVER) endif clean: Modified: trunk/qla2x00t/qla2x00-target/Makefile =================================================================== --- trunk/qla2x00t/qla2x00-target/Makefile 2007-04-03 14:47:47 UTC (rev 105) +++ trunk/qla2x00t/qla2x00-target/Makefile 2007-04-03 14:49:33 UTC (rev 106) @@ -42,7 +42,8 @@ ifeq ($(KVER),) ifeq ($(KDIR),) - KDIR := /lib/modules/$(shell uname -r)/build + KVER = $(shell uname -r) + KDIR := /lib/modules/$(KVER)/build endif else KDIR := /lib/modules/$(KVER)/build @@ -66,7 +67,7 @@ install: all $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \ modules_install - -depmod -a + -depmod -a $(KVER) SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Modules.symvers 2>/dev/null) ifneq ($(SCST_MOD_VERS),) @@ -87,7 +88,7 @@ uninstall: rm -f $(INSTALL_DIR)/qla2[23x]00tgt.ko - -/sbin/depmod -a + -/sbin/depmod -a $(KVER) endif clean: Modified: trunk/scst/src/Makefile =================================================================== --- trunk/scst/src/Makefile 2007-04-03 14:47:47 UTC (rev 105) +++ trunk/scst/src/Makefile 2007-04-03 14:49:33 UTC (rev 106) @@ -47,7 +47,8 @@ else ifeq ($(KVER),) ifeq ($(KDIR),) - KDIR := /lib/modules/$(shell uname -r)/build + KVER = $(shell uname -r) + KDIR := /lib/modules/$(KVER)/build endif else KDIR := /lib/modules/$(KVER)/build @@ -77,13 +78,13 @@ rm -f $(INSTALL_DIR_H)/Modules.symvers install -m 644 Module.symvers $(INSTALL_DIR_H) endif - -depmod -a + -depmod -a $(KVER) uninstall: cd $(DEV_HANDLERS_DIR) && $(MAKE) $@ rm -f $(INSTALL_DIR)/scsi_tgt.ko -rmdir $(INSTALL_DIR) 2>/dev/null - -/sbin/depmod -a + -/sbin/depmod -a $(KVER) rm -rf $(INSTALL_DIR_H) endif Modified: trunk/scst/src/dev_handlers/Makefile =================================================================== --- trunk/scst/src/dev_handlers/Makefile 2007-04-03 14:47:47 UTC (rev 105) +++ trunk/scst/src/dev_handlers/Makefile 2007-04-03 14:49:33 UTC (rev 106) @@ -43,7 +43,8 @@ else ifeq ($(KDIR),) - KDIR := /lib/modules/$(shell uname -r)/build + KVER = $(shell uname -r) + KDIR := /lib/modules/$(KVER)/build endif all: @@ -52,7 +53,7 @@ install: all $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) \ modules_install - -depmod -a + -depmod -a $(KVER) uninstall: rm -f $(INSTALL_DIR)/scst_*.ko This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-05-31 17:12:00
|
Revision: 121 http://svn.sourceforge.net/scst/?rev=121&view=rev Author: vlnb Date: 2007-05-31 10:11:57 -0700 (Thu, 31 May 2007) Log Message: ----------- - Module scst_user and user space utility to test it added - Support for per-target default security groups added - FILEIO made multithreaded - BLOCKIO made async - Other improvements, fixes and cleanups Modified Paths: -------------- trunk/Makefile trunk/scst/ChangeLog trunk/scst/README trunk/scst/include/scsi_tgt.h trunk/scst/kernel/in-tree/Kconfig.scsi_tgt trunk/scst/kernel/in-tree/Makefile.scsi_tgt trunk/scst/src/Makefile trunk/scst/src/dev_handlers/Makefile trunk/scst/src/dev_handlers/scst_vdisk.c trunk/scst/src/scst.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_priv.h trunk/scst/src/scst_proc.c trunk/scst/src/scst_targ.c Added Paths: ----------- trunk/scst/include/scst_user.h trunk/scst/src/dev_handlers/scst_user.c trunk/usr/ trunk/usr/fileio/ trunk/usr/fileio/Makefile trunk/usr/fileio/common.c trunk/usr/fileio/common.h trunk/usr/fileio/debug.c trunk/usr/fileio/debug.h trunk/usr/fileio/fileio.c Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2007-05-31 17:10:55 UTC (rev 120) +++ trunk/Makefile 2007-05-31 17:11:57 UTC (rev 121) @@ -22,33 +22,39 @@ QLA_INI_DIR=qla2x00t QLA_DIR=qla2x00t/qla2x00-target LSI_DIR=mpt +USR_DIR=usr/fileio all: cd $(SCST_DIR) && $(MAKE) $@ @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi # @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi + @if [ -d $(USR_DIR) ]; then cd $(USR_DIR) && $(MAKE) $@; fi install: cd $(SCST_DIR) && $(MAKE) $@ @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi - @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi +# @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi + @if [ -d $(USR_DIR) ]; then cd $(USR_DIR) && $(MAKE) $@; fi uninstall: cd $(SCST_DIR) && $(MAKE) $@ @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi + @if [ -d $(USR_DIR) ]; then cd $(USR_DIR) && $(MAKE) $@; fi clean: cd $(SCST_DIR) && $(MAKE) $@ @if [ -d $(QLA_INI_DIR) ]; then cd $(QLA_INI_DIR) && $(MAKE) $@; fi @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi + @if [ -d $(USR_DIR) ]; then cd $(USR_DIR) && $(MAKE) $@; fi extraclean: cd $(SCST_DIR) && $(MAKE) $@ @if [ -d $(QLA_INI_DIR) ]; then cd $(QLA_INI_DIR) && $(MAKE) $@; fi @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi + @if [ -d $(USR_DIR) ]; then cd $(USR_DIR) && $(MAKE) $@; fi scst: cd $(SCST_DIR) && $(MAKE) @@ -97,6 +103,21 @@ lsi_extraclean: cd $(LSI_DIR) && $(MAKE) extraclean +usr: + cd $(USR_DIR) && $(MAKE) + +usr_install: + cd $(USR_DIR) && $(MAKE) install + +usr_uninstall: + cd $(USR_DIR) && $(MAKE) uninstall + +usr_clean: + cd $(USR_DIR) && $(MAKE) clean + +usr_extraclean: + cd $(USR_DIR) && $(MAKE) extraclean + help: @echo " all (the default) : make all" @echo " clean : clean files" @@ -121,6 +142,12 @@ @echo " lsi_extraclean : lsi target: clean + clean dependencies" @echo " lsi_install : lsi target: install" @echo " lsi_uninstall : lsi target: uninstall" + @echo "" + @echo " usr : make usr target" + @echo " usr_clean : usr target: clean " + @echo " usr_extraclean : usr target: clean + clean dependencies" + @echo " usr_install : usr target: install" + @echo " usr_uninstall : usr target: uninstall" @echo " Notes :" @echo " - install and uninstall must be made as root" @@ -128,3 +155,4 @@ qla qla_install qla_uninstall qla_clean qla_extraclean \ lsi lsi_install lsi_uninstall lsi_clean lsi_extraclean \ scst scst_install scst_uninstall scst_clean scst_extraclean + usr usr_install usr_uninstall usr_clean usr_extraclean Modified: trunk/scst/ChangeLog =================================================================== --- trunk/scst/ChangeLog 2007-05-31 17:10:55 UTC (rev 120) +++ trunk/scst/ChangeLog 2007-05-31 17:11:57 UTC (rev 121) @@ -4,12 +4,14 @@ - FILEIO was renamed to VDISK. BLOCKIO added to it, thanks to Ross S. W. Walker and Vu Pham. - - Internal locking and execution context were reimplemnted. Particularly, - implemented full support for SCSI task attributes (SIMPLE, ORDERED, - etc.). + - Updated to work on 2.6.20.x, no update for 2.6.21.x isn't needed - - Updated to work on 2.6.20.x, no update for 2.6.21.x isn't needed. + - Internal locking and execution context were reimplemnted. As some of + the results now FILEIO has >1 IO threads and implemented full support + for SCSI task attributes (SIMPLE, ORDERED, etc.). + - Ability to have per-target default security groups added. + - Updated to work on 2.6.19.x, thanks to Ming Zhang. - Internal threads management reimplemented based on kthread*() API, Modified: trunk/scst/README =================================================================== --- trunk/scst/README 2007-05-31 17:10:55 UTC (rev 120) +++ trunk/scst/README 2007-05-31 17:11:57 UTC (rev 121) @@ -106,7 +106,7 @@ or ever disk partition, where there is no file systems overhead. Using block devices comparing to sending SCSI commands directly to SCSI mid-level via scsi_do_req()/scsi_execute_async() has advantage that data -are transfered via system cache, so it is possible to fully benefit from +are transferred via system cache, so it is possible to fully benefit from caching and read ahead performed by Linux's VM subsystem. The only disadvantage here that in the FILEIO mode there is superfluous data copying between the cache and SCST's buffers. This issue is going to be @@ -145,12 +145,12 @@ - EXTRACHECKS - adds extra validity checks in the various places. - DEBUG_TM - turns on task management functions debugging, when on - LUN 0 in the "Default" group some of the commands will be delayed for - about 60 sec., so making the remote initiator send TM functions, eg - ABORT TASK and TARGET RESET. Also set TM_DBG_GO_OFFLINE symbol in the - Makefile to 1 if you want that the device eventually become - completely unresponsive, or to 0 otherwise to circle around ABORTs - and RESETs code. Needs DEBUG turned on. + LUN 0 in the default access control group some of the commands will + be delayed for about 60 sec., so making the remote initiator send TM + functions, eg ABORT TASK and TARGET RESET. Also set TM_DBG_GO_OFFLINE + symbol in the Makefile to 1 if you want that the device eventually + become completely unresponsive, or to 0 otherwise to circle around + ABORTs and RESETs code. Needs DEBUG turned on. - STRICT_SERIALIZING - makes SCST send all commands to underlying SCSI device synchronously, one after one. This makes task management more @@ -235,19 +235,21 @@ Access and devices visibility management allows for an initiator or group of initiators to have different limited set of LUs/LUNs (security group) each with appropriate access permissions. Initiator is -represented as a SCST session. Session is binded to security group on -its registration time by character "name" parameter of the registration +represented as a SCST session. Session is bound to security group on its +registration time by character "name" parameter of the registration function, which provided by target driver, based on its internal -authentication. For example, for FC "name" could be WWN or just loop -ID. For iSCSI this could be iSCSI login credentials or iSCSI initiator -name. Each security group has set of names assigned to it by system -administrator. Session is binded to security group with provided name. -If no such groups found, the session binded to "Default" group. +authentication. For example, for FC "name" could be WWN or just loop ID. +For iSCSI this could be iSCSI login credentials or iSCSI initiator name. +Each security group has set of names assigned to it by system +administrator. Session is bound to security group with provided name. If +no such groups found, the session bound to either "Default_target_name", +or "Default" group, depending from either "Default_target_name" exists +or not. In "Default_target_name" target name means name of the target. In /proc/scsi_tgt each group represented as "groups/GROUP_NAME/" subdirectory. In it there are files "devices" and "users". File "devices" lists all devices and their LUNs in the group, file "users" -lists all names that should be binded to this group. +lists all names that should be bound to this group. To configure access and devices visibility management SCST provides the following files and directories under /proc/scsi_tgt: @@ -310,7 +312,7 @@ device "NAME" with block size "BLOCK_SIZE" bytes with flags "FLAGS". "PATH" could be empty only for VDISK CDROM. "BLOCK_SIZE" and "FLAGS" are valid only for disk VDISK. The block size must be - power of 2 and >= 512 bytes Default is 512. Possible flags: + power of 2 and >= 512 bytes. Default is 512. Possible flags: - WRITE_THROUGH - write back caching disabled @@ -479,9 +481,16 @@ - Disable in Makefile TRACING, DEBUG -IMPORTANT: Some of those options enabled by default, i.e. SCST is optimized -========= currently rather for development, not for performance. + - If your initiator(s) use dedicated exported from the target virtual + SCSI devices and have more or equal amount of memory, than the + target, it is recommended to use O_DIRECT option (currently it is + available only with fileio_tgt user space program) or BLOCKIO. With + them you could have up to 100% increase in throughput. +IMPORTANT: Some of the compilation options enabled by default, i.e. SCST +========= is optimized currently rather for development and bug hunting, + not for performance. + 4. For kernel: - Don't enable debug/hacking features, i.e. use them as they are by @@ -496,7 +505,11 @@ parameters in /sys/block/device directory, they also affect the performance. If you find the best values, please share them with us. - - Also it is recommended to turn the kernel preemption off, i.e. set + - Use on the target deadline IO scheduler with read_expire and + write_expire increased on all exported devices to 5000 and 20000 + correspondingly. + + - It is recommended to turn the kernel preemption off, i.e. set the kernel preemption model to "No Forced Preemption (Server)". 5. For hardware. Modified: trunk/scst/include/scsi_tgt.h =================================================================== --- trunk/scst/include/scsi_tgt.h 2007-05-31 17:10:55 UTC (rev 120) +++ trunk/scst/include/scsi_tgt.h 2007-05-31 17:11:57 UTC (rev 121) @@ -39,7 +39,7 @@ /* Version numbers, the same as for the kernel */ #define SCST_VERSION_CODE 0x000906 #define SCST_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define SCST_VERSION_STRING "0.9.6-pre1" +#define SCST_VERSION_STRING "0.9.6-pre2" /************************************************************* ** States of command processing state machine @@ -481,8 +481,15 @@ void (*on_free_cmd) (struct scst_cmd *cmd); /* - * This function allows the target driver to handle data buffer + * This function allows target driver to handle data buffer * allocations on its own. + * + * Target driver doesn't have to always allocate buffer in this + * function, but if it decide to do it, it must check that + * scst_cmd_get_data_buff_alloced() returns 0, otherwise to avoid + * double buffer allocation and memory leaks alloc_data_buf() shall + * fail. + * * Shall return 0 in case of success or < 0 (preferrably -ENOMEM) * in case of error, or > 0 if the regular SCST allocation should be * done. In case of returning successfully, scst_cmd->data_buf_alloced @@ -492,9 +499,9 @@ * desired or fails and consequently < 0 is returned, this function * will be re-called in thread context. * - * Please note that the driver will have to handle all relevant details - * such as scatterlist setup, highmem, freeing the allocated memory, ... - * itself. + * Please note that the driver will have to handle itself all relevant + * details such as scatterlist setup, highmem, freeing the allocated + * memory, etc. * * OPTIONAL. */ @@ -593,6 +600,14 @@ */ const char name[50]; + /* + * Number of additional threads to the pool of dedicated threads. + * Used if xmit_response() or rdy_to_xfer() is blocking. + * It is the target driver's duty to ensure that not more, than that + * number of threads, are blocked in those functions at any time. + */ + int threads_num; + /* Private, must be inited to 0 by memset() */ /* List of targets per template, protected by scst_mutex */ @@ -620,7 +635,6 @@ unsigned parse_atomic:1; unsigned exec_atomic:1; unsigned dev_done_atomic:1; - unsigned dedicated_thread:1; /* Set, if no /proc files should be automatically created by SCST */ unsigned no_proc:1; @@ -748,6 +762,12 @@ /* SCSI type of the supported device. MUST HAVE */ int type; + /* + * Number of dedicated threads. If 0 - no dedicated threads will + * be created, if <0 - creation of dedicated threads is prohibited. + */ + int threads_num; + struct module *module; /* private: */ @@ -795,6 +815,9 @@ /* Used for storage of target driver private stuff */ void *tgt_priv; + + /* Name on the default security group ("Default_target_name") */ + char *default_group_name; }; /* Hash size and hash fn for hash based lun translation */ @@ -1314,8 +1337,8 @@ /* internal tmp list entry */ struct list_head extra_tgt_dev_list_entry; - /* Dedicated thread. Doesn't need any protection. */ - struct task_struct *thread; + /* List of dedicated threads. Doesn't need any protection. */ + struct list_head threads_list; }; /* @@ -1419,9 +1442,15 @@ /* * Registers and returns target adapter - * Returns new target structure on success or NULL otherwise + * Returns new target structure on success or NULL otherwise. + * + * If parameter "target_name" isn't NULL, then new security group with name + * "Default_##target_name" will be created and all sessions, which don't + * belong to any defined security groups, will be assigned to it instead of + * the "Default" one. */ -struct scst_tgt *scst_register(struct scst_tgt_template *vtt); +struct scst_tgt *scst_register(struct scst_tgt_template *vtt, + const char *target_name); /* * Unregisters target adapter Added: trunk/scst/include/scst_user.h =================================================================== --- trunk/scst/include/scst_user.h (rev 0) +++ trunk/scst/include/scst_user.h 2007-05-31 17:11:57 UTC (rev 121) @@ -0,0 +1,257 @@ +/* + * include/scst_user.h + * + * Copyright (C) 2007 Vladislav Bolkhovitin <vs...@vl...> + * + * Contains macroses for execution tracing and error reporting + * + * 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, version 2 + * of the License. + * + * 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. + */ + +#ifndef __SCST_USER_H +#define __SCST_USER_H + +#include <scst_const.h> + +#define DEV_USER_NAME "scst_user" +#define DEV_USER_PATH "/dev/" +#define DEV_USER_VERSION 96 + +/* + * Chosen so sizeof(scst_user_sess) <= sizeof(scst_user_scsi_cmd_exec) + * (the largest one) + */ +#define SCST_MAX_NAME 45 + +#define SCST_USER_PARSE_STANDARD 0 +#define SCST_USER_PARSE_CALL 1 +#define SCST_USER_PARSE_EXCEPTION 2 +#define SCST_USER_MAX_PARSE_OPT SCST_USER_PARSE_EXCEPTION + +#define SCST_USER_ON_FREE_CMD_CALL 0 +#define SCST_USER_ON_FREE_CMD_IGNORE 1 +#define SCST_USER_MAX_ON_FREE_CMD_OPT SCST_USER_ON_FREE_CMD_IGNORE + +#define SCST_USER_MEM_NO_REUSE 0 +#define SCST_USER_MEM_REUSE_READ 1 +#define SCST_USER_MEM_REUSE_WRITE 2 +#define SCST_USER_MEM_REUSE_ALL 3 +#define SCST_USER_MAX_MEM_REUSE_OPT SCST_USER_MEM_REUSE_ALL + +#define SCST_USER_PRIO_QUEUE_SINGLE 0 +#define SCST_USER_PRIO_QUEUE_SEPARATE 1 +#define SCST_USER_MAX_PRIO_QUEUE_OPT SCST_USER_PRIO_QUEUE_SEPARATE + +#define SCST_USER_PARTIAL_TRANSFERS_NOT_SUPPORTED 0 +#define SCST_USER_PARTIAL_TRANSFERS_SUPPORTED_ORDERED 1 +#define SCST_USER_PARTIAL_TRANSFERS_SUPPORTED 2 +#define SCST_USER_MAX_PARTIAL_TRANSFERS_OPT SCST_USER_PARTIAL_TRANSFERS_SUPPORTED + +#ifndef aligned_u64 +#define aligned_u64 uint64_t __attribute__((aligned(8))) +#endif + +/************************************************************* + ** Private ucmd states + *************************************************************/ +#define UCMD_STATE_NEW 0 +#define UCMD_STATE_PARSING 1 +#define UCMD_STATE_BUF_ALLOCING 2 +#define UCMD_STATE_EXECING 3 +#define UCMD_STATE_ON_FREEING 4 +#define UCMD_STATE_ON_FREE_SKIPPED 5 +#define UCMD_STATE_ON_CACHE_FREEING 6 +#define UCMD_STATE_TM_EXECING 7 + +#define UCMD_STATE_ATTACH_SESS 0x20 +#define UCMD_STATE_DETACH_SESS 0x21 + +/* Must be changed under cmd_lists.cmd_list_lock */ +#define UCMD_STATE_SENT_MASK 0x10000 +#define UCMD_STATE_RECV_MASK 0x20000 +#define UCMD_STATE_JAMMED_MASK 0x40000 + +#define UCMD_STATE_MASK (UCMD_STATE_SENT_MASK | \ + UCMD_STATE_RECV_MASK | \ + UCMD_STATE_JAMMED_MASK) + +struct scst_user_opt +{ + uint8_t parse_type; + uint8_t on_free_cmd_type; + uint8_t memory_reuse_type; + uint8_t prio_queue_type; + uint8_t partial_transfers_type; + int32_t partial_len; +}; + +struct scst_user_dev_desc +{ + uint8_t version; + uint8_t type; + struct scst_user_opt opt; + uint32_t block_size; + char name[SCST_MAX_NAME]; +}; + +struct scst_user_sess +{ + aligned_u64 sess_h; + aligned_u64 lun; + uint8_t rd_only; + char initiator_name[SCST_MAX_NAME]; +}; + +struct scst_user_scsi_cmd_parse +{ + aligned_u64 sess_h; + + uint8_t cdb[SCST_MAX_CDB_SIZE]; + int32_t cdb_len; + + uint32_t timeout; + int32_t bufflen; + + uint8_t queue_type; + uint8_t data_direction; + + uint8_t expected_values_set; + uint8_t expected_data_direction; + int32_t expected_transfer_len; +}; + +struct scst_user_scsi_cmd_alloc_mem +{ + aligned_u64 sess_h; + + uint8_t cdb[SCST_MAX_CDB_SIZE]; + int32_t cdb_len; + + int32_t alloc_len; + + uint8_t queue_type; + uint8_t data_direction; +}; + +struct scst_user_scsi_cmd_exec +{ + aligned_u64 sess_h; + + uint8_t cdb[SCST_MAX_CDB_SIZE]; + int32_t cdb_len; + + int32_t data_len; + int32_t bufflen; + int32_t alloc_len; + aligned_u64 pbuf; + uint8_t queue_type; + uint8_t data_direction; + uint8_t partial; + uint32_t timeout; + + uint32_t parent_cmd_h; + int32_t parent_cmd_data_len; + uint32_t partial_offset; +}; + +struct scst_user_scsi_on_free_cmd +{ + aligned_u64 pbuf; + int32_t resp_data_len; + uint8_t buffer_cached; + uint8_t status; +}; + +struct scst_user_on_cached_mem_free +{ + aligned_u64 pbuf; +}; + +struct scst_user_tm +{ + aligned_u64 sess_h; + uint32_t fn; + uint32_t cmd_h_to_abort; +}; + +struct scst_user_get_cmd +{ + aligned_u64 preply; + uint32_t cmd_h; + uint32_t subcode; + union { + struct scst_user_sess sess; + struct scst_user_scsi_cmd_parse parse_cmd; + struct scst_user_scsi_cmd_alloc_mem alloc_cmd; + struct scst_user_scsi_cmd_exec exec_cmd; + struct scst_user_scsi_on_free_cmd on_free_cmd; + struct scst_user_on_cached_mem_free on_cached_mem_free; + struct scst_user_tm tm_cmd; + }; +}; + +struct scst_user_scsi_cmd_reply_parse +{ + uint8_t queue_type; + uint8_t data_direction; + int32_t data_len; + int32_t bufflen; +}; + +struct scst_user_scsi_cmd_reply_alloc_mem +{ + aligned_u64 pbuf; +}; + +struct scst_user_scsi_cmd_reply_exec +{ + int32_t resp_data_len; + aligned_u64 pbuf; + +#define SCST_EXEC_REPLY_BACKGROUND 0 +#define SCST_EXEC_REPLY_COMPLETED 1 + uint8_t reply_type; + + uint8_t status; + uint8_t sense_len; + aligned_u64 psense_buffer; +}; + +struct scst_user_reply_cmd +{ + uint32_t cmd_h; + uint32_t subcode; + union { + int32_t result; + struct scst_user_scsi_cmd_reply_parse parse_reply; + struct scst_user_scsi_cmd_reply_alloc_mem alloc_reply; + struct scst_user_scsi_cmd_reply_exec exec_reply; + }; +}; + +#define SCST_USER_REGISTER_DEVICE _IOW('u', 1, struct scst_user_dev_desc) +#define SCST_USER_SET_OPTIONS _IOW('u', 3, struct scst_user_opt) +#define SCST_USER_GET_OPTIONS _IOR('u', 4, struct scst_user_opt) +#define SCST_USER_REPLY_AND_GET_CMD _IOWR('u', 5, struct scst_user_get_cmd) +#define SCST_USER_REPLY_AND_GET_PRIO_CMD _IOWR('u', 6, struct scst_user_get_cmd) +#define SCST_USER_REPLY_CMD _IOW('u', 7, struct scst_user_reply_cmd) + +/* Values for scst_user_get_cmd.subcode */ +#define SCST_USER_ATTACH_SESS _IOR('s', UCMD_STATE_ATTACH_SESS, struct scst_user_sess) +#define SCST_USER_DETACH_SESS _IOR('s', UCMD_STATE_DETACH_SESS, struct scst_user_sess) +#define SCST_USER_PARSE _IOWR('s', UCMD_STATE_PARSING, struct scst_user_scsi_cmd_parse) +#define SCST_USER_ALLOC_MEM _IOWR('s', UCMD_STATE_BUF_ALLOCING, struct scst_user_scsi_cmd_alloc_mem) +#define SCST_USER_EXEC _IOWR('s', UCMD_STATE_EXECING, struct scst_user_scsi_cmd_exec) +#define SCST_USER_ON_FREE_CMD _IOR('s', UCMD_STATE_ON_FREEING, struct scst_user_scsi_on_free_cmd) +#define SCST_USER_ON_CACHED_MEM_FREE _IOR('s', UCMD_STATE_ON_CACHE_FREEING, struct scst_user_on_cached_mem_free) +#define SCST_USER_TASK_MGMT _IOWR('s', UCMD_STATE_TM_EXECING, struct scst_user_tm) + +#endif /* __SCST_USER_H */ Modified: trunk/scst/kernel/in-tree/Kconfig.scsi_tgt =================================================================== --- trunk/scst/kernel/in-tree/Kconfig.scsi_tgt 2007-05-31 17:10:55 UTC (rev 120) +++ trunk/scst/kernel/in-tree/Kconfig.scsi_tgt 2007-05-31 17:11:57 UTC (rev 121) @@ -63,6 +63,13 @@ ---help--- SCSI TARGET handler for virtual disk and/or cdrom device. +config SCSI_TARGET_USER + tristate "SCSI user space virtual target devices support" + default SCSI_TARGET + depends on SCSI && PROC_FS && SCSI_TARGET + ---help--- + SCSI TARGET handler for virtual user space device. + config SCSI_TARGET_EXTRACHECKS bool "Extrachecks support" ---help--- Modified: trunk/scst/kernel/in-tree/Makefile.scsi_tgt =================================================================== --- trunk/scst/kernel/in-tree/Makefile.scsi_tgt 2007-05-31 17:10:55 UTC (rev 120) +++ trunk/scst/kernel/in-tree/Makefile.scsi_tgt 2007-05-31 17:11:57 UTC (rev 121) @@ -15,4 +15,5 @@ obj-$(CONFIG_SCSI_TARGET_CHANGER) += scst_changer.o obj-$(CONFIG_SCSI_TARGET_RAID) += scst_raid.o obj-$(CONFIG_SCSI_TARGET_PROCESSOR) += scst_processor.o -obj-$(CONFIG_SCSI_TARGET_VDISK ) += scst_vdisk.o +obj-$(CONFIG_SCSI_TARGET_VDISK) += scst_vdisk.o +obj-$(CONFIG_SCSI_TARGET_USER) += scst_user.o Modified: trunk/scst/src/Makefile =================================================================== --- trunk/scst/src/Makefile 2007-05-31 17:10:55 UTC (rev 120) +++ trunk/scst/src/Makefile 2007-05-31 17:11:57 UTC (rev 121) @@ -70,6 +70,7 @@ install -d $(INSTALL_DIR_H) install -m 644 ../include/scsi_tgt.h $(INSTALL_DIR_H) install -m 644 ../include/scst_debug.h $(INSTALL_DIR_H) + install -m 644 ../include/scst_user.h $(INSTALL_DIR_H) install -m 644 ../include/scst_const.h $(INSTALL_DIR_H) ifneq ($(MODS_VERS),) rm -f $(INSTALL_DIR_H)/Module.symvers Modified: trunk/scst/src/dev_handlers/Makefile =================================================================== --- trunk/scst/src/dev_handlers/Makefile 2007-05-31 17:10:55 UTC (rev 120) +++ trunk/scst/src/dev_handlers/Makefile 2007-05-31 17:11:57 UTC (rev 121) @@ -30,7 +30,7 @@ SCST_INC_DIR := $(SUBDIRS)/../include obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \ - scst_vdisk.o scst_raid.o scst_processor.o + scst_vdisk.o scst_raid.o scst_processor.o scst_user.o obj-$(CONFIG_SCSI_TARGET_DISK) += scst_disk.o obj-$(CONFIG_SCSI_TARGET_TAPE) += scst_tape.o @@ -40,6 +40,7 @@ obj-$(CONFIG_SCSI_TARGET_RAID) += scst_raid.o obj-$(CONFIG_SCSI_TARGET_PROCESSOR) += scst_processor.o obj-$(CONFIG_SCSI_TARGET_VDISK) += scst_vdisk.o +obj-$(CONFIG_SCSI_TARGET_USER) += scst_user.o else ifeq ($(KDIR),) Added: trunk/scst/src/dev_handlers/scst_user.c =================================================================== --- trunk/scst/src/dev_handlers/scst_user.c (rev 0) +++ trunk/scst/src/dev_handlers/scst_user.c 2007-05-31 17:11:57 UTC (rev 121) @@ -0,0 +1,3039 @@ +/* + * scst_user.c + * + * Copyright (C) 2007 Vladislav Bolkhovitin <vs...@vl...> + * + * SCSI virtual user space device handler + * + * 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, version 2 + * of the License. + * + * 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. + */ + +#include <linux/kthread.h> +#include <linux/delay.h> +#include <linux/poll.h> + +#define LOG_PREFIX DEV_USER_NAME + +#include "scsi_tgt.h" +#include "scst_user.h" +#include "scst_dev_handler.h" + +#ifndef CONFIG_NOHIGHMEM +#warning HIGHMEM kernel configurations are not supported. Consider \ + changing VMSPLIT option or using 64-bit configuration. +#endif + +#if defined(DEBUG) && defined(CONFIG_DEBUG_SLAB) +#define DEV_USER_SLAB_FLAGS ( SLAB_RED_ZONE | SLAB_POISON ) +#else +#define DEV_USER_SLAB_FLAGS 0L +#endif + +#define DEV_USER_MAJOR 237 +#define DEV_USER_CMD_HASH_ORDER 6 +#define DEV_USER_TM_TIMEOUT (10*HZ) +#define DEV_USER_ATTACH_TIMEOUT (5*HZ) +#define DEV_USER_DETACH_TIMEOUT (5*HZ) +#define DEV_USER_PRE_UNREG_POLL_TIME (HZ/10) + +struct scst_user_dev +{ + struct rw_semaphore dev_rwsem; + + struct scst_cmd_lists cmd_lists; + /* All 3 protected by cmd_lists.cmd_list_lock */ + struct list_head ready_cmd_list; + struct list_head prio_ready_cmd_list; + wait_queue_head_t prio_cmd_list_waitQ; + + /* All, including detach_cmd_count, protected by cmd_lists.cmd_list_lock */ + unsigned short blocking:1; + unsigned short cleaning:1; + unsigned short cleanup_done:1; + unsigned short attach_cmd_active:1; + unsigned short tm_cmd_active:1; + unsigned short internal_reset_active:1; + unsigned short pre_unreg_sess_active:1; /* just a small optimization */ + + unsigned short detach_cmd_count; + + int (*generic_parse)(struct scst_cmd *cmd, struct scst_info_cdb *info_cdb, + int (*get_block)(struct scst_cmd *cmd)); + + int block; + int def_block; + + struct sgv_pool *pool; + + uint8_t parse_type; + uint8_t on_free_cmd_type; + uint8_t memory_reuse_type; + uint8_t prio_queue_type; + uint8_t partial_transfers_type; + uint32_t partial_len; + + struct scst_dev_type devtype; + + /* Both protected by cmd_lists.cmd_list_lock */ + unsigned int handle_counter; + struct list_head ucmd_hash[1<<DEV_USER_CMD_HASH_ORDER]; + + int virt_id; + struct list_head dev_list_entry; + char name[SCST_MAX_NAME]; + + /* Protected by cmd_lists.cmd_list_lock */ + struct list_head pre_unreg_sess_list; + + struct list_head cleanup_list_entry; + struct completion cleanup_cmpl; +}; + +struct dev_user_pre_unreg_sess_obj +{ + struct scst_tgt_dev *tgt_dev; + unsigned int active:1; + unsigned int exit:1; + struct list_head pre_unreg_sess_list_entry; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + struct work_struct pre_unreg_sess_work; +#else + struct delayed_work pre_unreg_sess_work; +#endif +}; + +/* Most fields are unprotected, since only one thread at time can access them */ +struct dev_user_cmd +{ + struct scst_cmd *cmd; + struct scst_user_dev *dev; + + atomic_t ucmd_ref; + + unsigned int buff_cached:1; + unsigned int buf_dirty:1; + unsigned int background_exec:1; + unsigned int internal_reset_tm:1; + + struct dev_user_cmd *buf_ucmd; + + int cur_data_page; + int num_data_pages; + int first_page_offset; + unsigned long ubuff; + struct page **data_pages; + struct sgv_pool_obj *sgv; + + unsigned int state; + + struct list_head ready_cmd_list_entry; + + unsigned int h; + struct list_head hash_list_entry; + + struct scst_user_get_cmd user_cmd; + + struct completion *cmpl; + int result; +}; + +static struct dev_user_cmd *dev_user_alloc_ucmd(struct scst_user_dev *dev, + int gfp_mask); +static void dev_user_free_ucmd(struct dev_user_cmd *ucmd); + +static int dev_user_parse(struct scst_cmd *cmd, struct scst_info_cdb *info_cdb); +static int dev_user_exec(struct scst_cmd *cmd); +static void dev_user_on_free_cmd(struct scst_cmd *cmd); +static int dev_user_task_mgmt_fn(struct scst_mgmt_cmd *mcmd, + struct scst_tgt_dev *tgt_dev); + +static int dev_user_disk_done(struct scst_cmd *cmd); +static int dev_user_tape_done(struct scst_cmd *cmd); + +static struct page *dev_user_alloc_pages(struct scatterlist *sg, + gfp_t gfp_mask, void *priv); +static void dev_user_free_sg_entries(struct scatterlist *sg, int sg_count, + void *priv); + +static void dev_user_add_to_ready(struct dev_user_cmd *ucmd); + +static void dev_user_unjam_cmd(struct dev_user_cmd *ucmd, int busy, + unsigned long *flags); +static void dev_user_unjam_dev(struct scst_user_dev *dev, int tm, + struct scst_tgt_dev *tgt_dev); + +static int dev_user_process_reply_tm_exec(struct dev_user_cmd *ucmd, + int status); +static int dev_user_process_reply_sess(struct dev_user_cmd *ucmd, int status); +static int dev_user_register_dev(struct file *file, + const struct scst_user_dev_desc *dev_desc); +static int __dev_user_set_opt(struct scst_user_dev *dev, + const struct scst_user_opt *opt); +static int dev_user_set_opt(struct file *file, const struct scst_user_opt *opt); +static int dev_user_get_opt(struct file *file, void *arg); + +static unsigned int dev_user_poll(struct file *filp, poll_table *wait); +static long dev_user_ioctl(struct file *file, unsigned int cmd, + unsigned long arg); +static int dev_user_release(struct inode *inode, struct file *file); + +/** Data **/ + +static struct kmem_cache *user_cmd_cachep; + +static DEFINE_MUTEX(dev_user_mutex); + +static struct file_operations dev_user_fops = { + .poll = dev_user_poll, + .unlocked_ioctl = dev_user_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = dev_user_ioctl, +#endif + .release = dev_user_release, +}; + +static struct class *dev_user_sysfs_class; + +static LIST_HEAD(dev_list); + +static spinlock_t cleanup_lock = SPIN_LOCK_UNLOCKED; +static LIST_HEAD(cleanup_list); +static DECLARE_WAIT_QUEUE_HEAD(cleanup_list_waitQ); +static struct task_struct *cleanup_thread; + +static inline void ucmd_get(struct dev_user_cmd *ucmd, int barrier) +{ + TRACE_DBG("ucmd %p, ucmd_ref %d", ucmd, atomic_read(&ucmd->ucmd_ref)); + atomic_inc(&ucmd->ucmd_ref); + if (barrier) + smp_mb__after_atomic_inc(); +} + +static inline void ucmd_put(struct dev_user_cmd *ucmd) +{ + TRACE_DBG("ucmd %p, ucmd_ref %d", ucmd, atomic_read(&ucmd->ucmd_ref)); + if (atomic_dec_and_test(&ucmd->ucmd_ref)) + dev_user_free_ucmd(ucmd); +} + +static inline int calc_num_pg(unsigned long buf, int len) +{ + len += buf & ~PAGE_MASK; + return (len >> PAGE_SHIFT) + ((len & ~PAGE_MASK) != 0); +} + +static inline int is_need_offs_page(unsigned long buf, int len) +{ + return ((buf & ~PAGE_MASK) != 0) && + ((buf & PAGE_MASK) != ((buf+len-1) & PAGE_MASK)); +} + +static void __dev_user_not_reg(void) +{ + PRINT_ERROR_PR("%s", "Device not registered"); + return; +} + +static inline int dev_user_check_reg(struct scst_user_dev *dev) +{ + if (dev == NULL) { + __dev_user_not_reg(); + return -EINVAL; + } + return 0; +} + +static inline int dev_user_cmd_hashfn(int h) +{ + return h & ((1 << DEV_USER_CMD_HASH_ORDER) - 1); +} + +static inline struct dev_user_cmd *__ucmd_find_hash(struct scst_user_dev *dev, + unsigned int h) +{ + struct list_head *head; + struct dev_user_cmd *ucmd; + + head = &dev->ucmd_hash[dev_user_cmd_hashfn(h)]; + list_for_each_entry(ucmd, head, hash_list_entry) { + if (ucmd->h == h) { + TRACE_DBG("Found ucmd %p", ucmd); + return ucmd; + } + } + return NULL; +} + +static void cmnd_insert_hash(struct dev_user_cmd *ucmd) +{ + struct list_head *head; + struct scst_user_dev *dev = ucmd->dev; + struct dev_user_cmd *u; + unsigned long flags; + + spin_lock_irqsave(&dev->cmd_lists.cmd_list_lock, flags); + do { + ucmd->h = dev->handle_counter++; + u = __ucmd_find_hash(dev, ucmd->h); + } while(u != NULL); + head = &dev->ucmd_hash[dev_user_cmd_hashfn(ucmd->h)]; + list_add_tail(&ucmd->hash_list_entry, head); + spin_unlock_irqrestore(&dev->cmd_lists.cmd_list_lock, flags); + + TRACE_DBG("Inserted ucmd %p, h=%d", ucmd, ucmd->h); + return; +} + +static inline void cmnd_remove_hash(struct dev_user_cmd *ucmd) +{ + unsigned long flags; + spin_lock_irqsave(&ucmd->dev->cmd_lists.cmd_list_lock, flags); + list_del(&ucmd->hash_list_entry); + spin_unlock_irqrestore(&ucmd->dev->cmd_lists.cmd_list_lock, flags); + + TRACE_DBG("Removed ucmd %p, h=%d", ucmd, ucmd->h); + return; +} + +static void dev_user_free_ucmd(struct dev_user_cmd *ucmd) +{ + TRACE_ENTRY(); + + TRACE_MEM("Freeing ucmd %p", ucmd); + + cmnd_remove_hash(ucmd); + EXTRACHECKS_BUG_ON(ucmd->cmd != NULL); + + kmem_cache_free(user_cmd_cachep, ucmd); + + TRACE_EXIT(); + return; +} + +static struct page *dev_user_alloc_pages(struct scatterlist *sg, + gfp_t gfp_mask, void *priv) +{ + struct dev_user_cmd *ucmd = (struct dev_user_cmd*)priv; + + TRACE_ENTRY(); + + /* *sg supposed to be zeroed */ + + TRACE_MEM("ucmd %p, ubuff %lx, ucmd->cur_data_page %d", ucmd, + ucmd->ubuff, ucmd->cur_data_page); + + if (ucmd->cur_data_page == 0) { + TRACE_MEM("ucmd->first_page_offset %d", + ucmd->first_page_offset); + sg->offset = ucmd->first_page_offset; + ucmd_get(ucmd, 0); + } + + if (ucmd->cur_data_page >= ucmd->num_data_pages) + goto out; + + sg->page = ucmd->data_pages[ucmd->cur_data_page]; + sg->length = PAGE_SIZE - sg->offset; + + ucmd->cur_data_page++; + + TRACE_MEM("page=%p, length=%d", sg->page, sg->length); + TRACE_BUFFER("Page data", page_address(sg->page), sg->length); + +out: + TRACE_EXIT(); + return sg->page; +} + +static void dev_user_on_cached_mem_free(struct dev_user_cmd *ucmd) +{ + TRACE_ENTRY(); + + TRACE_DBG("Preparing ON_CACHED_MEM_FREE (ucmd %p, h %d, ubuff %lx)", + ucmd, ucmd->h, ucmd->ubuff); + + ucmd->user_cmd.cmd_h = ucmd->h; + ucmd->user_cmd.subcode = SCST_USER_ON_CACHED_MEM_FREE; + ucmd->user_cmd.on_cached_mem_free.pbuf = ucmd->ubuff; + + ucmd->state = UCMD_STATE_ON_CACHE_FREEING; + + dev_user_add_to_ready(ucmd); + + TRACE_EXIT(); + return; +} + +static void dev_user_unmap_buf(struct dev_user_cmd *ucmd) +{ + int i; + + TRACE_ENTRY(); + + TRACE_MEM("Unmapping data pages (ucmd %p, ubuff %lx, num %d)", ucmd, + ucmd->ubuff, ucmd->num_data_pages); + + for(i = 0; i < ucmd->num_data_pages; i++) { + struct page *page = ucmd->data_pages[i]; + + if (ucmd->buf_dirty) + SetPageDirty(page); + + page_cache_release(page); + } + kfree(ucmd->data_pages); + ucmd->data_pages = NULL; + + TRACE_EXIT(); + return; +} + +static void dev_user_free_sg_entries(struct scatterlist *sg, int sg_count, + void *priv) +{ + struct dev_user_cmd *ucmd = (struct dev_user_cmd*)priv; + + TRACE_ENTRY(); + + sBUG_ON(ucmd->data_pages == NULL); + + TRACE_MEM("Freeing data pages (ucmd=%p, ubuff=%lx, sg=%p, sg_count=%d, " + "buff_cached=%d)", ucmd, ucmd->ubuff, sg, sg_count, + ucmd->buff_cached); + + dev_user_unmap_buf(ucmd); + + if (ucmd->buff_cached) + dev_user_on_cached_mem_free(ucmd); + else + ucmd_put(ucmd); + + TRACE_EXIT(); + return; +} + +static inline int is_buff_cached(struct dev_user_cmd *ucmd) +{ + int mem_reuse_type = ucmd->dev->memory_reuse_type; + + if ((mem_reuse_type == SCST_USER_MEM_REUSE_ALL) || + ((ucmd->cmd->data_direction == SCST_DATA_READ) && + (mem_reuse_type == SCST_USER_MEM_REUSE_READ)) || + ((ucmd->cmd->data_direction == SCST_DATA_WRITE) && + (mem_reuse_type == SCST_USER_MEM_REUSE_WRITE))) { + return 1; + } else + return 0; +} + +/* + * Returns 0 for success, <0 for fatal failure, >0 - need pages. + * Unmaps the buffer, if needed in case of error + */ +static int dev_user_alloc_sg(struct dev_user_cmd *ucmd, int cached_buff) +{ + int res = 0; + struct scst_cmd *cmd = ucmd->cmd; + struct scst_user_dev *dev = ucmd->dev; + int gfp_mask, flags = 0; + int bufflen = cmd->bufflen; + int last_len = 0; + + TRACE_ENTRY(); + + gfp_mask = __GFP_NOWARN; + gfp_mask |= (scst_cmd_atomic(cmd) ? GFP_ATOMIC : GFP_KERNEL); + + if (cached_buff) { + flags |= SCST_POOL_RETURN_OBJ_ON_ALLOC_FAIL; + if (ucmd->ubuff == 0) + flags |= SCST_POOL_NO_ALLOC_ON_CACHE_MISS; + } else { + TRACE_MEM("%s", "Not cached buff"); + flags |= SCST_POOL_ALLOC_NO_CACHED; + if (ucmd->ubuff == 0) { + res = 1; + goto out; + } + bufflen += ucmd->first_page_offset; + if (is_need_offs_page(ucmd->ubuff, cmd->bufflen)) + last_len = bufflen & ~PAGE_MASK; + else + last_len = cmd->bufflen & ~PAGE_MASK; + if (last_len == 0) + last_len = PAGE_SIZE; + } + ucmd->buff_cached = cached_buff; + + cmd->sg = sgv_pool_alloc(dev->pool, bufflen, gfp_mask, flags, + &cmd->sg_cnt, &ucmd->sgv, ucmd); + if (cmd->sg != NULL) { + struct dev_user_cmd *buf_ucmd = + (struct dev_user_cmd*)sgv_get_priv(ucmd->sgv); + + TRACE_MEM("Buf ucmd %p", buf_ucmd); + + ucmd->ubuff = buf_ucmd->ubuff; + ucmd->buf_ucmd = buf_ucmd; + + TRACE_MEM("Buf alloced (ucmd %p, cached_buff %d, ubuff %lx, " + "last_len %d, l %d)", ucmd, cached_buff, ucmd->ubuff, + last_len, cmd->sg[cmd->sg_cnt-1].length); + + EXTRACHECKS_BUG_ON((ucmd->data_pages != NULL) && + (ucmd != buf_ucmd)); + + if (last_len != 0) { + /* We don't use clustering, so the assignment is safe */ + cmd->sg[cmd->sg_cnt-1].length = last_len; + } + + if (unlikely(cmd->sg_cnt > cmd->tgt_dev->max_sg_cnt)) { + static int ll; + if (ll < 10) { + PRINT_INFO("Unable to complete command due to " + "SG IO count limitation (requested %d, " + "available %d, tgt lim %d)", cmd->sg_cnt, + cmd->tgt_dev->max_sg_cnt, + cmd->tgt->sg_tablesize); + ll++; + } + sgv_pool_free(ucmd->sgv); + ucmd->sgv = NULL; + cmd->sg = NULL; + res = -1; + } + } else { + TRACE_MEM("Buf not alloced (ucmd %p, h %d, buff_cached, %d, " + "sg_cnt %d, ubuff %lx, sgv %p", ucmd, ucmd->h, + ucmd->buff_cached, cmd->sg_cnt, ucmd->ubuff, ucmd->sgv); + if (unlikely(cmd->sg_cnt == 0)) { + res = -1; + if (ucmd->data_pages != NULL) + dev_user_unmap_buf(ucmd); + } else { + switch(ucmd->state & ~UCMD_STATE_MASK) { + case UCMD_STATE_BUF_ALLOCING: + res = 1; + break; + case UCMD_STATE_EXECING: + res = -1; + if (ucmd->data_pages != NULL) + dev_user_unmap_buf(ucmd); + break; + default: + sBUG(); + break; + } + } + } + +out: + TRACE_EXIT_RES(res); + return res; +} + +static int dev_user_alloc_space(struct dev_user_cmd *ucmd) +{ + int rc, res = SCST_CMD_STATE_DEFAULT; + struct scst_cmd *cmd = ucmd->cmd; + + TRACE_ENTRY(); + + ucmd->state = UCMD_STATE_BUF_ALLOCING; + cmd->data_buf_alloced = 1; + + rc = dev_user_alloc_sg(ucmd, is_buff_cached(ucmd)); + if (rc == 0) + goto out; + else if (rc < 0) { + scst_set_busy(cmd); + res = SCST_CMD_STATE_XMIT_RESP; + goto out; + } + + if ((cmd->data_direction != SCST_DATA_WRITE) && + !scst_is_cmd_local(cmd)) { + TRACE_DBG("Delayed alloc, ucmd %p", ucmd); + goto out; + } + + ucmd->user_cmd.cmd_h = ucmd->h; + ucmd->user_cmd.subcode = SCST_USER_ALLOC_MEM; + ucmd->user_cmd.alloc_cmd.sess_h = (unsigned long)cmd->tgt_dev; + memcpy(ucmd->user_cmd.alloc_cmd.cdb, cmd->cdb, + min(sizeof(ucmd->user_cmd.alloc_cmd.cdb), sizeof(cmd->cdb))); + ucmd->user_cmd.alloc_cmd.cdb_len = cmd->cdb_len; + ucmd->user_cmd.alloc_cmd.alloc_len = ucmd->buff_cached ? + (cmd->sg_cnt << PAGE_SHIFT) : cmd->bufflen; + ucmd->user_cmd.alloc_cmd.queue_type = cmd->queue_type; + ucmd->user_cmd.alloc_cmd.data_direction = cmd->data_direction; + + dev_user_add_to_ready(ucmd); + + res = SCST_CMD_STATE_STOP; + +out: + TRACE_EXIT_RES(res); + return res; +} + +static struct dev_user_cmd *dev_user_alloc_ucmd(struct scst_user_dev *dev, + int gfp_mask) +{ + struct dev_user_cmd *ucmd = NULL; + + TRACE_ENTRY(); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + ucmd = kmem_cache_alloc(user_cmd_cachep, gfp_mask); + if (ucmd != NULL) + memset(ucmd, 0, sizeof(*ucmd)); +#else + ucmd = kmem_cache_zalloc(user_cmd_cachep, gfp_mask); +#endif + if (unlikely(ucmd == NULL)) { + TRACE(TRACE_OUT_OF_MEM, "Unable to allocate " + "user cmd (gfp_mask %x)", gfp_mask); + goto out; + } + ucmd->dev = dev; + atomic_set(&ucmd->ucmd_ref, 1); + + cmnd_insert_hash(ucmd); + + TRACE_MEM("ucmd %p allocated", ucmd); + +out: + TRACE_EXIT_HRES((unsigned long)ucmd); + return ucmd; +} + +static int dev_user_get_block(struct scst_cmd *cmd) +{ + struct scst_user_dev *dev = (struct scst_user_dev*)cmd->dev->dh_priv; + /* + * No need for locks here, since *_detach() can not be + * called, when there are existing commands. + */ + TRACE_EXIT_RES(dev->block); + return dev->block; +} + +static int dev_user_parse(struct scst_cmd *cmd, struct scst_info_cdb *info_cdb) +{ + int rc, res = SCST_CMD_STATE_DEFAULT; + struct dev_user_cmd *ucmd; + int atomic = scst_cmd_atomic(cmd); + struct scst_user_dev *dev = (struct scst_user_dev*)cmd->dev->dh_priv; + int gfp_mask = atomic ? GFP_ATOMIC : GFP_KERNEL; + + TRACE_ENTRY(); + + if (cmd->dh_priv == NULL) { + ucmd = dev_user_alloc_ucmd(dev, gfp_mask); + if (unlikely(ucmd == NULL)) { + if (atomic) { + res = SCST_CMD_STATE_NEED_THREAD_CTX; + goto out; + } else { + scst_set_busy(cmd); + goto out_error; + } + } + ucmd->cmd = cmd; + cmd->dh_priv = ucmd; + } else { + ucmd = (struct dev_user_cmd*)cmd->dh_priv; + TRACE_DBG("Used ucmd %p, state %x", ucmd, ucmd->state); + } + + TRACE_DBG("ucmd %p, cmd %p, state %x", ucmd, cmd, ucmd->state); + + if (ucmd->state != UCMD_STATE_NEW) + goto alloc; + + switch(dev->parse_type) { + case SCST_USER_PARSE_STANDARD: + TRACE_DBG("PARSE STANDARD: ucmd %p", ucmd); + rc = dev->generic_parse(cmd, info_cdb, dev_user_get_block); + if ((rc != 0) || (info_cdb->flags & SCST_INFO_INVALID)) + goto out_invalid; + ucmd->cmd->skip_parse = 1; + break; + + case SCST_USER_PARSE_EXCEPTION: + TRACE_DBG("PARSE EXCEPTION: ucmd %p", ucmd); + rc = dev->generic_parse(cmd, info_cdb, dev_user_get_block); + if ((rc == 0) && (!(info_cdb->flags & SCST_INFO_INVALID))) { + ucmd->cmd->skip_parse = 1; + break; + } else if (rc == SCST_CMD_STATE_NEED_THREAD_CTX) { + TRACE_MEM("Restarting PARSE to thread context " + "(ucmd %p)", ucmd); + res = SCST_CMD_STATE_NEED_THREAD_CTX; + goto out; + } + /* else go through */ + + case SCST_USER_PARSE_CALL: + TRACE_DBG("Preparing PARSE for user space (ucmd=%p, h=%d, " + "bufflen %d)", ucmd, ucmd->h, cmd->bufflen); + ucmd->cmd->skip_parse = 1; + ucmd->user_cmd.cmd_h = ucmd->h; + ucmd->user_cmd.subcode = SCST_USER_PARSE; + ucmd->user_cmd.parse_cmd.sess_h = (unsigned long)cmd->tgt_dev; + memcpy(ucmd->user_cmd.parse_cmd.cdb, cmd->cdb, + min(sizeof(ucmd->user_cmd.parse_cmd.cdb), + sizeof(cmd->cdb))); + ucmd->user_cmd.parse_cmd.cdb_len = cmd->cdb_len; + ucmd->user_cmd.parse_cmd.timeout = cmd->timeout; + ucmd->user_cmd.parse_cmd.bufflen = cmd->bufflen; + ucmd->user_cmd.parse_cmd.queue_type = cmd->queue_type; + ucmd->user_cmd.parse_cmd.data_direction = cmd->data_direction; + ucmd->user_cmd.parse_cmd.expected_values_set = + cmd->expected_values_set; + ucmd->user_cmd.parse_cmd.expected_data_direction = + cmd->expected_data_direction; + ucmd->user_cmd.parse_cmd.expected_transfer_len = + cmd->expected_transfer_len; + ucmd->state = UCMD_STATE_PARSING; + dev_user_add_to_ready(ucmd); + res = SCST_CMD_STATE_STOP; + goto out; + + default: + sBUG(); + goto out; + } + +alloc: + if (cmd->data_direction != SCST_DATA_NONE) + res = dev_user_alloc_space(ucmd); + +out: + TRACE_EXIT_RES(res); + return res; + +out_invalid: + PRINT_ERROR_PR("PARSE failed (ucmd %p, rc %d, invalid %d)", ucmd, rc, + info_cdb->flags & SCST_INFO_INVALID); + scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_invalid_opcode)); + +out_error: + res = SCST_CMD_STATE_XMIT_RESP; + goto out; +} + +static void dev_user_flush_dcache(struct dev_user_cmd *ucmd) +{ + struct dev_user_cmd *buf_ucmd = ucmd->buf_ucmd; + unsigned long start = buf_ucmd->ubuff; + int i; + + TRACE_ENTRY(); + + if (start == 0) + goto out; + + for(i = 0; i < buf_ucmd->num_data_pages; i++) { + struct page *page; + page = buf_ucmd->data_pages[i]; +#ifdef ARCH_HAS_FLUSH_ANON_PAGE + struct vm_area_struct *vma = find_vma(current->mm, start); + if (vma != NULL) + flush_anon_page(vma, page, start); +#endif + flush_dcache_page(page); + start += PAGE_SIZE; + } + +out: + TRACE_EXIT(); + return; +} + +static int dev_user_exec(struct scst_cmd *cmd) +{ + struct dev_user_cmd *ucmd = (struct dev_user_cmd*)cmd->dh_priv; + + TRACE_ENTRY(); + + TRACE_DBG("Preparing EXEC for user space (ucmd=%p, h=%d, " + "bufflen %d, data_len %d, ubuff %lx)", ucmd, ucmd->h, + cmd->bufflen, cmd->data_len, ucmd->ubuff); + + if (cmd->data_direction == SCST_DATA_WRITE) + dev_user_flush_dcache(ucmd); + + ucmd->user_cmd.cmd_h = ucmd->h; + ucmd->user_cmd.subcode = SCST_USER_EXEC; + ucmd->user_cmd.exec_cmd.sess_h = (unsigned long)cmd->tgt_dev; + memcpy(ucmd->user_cmd.exec_cmd.cdb, cmd->cdb, + min(sizeof(ucmd->user_cmd.exec_cmd.cdb), + sizeof(cmd->cdb))); + ucmd->user_cmd.exec_cmd.cdb_len = cmd->cdb_len; + ucmd->user_cmd.exec_cmd.bufflen = cmd->bufflen; + ucmd->user_cmd.exec_cmd.data_len = cmd->data_len; + ucmd->user_cmd.exec_cmd.pbuf = ucmd->ubuff; + if ((ucmd->ubuff == 0) && (cmd->data_direction != SCST_DATA_NONE)) { + ucmd->user_cmd.exec_cmd.alloc_len = ucmd->buff_cached ? + (cmd->sg_cnt << PAGE_SHIFT) : cmd->bufflen; + } + ucmd->user_cmd.exec_cmd.queue_type = cmd->queue_type; + ucmd->user_cmd.exec_cmd.data_direction = cmd->data_direction; + ucmd->user_cmd.exec_cmd.partial = 0; + ucmd->user_cmd.exec_cmd.timeout = cmd->timeout; + + ucmd->state = UCMD_STATE_EXECING; + + dev_user_add_to_ready(ucmd); + + TRACE_EXIT(); + return SCST_EXEC_COMPLETED; +} + +static void dev_user_free_sgv(struct dev_user_cmd *ucmd) +{ + if (ucmd->sgv != NULL) { + sgv_pool_free(ucmd->sgv); + ucmd->sgv = NULL; + } +} + +static void dev_user_on_free_cmd(struct scst_cmd *cmd) +{ + struct dev_user_cmd *ucmd = (struct dev_user_cmd*)cmd->dh_priv; + + TRACE_ENTRY(); + + if (unlikely(ucmd == NULL)) + goto out; + + TRACE_DBG("ucmd %p, cmd %p, buff_cached %d, ubuff %lx", ucmd, ucmd->cmd, + ucmd->buff_cached, ucmd->ubuff); + + ucmd->cmd = NULL; + if ((cmd->data_direction == SCST_DATA_WRITE) && (ucmd->buf_ucmd != NULL)) + ucmd->buf_ucmd->buf_dirty = 1; + + if (ucmd->dev->on_free_cmd_type == SCST_USER_ON_FREE_CMD_IGNORE) { + ucmd->state = UCMD_STATE_ON_FREE_SKIPPED; + /* The state assignment must be before freeing sgv! */ + dev_user_free_sgv(ucmd); + ucmd_put(ucmd); + goto out; + } + + ucmd->user_cmd.cmd_h = ucmd->h; + ucmd->user_cmd.subcode = SCST_USER_ON_FREE_CMD; + + ucmd->user_cmd.on_free_cmd.pbuf = ucmd->ubuff; + ucmd->user_cmd.on_free_cmd.resp_data_len = cmd->resp_data_len; + ucmd->user_cmd.on_free_cmd.buffer_cached = ucmd->buff_cached; + ucmd->user_cmd.on_free_cmd.status = cmd->status; + + ucmd->state = UCMD_STATE_ON_FREEING; + + dev_user_add_to_ready(ucmd); + +out: + TRACE_EXIT(); + return; +} + +static void dev_user_set_block(struct scst_cmd *cmd, int block) +{ + struct scst_user_dev *dev = (struct scst_user_dev*)cmd->dev->dh_priv; + /* + * No need for locks here, since *_detach() can not be + * called, when there are existing commands. + */ + TRACE_DBG("dev %p, new block %d", dev, block); + if (block != 0) + dev->block = block; + else + dev->block = dev->def_block; + return; +} + +static int dev_user_disk_done(struct scst_cmd *cmd) +{ + int res = SCST_CMD_STATE_DEFAULT; + + TRACE_ENTRY(); + + res = scst_block_generic_dev_done(cmd, dev_user_set_block); + + TRACE_EXIT_RES(res); + return res; +} + +static int dev_user_tape_done(struct scst_cmd *cmd) +{ + int res = SCST_CMD_STATE_DEFAULT; + + TRACE_ENTRY(); + + res = scst_tape_generic_dev_done(cmd, dev_user_set_block); + + TRACE_EXIT_RES(res); + return res; +} + +static void dev_user_add_to_ready(struct dev_user_cmd *ucmd) +{ + struct scst_user_dev *dev = ucmd->dev; + unsigned long flags; + int do_wake; + + TRACE_ENTRY(); + + do_wake = (in_interrupt() || + (ucmd->state == UCMD_STATE_ON_CACHE_FREEING)); + if (ucmd->cmd) + do_wake |= ucmd->cmd->preprocessing_only; + + EXTRACHECKS_BUG_ON(ucmd->state & UCMD_STATE_JAMMED_MASK); + + spin_lock_irqsave(&dev->cmd_lists.cmd_list_lock, flags); + + /* Hopefully, compiler will make it as a single test/jmp */ + if (unlikely(dev->attach_cmd_active || dev->tm_cmd_active || + dev->internal_reset_active || dev->pre_unreg_sess_active || + (dev->detach_cmd_count != 0))) { + switch(ucmd->state) { + case UCMD_STATE_PARSING: + case UCMD_STATE_BUF_ALLOCING: + case UCMD_STATE_EXECING: + if (dev->pre_unreg_sess_active && + !(dev->attach_cmd_active || dev->tm_cmd_active || + dev->internal_reset_active || + (dev->detach_cmd_count != 0))) { + struct dev_user_pre_unreg_sess_obj *p, *found = NULL; + list_for_each_entry(p, &dev->pre_unreg_sess_list, + pre_unreg_sess_list_entry) { + if (p->tgt_dev == ucmd->cmd->tgt_dev) { + if (p->active) + found = p; + break; + } + } + if (found == NULL) { + TRACE_MGMT_DBG("No pre unreg sess " + "active (ucmd %p)", ucmd); + break; + } else { + TRACE(TRACE_MGMT, "Pre unreg sess %p " + "active (ucmd %p)", found, ucmd); + } + } + TRACE(TRACE_MGMT, "Mgmt cmd active, returning BUSY for " + "ucmd %p", ucmd); + dev_user_unjam_cmd(ucmd, 1, &flags); + spin_unlock_irqrestore(&dev->cmd_lists.cmd_list_lock, flags); + goto out; + } + } + + if (unlikely(ucmd->state == UCMD_STATE_TM_EXECING) || + unlikely(ucmd->state == UCMD_STATE_ATTACH_SESS) || + unlikely(ucmd->state == UCMD_STATE_DETACH_SESS)) { + if (dev->prio_queue_type == SCST_USER_PRIO_QUEUE_SEPARATE) { + TRACE_MGMT_DBG("Adding mgmt ucmd %p to prio ready cmd " + "list", ucmd); + list_add_tail(&ucmd->ready_cmd_list_entry, + &dev->prio_ready_cmd_list); + wake_up(&dev->prio_cmd_list_waitQ); + do_wake = 0; + } else { + TRACE_MGMT_DBG("Adding mgmt ucmd %p to ready cmd " + "list", ucmd); + list_add_tail(&ucmd->ready_cmd_list_entry, + &dev->ready_cmd_list); + do_wake = 1; + } + } else if ((ucmd->cmd != NULL) && + unlikely((ucmd->cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE))) { + TRACE_DBG("Adding ucmd %p to head ready cmd list", ucmd); + list_add(&ucmd->ready_cmd_list_entry, &dev->ready_cmd_list); + } else { + TRACE_DBG("Adding ucmd %p to ready cmd list", ucmd); + list_add_tail(&ucmd->ready_cmd_list_entry, &dev->ready_cmd_list); + } + + if (do_wake) { + TRACE_DBG("Waking up dev %p", dev); + wake_up(&dev->cmd_lists.cmd_list_waitQ); + } + + spin_unlock_irqrestore(&dev->cmd_lists.cmd_list_lock, flags); + +out: + TRACE_EXIT(); + return; +} + +static int dev_user_map_buf(struct dev_user_cmd *ucmd, unsigned long ubuff, + int num_pg) +{ + int res = 0, rc; + int i; + + TRACE_ENTRY(); + + if (unlikely(ubuff == 0)) + goto out_nomem; + + ucmd->num_data_pages = num_pg; + + ucmd->data_pages = kzalloc(sizeof(*ucmd->data_pages)*ucmd->num_data_pages, + GFP_KERNEL); + if (ucmd->data_pages == NULL) { + TRACE(TRACE_OUT_OF_MEM, "Unable to allocate data_pages array " + "(num_data_pages=%d)", ucmd->num_data_pages); + res = -ENOMEM; + goto out_nomem; + } + + TRACE_MEM("Mapping buffer (ucmd %p, ubuff %lx, ucmd->num_data_pages %d, " + "first_page_offset %d, len %d)", ucmd, ubuff, + ucmd->num_data_pages, (int)(ubuff & ~PAGE_MASK), + ucmd->cmd->bufflen); + + down_read(¤t->mm->mmap_sem); + rc = get_user_pages(current, current->mm, ubuff, ucmd->num_data_pages, + 1/*writable*/, 0/*don't force*/, ucmd->data_pages, NULL); + up_read(¤t->mm->mmap_sem); + + /* get_user_pages() flushes dcache */ + + if (rc < ucmd->num_data_pages) + goto out_unmap; + + ucmd->ubuff = ubuff; + ucmd->first_page_offset = (ubuff & ~PAGE_MASK); + +out: + TRACE_EXIT_RES(res); + return res; + +out_nomem: + scst_set_busy(ucmd->cmd); + /* go through */ + +out_err: + ucmd->cmd->state = SCST_CMD_STATE_XMIT_RESP; + goto out; + +out_unmap: + PRINT_ERROR_PR("Failed to get %d user pages (rc %d)", + ucmd->num_data_pages, rc); + if (rc > 0) { + for(i = 0; i < rc; i++) + page_cache_release(ucmd->data_pages[i]); + } + kfree(ucmd->data_pages); + ucmd->data_pages = NULL; + res = -EFAULT; + scst_set_cmd_error(ucmd->cmd, SCST_LOAD_SENSE(scst_sense_hardw_error)); + goto out_err; +} + +static int dev_user_process_reply_alloc(struct dev_user_cmd *ucmd, + struct scst_user_reply_cmd *reply) +{ + int res = 0; + struct scst_cmd *cmd = ucmd->cmd; + + TRACE_ENTRY(); + + TRACE_DBG("ucmd %p, pbuf %Lx", ucmd, reply->alloc_reply.pbuf); + + if (likely(reply->alloc_reply.pbuf != 0)) { + int pages; + if (ucmd->buff_cached) { + if (unlikely((reply->alloc_reply.pbuf & ~PAGE_MASK) != 0)) { + PRINT_ERROR_PR("Supplied pbuf %Lx isn't " + "page aligned", reply->alloc_reply.pbuf); + goto out_hwerr; + } + pages = cmd->sg_cnt; + } else + pages = calc_num_pg(reply->alloc_reply.pbuf, cmd->bufflen); + res = dev_user_map_buf(ucmd, reply->alloc_reply.pbuf, pages); + } else { + scst_set_busy(ucmd->cmd); + ucmd->cmd->state = SCST_CMD_STATE_XMIT_RESP; + } + +out_process: + scst_process_active_cmd(cmd, SCST_CONTEXT_DIRECT); + + TRACE_EXIT_RES(res); + return res; + +out_hwerr: + scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error)); + res = -EINVAL; + goto out_process; +} + +static int dev_user_process_reply_parse(struct dev_user_cmd *ucmd, + struct scst_user_reply_cmd *reply) +{ + int res = 0; + struct scst_user_scsi_cmd_reply_parse *preply = + &reply->parse_reply; + struct scst_cmd *cmd = ucmd->cmd; + + TRACE_ENTRY(); + + if (unlikely(preply->queue_type > SCST_CMD_QUEUE_ACA)) + goto out_inval; + + if (unlikely((preply->data_direction != SCST_DATA_WRITE) && + (preply->data_direction != SCST_DATA_READ) && + (preply->data_direction != SCST_DATA_NONE))) + goto out_inval; + + if (unlikely((preply->data_direction != SCST_DATA_NONE) && + (preply->bufflen == 0))) + goto out_inval; + + if (unlikely((preply->bufflen < 0) || (preply->data_len < 0))) + goto out_inval; + + TRACE_DBG("ucmd %p, queue_type %x, data_direction, %x, bufflen %d, " + "data_len %d, pbuf %Lx", ucmd, preply->queue_type, + preply->data_direction, preply->bufflen, preply->data_len, + reply->alloc_reply.pbuf); + + cmd->queue_type = preply->queue_type; + cmd->data_direction = preply->data_direction; + cmd->bufflen = preply->bufflen; + cmd->data_len = preply->data_len; + +out_process: + scst_process_active_cmd(cmd, SCST_CONTEXT_DIRECT); + + TRACE_EXIT_RES(res); + return res; + +out_inval: + PRINT_ERROR_PR("%s", "Invalid parse_reply parameter(s)"); + scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error)); + res = -EINVAL; + goto out_process; +} + +static int dev_user_process_reply_on_free(struct dev_user_cmd *ucmd) +{ + int res = 0; + + TRACE_ENTRY(); + + TRACE_DBG("ON FREE ucmd %p", ucmd); + + dev_user_free_sgv(ucmd); + ucmd_put(ucmd); + + TRACE_EXIT_RES(res); + return res; +} + +static int dev_user_process_reply_on_cache_free(struct dev_user_cmd *ucmd) +{ + int res = 0; + + TRACE_ENTRY(); + + TRACE_DBG("ON CACHE FREE ucmd %p", ucmd); + + ucmd_put(ucmd); + + TRACE_EXIT_RES(res); + return res; +} + +static int dev_user_process_reply_exec(struct dev_user_cmd *ucmd, + struct scst_user_reply_cmd *reply) +{ + int res = 0; + struct scst_user_scsi_cmd_reply_exec *ereply = + &reply->exec_reply; + struct scst_cmd *cmd = ucmd->cmd; + + TRACE_ENTRY(); + + if (ereply->reply_type == SCST_EXEC_REPLY_COMPLETED) { + if (ucmd->background_exec) { + TRACE_DBG("Background ucmd %p finished", ucmd); + ucmd_put(ucmd); + goto out; + } + if (unlikely(ereply->resp_data_len > cmd->bufflen)) + goto out_inval; + if (unlikely((cmd->data_direction != SCST_DATA_READ) && + (ereply->resp_data_len != 0))) + goto out_inval; + } else if (ereply->reply_type == SCST_EXEC_REPLY_BACKGROUND) { + if (unlikely(ucmd->background_exec)) + goto out_inval; + if (unlikely((cmd->data_direction == SCST_DATA_READ) || + (cmd->resp_data_len != 0))) + goto out_inval; + ucmd_get(ucmd, 1); + ucmd->background_exec = 1; + TRACE_DBG("Background ucmd %p", ucmd); + goto out_compl; + } else + goto out_inval; + + TRACE_DBG("ucmd %p, status %d, resp_data_len %d", ucmd, + ereply->status, ereply->resp_data_len); + + if (ereply->resp_data_len != 0) { + if (ucmd->ubuff == 0) { + int pages, rc; + if (unlikely(ereply->pbuf == 0)) + goto out_busy; + if (ucmd->buff_cached) { + if (unlikely((ereply->pbuf & ~PAGE_MASK) != 0)) { + PRINT_ERROR_PR("Supplied pbuf %Lx isn't " + "page aligned", ereply->pbuf); + goto out_hwerr; + } + pages = cmd->sg_cnt; + } else + pages = calc_num_pg(ereply->pbuf, cmd->bufflen); + rc = dev_user_map_buf(ucmd, ereply->pbuf, pages); + if ((rc != 0) || (ucmd->ubuff == 0)) + goto out_compl; + + rc = dev_user_alloc_sg(ucmd, ucmd->buff_cached); + if (unlikely(rc != 0)) + goto out_busy; + } else + dev_user_flush_dcache(ucmd); + cmd->may_need_dma_sync = 1; + scst_set_resp_data_len(cmd, ereply->resp_data_len); + } else if (cmd->resp_data_len != ereply->resp_data_len) { + if (ucmd->ubuff == 0) + cmd->resp_data_len = ereply->resp_data_len; + else + scst_set_resp_data_len(cmd, ereply->resp_data_len); + } + + cmd->status = ereply->status; + if (ereply->sense_len != 0) { + res = copy_from_user(cmd->sense_buffer, + (void*)(unsigned long)ereply->psense_buffer, + min(sizeof(cmd->sense_buffer), + (unsigned int)ereply->sense_len)); + if (res < 0) { + PRINT_ERROR_PR("%s", "Unable to get sense data"); + goto out_hwerr_res_set; + } + } + +out_compl: + cmd->completed = 1; + cmd->scst_cmd_done(cmd, SCST_CMD_STATE_DEFAULT); + +out: + TRACE_EXIT_RES(res); + return res; + +out_inval: + PRINT_ERROR_PR("%s", "Invalid exec_reply parameter(s)"); + +out_hwerr: + res = -EINVAL; + +out_hwerr_res_set: + if (ucmd->background_exec) { + ucmd_put(ucmd); + goto out; + } else { + scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error)); + goto out_compl; + } + +out_busy: + scst_set_busy(cmd); + goto out_compl; +} + +static int dev_user_process_reply(struct scst_user_dev *dev, + struct scst_user_reply_cmd *reply) +{ + int res = 0; + struct dev_user_cmd *ucmd; + int state; + + TRACE_ENTRY(); + + spin_lock_irq(&dev->cmd_lists.cmd_list_lock); + + ucmd = __ucmd_find_hash(dev, reply->cmd_h); + if (ucmd == NULL) { + TRACE_MGMT_DBG("cmd_h %d not found", reply->cmd_h); + res = -ESRCH; + goto out_unlock; + } + + if (ucmd->background_exec) { + state = UCMD_STATE_EXECING; + goto unlock_process; + } + + if (unlikely(!(ucmd->state & UCMD_STATE_SENT_MASK))) { + if (ucmd->state & UCMD_STATE_JAMMED_MASK) { + TRACE_MGMT_DBG("Reply on jammed ucmd %p, ignoring", + ucmd); + } else { + TRACE_MGMT_DBG("Ucmd %p isn't in the sent to user " + "state %x", ucmd, ucmd->state); + res = -EBUSY; + } + goto out_unlock; + } + + if (unlikely(reply->subcode != ucmd->user_cmd.subcode)) + goto out_wrong_state; + + if (unlikely(_IOC_NR(reply->subcode) != + (ucmd->state & ~UCMD_STATE_SENT_MASK))) + goto out_wrong_state; + + ucmd->state &= ~UCMD_STATE_SENT_MASK; + state = ucmd->state; + ucmd->state |= UCMD_STATE_RECV_MASK; + +unlock_process: + spin_unlock_irq(&dev->cmd_lists.cmd_list_lock); + + switch(state) { + case UCMD_STATE_PARSING: + res = dev_user_process_reply_parse(ucmd, reply); + break; + + case UCMD_STATE_BUF_ALLOCING: + res = dev_user_process_reply_alloc(ucmd, reply); + break; + + case UCMD_STATE_EXECING: + res = dev_user_process_reply_exec(ucmd, reply); + break; + + case UCMD_STATE_ON_FREEING: + res = dev_user_process_reply_on_free(ucmd); + break; + + case UCMD_STATE_ON_CACHE_FREEING: + res = dev_user_process_reply_on_cache_free(ucmd); + break; + + case UCMD_STATE_TM_EXECING: + res = dev_user_process_reply_tm_exec(uc... [truncated message content] |
From: <vl...@us...> - 2007-08-07 17:12:43
|
Revision: 156 http://scst.svn.sourceforge.net/scst/?rev=156&view=rev Author: vlnb Date: 2007-08-07 10:12:21 -0700 (Tue, 07 Aug 2007) Log Message: ----------- - Implemented temporary workaround to work on 2.6.22+ kernels - qla2x00-target/ChangeLog updated - Typo in scst_page.html fixed Modified Paths: -------------- trunk/qla2x00t/qla2x00-target/ChangeLog trunk/scst/src/scst_mem.c trunk/www/scst_page.html Modified: trunk/qla2x00t/qla2x00-target/ChangeLog =================================================================== --- trunk/qla2x00t/qla2x00-target/ChangeLog 2007-08-03 09:57:15 UTC (rev 155) +++ trunk/qla2x00t/qla2x00-target/ChangeLog 2007-08-07 17:12:21 UTC (rev 156) @@ -3,12 +3,15 @@ - Support for per-target default security groups added. - - Update to work on 2.6.19.x. + - Update to work on the latest kernel (2.6.22.x). - Updated to work with SCST 0.9.6. + - /proc support routines changed to work with seq_file interface. + - Cleanups and minor bug fixes. + Summary of changes between versions 0.9.3.8 and 0.9.5 ----------------------------------------------------- Modified: trunk/scst/src/scst_mem.c =================================================================== --- trunk/scst/src/scst_mem.c 2007-08-03 09:57:15 UTC (rev 155) +++ trunk/scst/src/scst_mem.c 2007-08-07 17:12:21 UTC (rev 156) @@ -42,16 +42,17 @@ */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) -#error 2.6.22+ kernels are not supported yet, because some oversmart nerd \ -has deleted support for destructors from SLABs in those kernels and was \ -unresponsible enough to made that without even set it in the deprecated \ -status for some time to allow depending on it projects fix it without \ -disturbing their users. Blame him for that! So, now to be usable on \ -2.6.22+ kernels SCST requires a complete rewrite of one of its major low \ +#warning SCST on 2.6.22+ kernels will run in performance degraded mode, \ +because some oversmart mainline kernel developers have deleted in those \ +kernels support for destructors in SLAB cache and they were unresponsible \ +enough to made that change without even set that feature in the deprecated \ +status for some time to allow depending on it projects to fix themself without \ +disturbing their users. Blame those people for that! So, now to run in full \ +power on those kernels SCST requires a complete rewrite of one of its major low \ level parts: all kmem_cache_*() functions in this file should be replaced \ with new ones with similar functionality. I'm not sure I will have time for \ -that in the near future, therefore you are welcome to implement that. \ -Don't hesitate to ask me how to do it most effectively. VLNB. +that in the near future, therefore you are welcome to implement it. Don't \ +hesitate to ask me how I think it should be done most effectively. VLNB. #endif /* Chosen to have one page per slab for all orders */ @@ -68,6 +69,10 @@ DEFINE_MUTEX(scst_sgv_pool_mutex); LIST_HEAD(scst_sgv_pool_list); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) +static void sgv_dtor(void *data, struct kmem_cache *k, unsigned long f); +#endif + static int scst_check_clustering(struct scatterlist *sg, int cur, int hint) { int res = -1; @@ -481,9 +486,12 @@ } out_fail_free: - if (cache) + if (cache) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) + sgv_dtor(obj, NULL, 0); +#endif kmem_cache_free(pool->caches[order], obj); - else + } else kfree(obj); out_fail: @@ -505,8 +513,12 @@ "sg_count %d, allocator_priv %p", sgv, sgv->owner_cache, sgv->sg_entries, sgv->sg_count, sgv->allocator_priv); if (sgv->owner_cache != NULL) { + struct kmem_cache *c = sgv->owner_cache; sgv->sg_entries[sgv->orig_sg].length = sgv->orig_length; - kmem_cache_free(sgv->owner_cache, sgv); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) + sgv_dtor(sgv, NULL, 0); +#endif + kmem_cache_free(c, sgv); } else { sgv->owner_pool->alloc_fns.free_pages_fn(sgv->sg_entries, sgv->sg_count, sgv->allocator_priv); @@ -545,6 +557,9 @@ } kfree(obj->sg_entries); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) + memset(obj, 0, sizeof(*obj)); +#endif return; } @@ -635,8 +650,13 @@ scnprintf(pool->cache_names[i], sizeof(pool->cache_names[i]), "%s-%luK", name, (PAGE_SIZE >> 10) << i); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) pool->caches[i] = kmem_cache_create(pool->cache_names[i], + size, 0, SCST_SLAB_FLAGS, sgv_ctor, NULL); +#else + pool->caches[i] = kmem_cache_create(pool->cache_names[i], size, 0, SCST_SLAB_FLAGS, sgv_ctor, sgv_dtor); +#endif if (pool->caches[i] == NULL) { TRACE(TRACE_OUT_OF_MEM, "Allocation of sgv_pool cache " "%s(%d) failed", name, i); Modified: trunk/www/scst_page.html =================================================================== --- trunk/www/scst_page.html 2007-08-03 09:57:15 UTC (rev 155) +++ trunk/www/scst_page.html 2007-08-07 17:12:21 UTC (rev 156) @@ -92,8 +92,6 @@ </li> <li> Complete SMP support.<br> </li> - <li> <br> - </li> <li>Well documented.<br> </li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-08-29 09:52:10
|
Revision: 174 http://scst.svn.sourceforge.net/scst/?rev=174&view=rev Author: vlnb Date: 2007-08-29 02:52:07 -0700 (Wed, 29 Aug 2007) Log Message: ----------- Minor changes based on comments from Tomasz Chmielewski <ma...@wp...>, Benjamin Yates <ben...@rq...> and Andy <And...@ao...> Modified Paths: -------------- trunk/Makefile trunk/iscsi-scst/etc/scst.conf trunk/iscsi-scst/kernel/iscsi.c trunk/scst/src/scst_main.c trunk/scst/src/scst_mem.c trunk/scst/src/scst_mem.h trunk/scst/src/scst_targ.c Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2007-08-28 17:32:31 UTC (rev 173) +++ trunk/Makefile 2007-08-29 09:52:07 UTC (rev 174) @@ -27,6 +27,46 @@ ISCSI_DIR=iscsi-scst #ISCSI_DISTDIR=../../../../iscsi_scst_inst +help: + @echo " all : make all" + @echo " clean : clean files" + @echo " extraclean : clean + clean dependencies" + @echo " install : install" + @echo " uninstall : uninstall" + @echo "" + @echo " scst : make scst only" + @echo " scst_clean : scst: clean " + @echo " scst_extraclean : scst: clean + clean dependencies" + @echo " scst_install : scst: install" + @echo " scst_uninstall : scst: uninstall" + @echo "" + @echo " qla : make QLA target driver" + @echo " qla_clean : 2.6 qla target: clean " + @echo " qla_extraclean : 2.6 qla target: clean + clean dependencies" + @echo " qla_install : 2.6 qla target: install" + @echo " qla_uninstall : 2.6 qla target: uninstall" + @echo "" + @echo " iscsi : make iSCSI target" + @echo " iscsi_clean : ISCSI target: clean " + @echo " iscsi_extraclean : ISCSI target: clean + clean dependencies" + @echo " iscsi_install : ISCSI target: install" + @echo " iscsi_uninstall : ISCSI target: uninstall" + @echo "" + @echo " lsi : make LSI MPT target" + @echo " lsi_clean : lsi target: clean " + @echo " lsi_extraclean : lsi target: clean + clean dependencies" + @echo " lsi_install : lsi target: install" + @echo " lsi_uninstall : lsi target: uninstall" + @echo "" + @echo " usr : make user space fileio_tgt target" + @echo " usr_clean : usr target: clean " + @echo " usr_extraclean : usr target: clean + clean dependencies" + @echo " usr_install : usr target: install" + @echo " usr_uninstall : usr target: uninstall" + + @echo " Note:" + @echo " - install and uninstall may need root privileges" + all: cd $(SCST_DIR) && $(MAKE) $@ @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi @@ -141,45 +181,6 @@ usr_extraclean: cd $(USR_DIR) && $(MAKE) extraclean -help: - @echo " all (the default) : make all" - @echo " clean : clean files" - @echo " extraclean : clean + clean dependencies" - @echo " install : install" - @echo " uninstall : uninstall" - @echo "" - @echo " scst : make scst only" - @echo " scst_clean : scst: clean " - @echo " scst_extraclean : scst: clean + clean dependencies" - @echo " scst_install : scst: install" - @echo " scst_uninstall : scst: uninstall" - @echo "" - @echo " qla : make new qla target using 2.6.x kernel qla2xxx" - @echo " qla_clean : 2.6 qla target: clean " - @echo " qla_extraclean : 2.6 qla target: clean + clean dependencies" - @echo " qla_install : 2.6 qla target: install" - @echo " qla_uninstall : 2.6 qla target: uninstall" - @echo "" - @echo " iscsi : make new ISCSI target" - @echo " iscsi_clean : ISCSI target: clean " - @echo " iscsi_extraclean : ISCSI target: clean + clean dependencies" - @echo " iscsi_install : ISCSI target: install" - @echo " iscsi_uninstall : ISCSI target: uninstall" - @echo "" - @echo " lsi : make lsi target" - @echo " lsi_clean : lsi target: clean " - @echo " lsi_extraclean : lsi target: clean + clean dependencies" - @echo " lsi_install : lsi target: install" - @echo " lsi_uninstall : lsi target: uninstall" - @echo "" - @echo " usr : make usr target" - @echo " usr_clean : usr target: clean " - @echo " usr_extraclean : usr target: clean + clean dependencies" - @echo " usr_install : usr target: install" - @echo " usr_uninstall : usr target: uninstall" - @echo " Notes :" - @echo " - install and uninstall must be made as root" - .PHONY: all install uninstall clean extraclean help \ qla qla_install qla_uninstall qla_clean qla_extraclean \ lsi lsi_install lsi_uninstall lsi_clean lsi_extraclean \ Modified: trunk/iscsi-scst/etc/scst.conf =================================================================== --- trunk/iscsi-scst/etc/scst.conf 2007-08-28 17:32:31 UTC (rev 173) +++ trunk/iscsi-scst/etc/scst.conf 2007-08-29 09:52:07 UTC (rev 174) @@ -1,8 +1,8 @@ [HANDLER vdisk] #DEVICE <vdisk name>,<device path>,<options>,<block size> DEVICE disk1,/path/disk1,,512 -DEVICE hdc1,/dev/hdc1,BIO,512 -DEVICE nullio,none,NIO,1024 +DEVICE hdc1,/dev/hdc1,BLOCKIO,512 +DEVICE nullio,none,NULLIO,1024 [HANDLER vcdrom] #DEVICE <vdisk name>,<device path> Modified: trunk/iscsi-scst/kernel/iscsi.c =================================================================== --- trunk/iscsi-scst/kernel/iscsi.c 2007-08-28 17:32:31 UTC (rev 173) +++ trunk/iscsi-scst/kernel/iscsi.c 2007-08-29 09:52:07 UTC (rev 174) @@ -24,9 +24,9 @@ #include "digest.h" #ifndef NET_PAGE_CALLBACKS_DEFINED -#warning Patch put_page_callback.patch not applied on your kernel. ISCSI-SCST \ - will run in the performance degraded mode. Refer README file for \ - details. +#warning Patch put_page_callback-<kernel-version>.patch not applied on your \ + kernel. ISCSI-SCST will run in the performance degraded mode. Refer \ + README file for details. #endif #define ISCSI_INIT_WRITE_WAKE 0x1 @@ -2425,9 +2425,9 @@ goto out; } #else - PRINT_INFO_PR("%s", "Patch put_page_callback.patch not applied on your " - "kernel. Running in the performance degraded mode. Refer " - "README file for details"); + PRINT_INFO_PR("%s", "Patch put_page_callback-<kernel-version>.patch " + "not applied on your kernel. Running in the performance " + "degraded mode. Refer README file for details"); #endif BUILD_BUG_ON(MAX_DATA_SEG_LEN != (ISCSI_CONN_IOV_MAX<<PAGE_SHIFT)); Modified: trunk/scst/src/scst_main.c =================================================================== --- trunk/scst/src/scst_main.c 2007-08-28 17:32:31 UTC (rev 173) +++ trunk/scst/src/scst_main.c 2007-08-29 09:52:07 UTC (rev 174) @@ -1,5 +1,5 @@ /* - * scst.c + * scst_main.c * * Copyright (C) 2004-2007 Vladislav Bolkhovitin <vs...@vl...> * and Leonid Stoljar @@ -47,9 +47,9 @@ #endif #if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && !defined(STRICT_SERIALIZING) -#warning Patch scst_exec_req_fifo.patch was not applied on your kernel and \ - STRICT_SERIALIZING isn't defined. Pass-through dev handlers will \ - not be supported. +#warning Patch scst_exec_req_fifo-<kernel-version>.patch was not applied on \ + your kernel and STRICT_SERIALIZING isn't defined. Pass-through dev \ + handlers will not be supported. #endif /* @@ -756,8 +756,8 @@ if (dev_type->exec == NULL) { PRINT_ERROR_PR("Pass-through dev handlers (handler \"%s\") not " "supported. Consider applying on your kernel patch " - "scst_exec_req_fifo.patch or define STRICT_SERIALIZING", - dev_type->name); + "scst_exec_req_fifo-<kernel-version>.patch or define " + "STRICT_SERIALIZING", dev_type->name); res = -EINVAL; goto out_err; } Modified: trunk/scst/src/scst_mem.c =================================================================== --- trunk/scst/src/scst_mem.c 2007-08-28 17:32:31 UTC (rev 173) +++ trunk/scst/src/scst_mem.c 2007-08-29 09:52:07 UTC (rev 174) @@ -1,5 +1,5 @@ /* - * scst_sgv_pool.c + * scst_mem.c * * Copyright (C) 2006-2007 Vladislav Bolkhovitin <vs...@vl...> * @@ -43,16 +43,14 @@ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) #warning SCST on 2.6.22+ kernels will run in performance degraded mode, \ -because some oversmart mainline kernel developers have deleted in those \ -kernels support for destructors in SLAB cache and they were unresponsible \ -enough to made that change without even set that feature in the deprecated \ -status for some time to allow depending on it projects to fix themself without \ -disturbing their users. Blame those people for that! So, now to run in full \ -power on those kernels SCST requires a complete rewrite of one of its major low \ -level parts: all kmem_cache_*() functions in this file should be replaced \ -with new ones with similar functionality. I'm not sure I will have time for \ -that in the near future, therefore you are welcome to implement it. Don't \ -hesitate to ask me how I think it should be done most effectively. VLNB. +because some unresponsible mainline kernel developers have deleted in those \ +kernels support for destructors in SLAB cache and made that change without \ +even set that feature in the deprecated status for some time to allow \ +depending on it projects to fix themself without disturbing their users. \ +Blame those people for that! So, now to run in full power on those kernels \ +SCST requires a complete rewrite of one of its major low level parts: all \ +kmem_cache_*() functions in this file should be replaced with new ones with \ +similar functionality. #endif /* Chosen to have one page per slab for all orders */ Modified: trunk/scst/src/scst_mem.h =================================================================== --- trunk/scst/src/scst_mem.h 2007-08-28 17:32:31 UTC (rev 173) +++ trunk/scst/src/scst_mem.h 2007-08-29 09:52:07 UTC (rev 174) @@ -1,5 +1,5 @@ /* - * scst_sgv_pool.h + * scst_mem.h * * Copyright (C) 2006-2007 Vladislav Bolkhovitin <vs...@vl...> * Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2007-08-28 17:32:31 UTC (rev 173) +++ trunk/scst/src/scst_targ.c 2007-08-29 09:52:07 UTC (rev 174) @@ -2739,17 +2739,17 @@ cmd->state = SCST_CMD_STATE_DEV_PARSE; cnt = atomic_inc_return(&cmd->tgt_dev->tgt_dev_cmd_count); if (unlikely(cnt > SCST_MAX_TGT_DEV_COMMANDS)) { - TRACE(TRACE_RETRY, "Too many pending commands in " + TRACE(TRACE_RETRY, "Too many pending commands (%d) in " "session, returning BUSY to initiator \"%s\"", - (cmd->sess->initiator_name[0] == '\0') ? + cnt, (cmd->sess->initiator_name[0] == '\0') ? "Anonymous" : cmd->sess->initiator_name); goto out_busy; } cnt = atomic_inc_return(&cmd->dev->dev_cmd_count); if (unlikely(cnt > SCST_MAX_DEV_COMMANDS)) { - TRACE(TRACE_RETRY, "Too many pending device commands, " - "returning BUSY to initiator \"%s\"", - (cmd->sess->initiator_name[0] == '\0') ? + TRACE(TRACE_RETRY, "Too many pending device commands " + "(%d), returning BUSY to initiator \"%s\"", + cnt, (cmd->sess->initiator_name[0] == '\0') ? "Anonymous" : cmd->sess->initiator_name); goto out_busy; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-08-29 15:07:45
|
Revision: 175 http://scst.svn.sourceforge.net/scst/?rev=175&view=rev Author: vlnb Date: 2007-08-29 08:07:40 -0700 (Wed, 29 Aug 2007) Log Message: ----------- - Fixed make headers_check problem, reported by Doug Dumitru <do...@ea...> - Improved rebuilt warning as suggested by Tomasz Chmielewski <ma...@wp...> - Minor cleanups Modified Paths: -------------- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.16.patch trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.18.patch trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.21.patch trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.22.patch trunk/scst/README trunk/scst/src/Makefile Modified: trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.16.patch =================================================================== --- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.16.patch 2007-08-29 09:52:07 UTC (rev 174) +++ trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.16.patch 2007-08-29 15:07:40 UTC (rev 175) @@ -19,15 +19,15 @@ #define page_private(page) ((page)->private) diff -upr linux-2.6.16.29/include/linux/net.h linux-2.6.16.29/include/linux/net.h --- linux-2.6.16.29/include/linux/net.h 2006-09-12 22:02:10.000000000 +0400 -+++ linux-2.6.16.29/include/linux/net.h 2007-08-07 19:55:27.000000000 +0400 -@@ -22,6 +22,7 @@ - #include <linux/wait.h> - #include <linux/stringify.h> - #include <asm/socket.h> ++++ linux-2.6.16.29/include/linux/net.h 2007-08-29 18:31:40.000000000 +0400 +@@ -57,6 +57,7 @@ typedef enum { + #define __SO_ACCEPTCON (1 << 16) /* performed a listen */ + + #ifdef __KERNEL__ +#include <linux/mm.h> - struct poll_table_struct; - struct inode; + #define SOCK_ASYNC_NOSPACE 0 + #define SOCK_ASYNC_WAITDATA 1 @@ -294,5 +295,30 @@ extern int net_msg_cost; extern int net_msg_burst; #endif Modified: trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.18.patch =================================================================== --- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.18.patch 2007-08-29 09:52:07 UTC (rev 174) +++ trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.18.patch 2007-08-29 15:07:40 UTC (rev 175) @@ -19,15 +19,15 @@ #define page_private(page) ((page)->private) diff -upr linux-2.6.18.1/include/linux/net.h linux-2.6.18.1/include/linux/net.h --- linux-2.6.18.1/include/linux/net.h 2006-09-20 07:42:06.000000000 +0400 -+++ linux-2.6.18.1/include/linux/net.h 2007-08-07 19:35:51.000000000 +0400 -@@ -19,6 +19,7 @@ - #define _LINUX_NET_H ++++ linux-2.6.18.1/include/linux/net.h 2007-08-29 18:28:21.000000000 +0400 +@@ -56,6 +56,7 @@ typedef enum { - #include <linux/wait.h> + #ifdef __KERNEL__ + #include <linux/stringify.h> +#include <linux/mm.h> - #include <asm/socket.h> - struct poll_table_struct; + #define SOCK_ASYNC_NOSPACE 0 + #define SOCK_ASYNC_WAITDATA 1 @@ -304,5 +305,30 @@ extern int net_msg_cost; extern int net_msg_burst; #endif Modified: trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.21.patch =================================================================== --- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.21.patch 2007-08-29 09:52:07 UTC (rev 174) +++ trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.21.patch 2007-08-29 15:07:40 UTC (rev 175) @@ -19,15 +19,15 @@ #endif /* _LINUX_MM_TYPES_H */ diff -upr linux-2.6.21.1/include/linux/net.h linux-2.6.21.1/include/linux/net.h --- linux-2.6.21.1/include/linux/net.h 2007-04-28 01:49:26.000000000 +0400 -+++ linux-2.6.21.1/include/linux/net.h 2007-07-24 19:09:40.000000000 +0400 -@@ -19,6 +19,7 @@ - #define _LINUX_NET_H - - #include <linux/wait.h> ++++ linux-2.6.21.1/include/linux/net.h 2007-08-29 14:57:06.000000000 +0400 +@@ -57,6 +57,7 @@ typedef enum { + #ifdef __KERNEL__ + #include <linux/stringify.h> + #include <linux/random.h> +#include <linux/mm.h> - #include <asm/socket.h> - struct poll_table_struct; + #define SOCK_ASYNC_NOSPACE 0 + #define SOCK_ASYNC_WAITDATA 1 @@ -319,5 +320,30 @@ extern int net_msg_cost; extern int net_msg_burst; #endif Modified: trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.22.patch =================================================================== --- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.22.patch 2007-08-29 09:52:07 UTC (rev 174) +++ trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.22.patch 2007-08-29 15:07:40 UTC (rev 175) @@ -19,15 +19,15 @@ #endif /* _LINUX_MM_TYPES_H */ diff -upr linux-2.6.22/include/linux/net.h linux-2.6.22/include/linux/net.h --- linux-2.6.22/include/linux/net.h 2007-07-09 03:32:17.000000000 +0400 -+++ linux-2.6.22/include/linux/net.h 2007-08-07 19:12:10.000000000 +0400 -@@ -19,6 +19,7 @@ - #define _LINUX_NET_H - - #include <linux/wait.h> ++++ linux-2.6.22/include/linux/net.h 2007-08-29 18:18:56.000000000 +0400 +@@ -57,6 +57,7 @@ typedef enum { + #ifdef __KERNEL__ + #include <linux/stringify.h> + #include <linux/random.h> +#include <linux/mm.h> - #include <asm/socket.h> - struct poll_table_struct; + #define SOCK_ASYNC_NOSPACE 0 + #define SOCK_ASYNC_WAITDATA 1 @@ -319,5 +320,30 @@ extern int net_msg_cost; extern int net_msg_burst; #endif Modified: trunk/scst/README =================================================================== --- trunk/scst/README 2007-08-29 09:52:07 UTC (rev 174) +++ trunk/scst/README 2007-08-29 15:07:40 UTC (rev 175) @@ -59,13 +59,14 @@ kernel if you don't need pass-through support or STRICT_SERIALIZING is defined during the compilation (see description below). -To compile SCST type 'make'. It will build SCST itself and its device -handlers. To install them type 'make install'. The driver modules will -be installed in '/lib/modules/`you_kernel_version`/extra'. In addition, -scsi_tgt.h, scst_debug.h as well as Module.symvers or Modules.symvers -will be copied to '/usr/local/include/scst'. The first file contains all -SCST's public data definition, which are used by target drivers. The -other ones support debug messages logging and build process. +To compile SCST type 'make scst'. It will build SCST itself and its +device handlers. To install them type 'make scst_install'. The driver +modules will be installed in '/lib/modules/`you_kernel_version`/extra'. +In addition, scsi_tgt.h, scst_debug.h as well as Module.symvers or +Modules.symvers will be copied to '/usr/local/include/scst'. The first +file contains all SCST's public data definition, which are used by +target drivers. The other ones support debug messages logging and build +process. Then you can load any module by typing 'modprobe module_name'. The names are: @@ -94,6 +95,16 @@ 'echo "scsi add-single-device A 0 0 B" >/proc/scsi/scsi', where A - is the host number, B - LUN. +IMPORTANT: Experience shows that if people work with out of SCST tree target +========= drivers, like target driver for Infiniband or in case if they + downloaded and use the released versions of SCST and target + drivers, they are too often (actually, almost always) after + upgrading SCST core forget to rebuild their target drivers, + which then immediately after load crash in the hard to trace + manner. So, after you reinstalled SCST core don't forget to + rebuild and reinstall all your target drivers, custom dev + handlers and necessary user space applications. + IMPORTANT: In the current version simultaneous access to local SCSI devices ========= via standard high-level SCSI drivers (sd, st, sg, etc.) and SCST's target drivers is unsupported. Especially it is @@ -104,7 +115,7 @@ devices READ/WRITE commands using direct disk handler look to be safe. -To uninstall, type 'make uninstall'. +To uninstall, type 'make scst_uninstall'. If you install QLA2x00 target driver's source code in this directory, then you can build, install or uninstall it by typing 'make qla', 'make Modified: trunk/scst/src/Makefile =================================================================== --- trunk/scst/src/Makefile 2007-08-29 09:52:07 UTC (rev 174) +++ trunk/scst/src/Makefile 2007-08-29 15:07:40 UTC (rev 175) @@ -82,12 +82,18 @@ install -m 644 Module.symvers $(INSTALL_DIR_H) endif -depmod -a $(KVER) - @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @echo "!! Now don't forget to rebuild and reinstall all your !!" - @echo "!! target drivers, custom dev handlers and necessary user !!" - @echo "!! space applications. Otherwise, because of the versions !!" - @echo "!! mismatch, you could have many problems and crashes! !!" - @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + @echo "****************************************************************" + @echo "*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*" + @echo "*!! !!*" + @echo "*!! Now don't forget to rebuild and reinstall all your !!*" + @echo "*!! target drivers, custom dev handlers and necessary user !!*" + @echo "*!! space applications. Otherwise, because of the versions !!*" + @echo "*!! mismatch, you could have many problems and crashes. !!*" + @echo "*!! See IMPORTANT note in the \"Installation\" section of !!*" + @echo "*!! SCST's README file for more info. !!*" + @echo "*!! !!*" + @echo "*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*" + @echo "****************************************************************" uninstall: cd $(DEV_HANDLERS_DIR) && $(MAKE) $@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-09-19 09:19:49
|
Revision: 189 http://scst.svn.sourceforge.net/scst/?rev=189&view=rev Author: vlnb Date: 2007-09-19 02:19:29 -0700 (Wed, 19 Sep 2007) Log Message: ----------- - Patch from Aravind Parchuri <ara...@gm...> with some my modifications: * Allows LSI MPT target driver to compile on kernels >2.6.15 * Changes the way how gettid() syscall gate implemented - Small doc update Modified Paths: -------------- trunk/mpt/README trunk/mpt/mpt_scst.c trunk/mpt/mpt_scst.h trunk/usr/fileio/debug.c Modified: trunk/mpt/README =================================================================== --- trunk/mpt/README 2007-09-18 06:21:41 UTC (rev 188) +++ trunk/mpt/README 2007-09-19 09:19:29 UTC (rev 189) @@ -26,6 +26,17 @@ 3. Correct in drivers/message/fusion/Makefile SCST_INC_DIR variable so it points to correct directory with SCST include files. +Building outside the Linux kernel tree +-------------------------------------- + +Edit Makefile, comment there line + +obj-$(CONFIG_FUSION_SCST) += mpt_scst.o + +and uncomment line + +obj-m += mpt_scst.o + Notes on implementation ----------------------- The driver takes the mptstm target driver implemented by LSI Modified: trunk/mpt/mpt_scst.c =================================================================== --- trunk/mpt/mpt_scst.c 2007-09-18 06:21:41 UTC (rev 188) +++ trunk/mpt/mpt_scst.c 2007-09-19 09:19:29 UTC (rev 189) @@ -155,7 +155,11 @@ ioc->prod_name, tgt->target_enable ? "True" : "False"); - if (ioc->bus_type == SCSI) { +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)) + if (ioc->bus_type == SCSI) { +#else + if (ioc->bus_type == SPI) { +#endif int i = 0; seq_printf(seq, "Target ID :%d\n" "Capabilities :0x%x\n" Modified: trunk/mpt/mpt_scst.h =================================================================== --- trunk/mpt/mpt_scst.h 2007-09-18 06:21:41 UTC (rev 188) +++ trunk/mpt/mpt_scst.h 2007-09-19 09:19:29 UTC (rev 189) @@ -2,7 +2,11 @@ #define __MPT_SCST_H #if defined(MODULE) && !defined(__GENKSYMS__) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) #include <linux/config.h> +#else +#include <linux/autoconf.h> +#endif #include <linux/module.h> #endif Modified: trunk/usr/fileio/debug.c =================================================================== --- trunk/usr/fileio/debug.c 2007-09-18 06:21:41 UTC (rev 188) +++ trunk/usr/fileio/debug.c 2007-09-19 09:19:29 UTC (rev 189) @@ -22,10 +22,15 @@ #include <time.h> #include <pthread.h> #include <string.h> +#include <unistd.h> +#include <sys/syscall.h> #include "debug.h" -_syscall0(pid_t,gettid); +pid_t gettid (void) +{ + return syscall(__NR_gettid); +} #if defined(DEBUG) || defined(TRACING) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-09-25 09:34:41
|
Revision: 195 http://scst.svn.sourceforge.net/scst/?rev=195&view=rev Author: vlnb Date: 2007-09-25 02:34:37 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Debug mode switch scripts made executable Property Changed: ---------------- trunk/debug2perf trunk/debug2release trunk/perf2debug trunk/release2debug Property changes on: trunk/debug2perf ___________________________________________________________________ Name: svn:executable + * Property changes on: trunk/debug2release ___________________________________________________________________ Name: svn:executable + * Property changes on: trunk/perf2debug ___________________________________________________________________ Name: svn:executable + * Property changes on: trunk/release2debug ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-09-25 09:46:41
|
Revision: 198 http://scst.svn.sourceforge.net/scst/?rev=198&view=rev Author: vlnb Date: 2007-09-25 02:46:36 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Fixes commands leak in case of, e.g., QUEUE FULL status returned, because of uninitialised cmd->sn. - HEAD OF QUEUE commands processing simplified to fix known problems - Cosmetics Modified Paths: -------------- trunk/scst/include/scsi_tgt.h trunk/scst/src/dev_handlers/scst_user.c trunk/scst/src/dev_handlers/scst_vdisk.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_priv.h trunk/scst/src/scst_targ.c trunk/usr/fileio/common.c Modified: trunk/scst/include/scsi_tgt.h =================================================================== --- trunk/scst/include/scsi_tgt.h 2007-09-25 09:39:04 UTC (rev 197) +++ trunk/scst/include/scsi_tgt.h 2007-09-25 09:46:36 UTC (rev 198) @@ -341,9 +341,6 @@ /* Set if tgt_dev is RESERVED by another session */ #define SCST_TGT_DEV_RESERVED 1 -/* Set HEAD OF QUEUE cmd is being executed */ -#define SCST_TGT_DEV_HQ_ACTIVE 2 - /* Set if the corresponding context is atomic */ #define SCST_TGT_DEV_AFTER_INIT_WR_ATOMIC 5 #define SCST_TGT_DEV_AFTER_INIT_OTH_ATOMIC 6 @@ -658,7 +655,7 @@ /* Set, if no /proc files should be automatically created by SCST */ unsigned no_proc:1; - /* Set if expected_sn in cmd->scst_cmd_done() */ + /* Set if increment expected_sn in cmd->scst_cmd_done() */ unsigned inc_expected_sn_on_done:1; /* @@ -1027,11 +1024,14 @@ */ unsigned int preprocessing_only:1; + /* Set if scst_cmd_set_sn() was called */ + unsigned int sn_set:1; + /* - * Set if scst_cmd_init_stage1_done() called and the target want - * that the SN for the cmd isn't assigned until scst_restart_cmd() + * Set if scst_cmd_init_stage1_done() called and the target wants + * that the SN for the cmd won't be assigned until scst_restart_cmd() */ - unsigned int no_sn:1; + unsigned int set_sn_on_restart_cmd:1; /* Set if the cmd's must not use sgv cache for data buffer */ unsigned int no_sgv:1; @@ -1053,8 +1053,8 @@ unsigned int skip_parse:1; /* - * Set if inc expected_sn in cmd->scst_cmd_done() (to - * save extra dereferences) + * Set if increment expected_sn in cmd->scst_cmd_done() (to save + * extra dereferences) */ unsigned int inc_expected_sn_on_done:1; @@ -1366,10 +1366,11 @@ */ int def_cmd_count; spinlock_t sn_lock; - unsigned long expected_sn, curr_sn; + unsigned long expected_sn; + unsigned long curr_sn; + int hq_cmd_count; struct list_head deferred_cmd_list; struct list_head skipped_sn_list; - struct list_head hq_cmd_list; /* * Set if the prev cmd was ORDERED. Size must allow unprotected @@ -1508,10 +1509,9 @@ * Registers and returns target adapter * Returns new target structure on success or NULL otherwise. * - * If parameter "target_name" isn't NULL, then new security group with name - * "Default_##target_name" will be created and all sessions, which don't - * belong to any defined security groups, will be assigned to it instead of - * the "Default" one. + * If parameter "target_name" isn't NULL, then security group with name + * "Default_##target_name", if created, will be used as the default + * instead of "Default" one for all initiators not assigned to any other group. */ struct scst_tgt *scst_register(struct scst_tgt_template *vtt, const char *target_name); @@ -1630,9 +1630,10 @@ * * !!IMPORTANT!! * - * If cmd->no_sn not set, this function, as well as scst_cmd_init_stage1_done() - * and scst_restart_cmd() must not be called simultaneously for the same session - * (more precisely, for the same session/LUN, i.e. tgt_dev), i.e. they must be + * If cmd->set_sn_on_restart_cmd not set, this function, as well as + * scst_cmd_init_stage1_done() and scst_restart_cmd(), must not be + * called simultaneously for the same session (more precisely, + * for the same session/LUN, i.e. tgt_dev), i.e. they must be * somehow externally serialized. This is needed to have lock free fast path in * scst_cmd_set_sn(). For majority of targets those functions are naturally * serialized by the single source of commands. Only iSCSI immediate commands @@ -1654,7 +1655,7 @@ int pref_context, int set_sn) { cmd->preprocessing_only = 1; - cmd->no_sn = !set_sn; + cmd->set_sn_on_restart_cmd = !set_sn; scst_cmd_init_done(cmd, pref_context); } Modified: trunk/scst/src/dev_handlers/scst_user.c =================================================================== --- trunk/scst/src/dev_handlers/scst_user.c 2007-09-25 09:39:04 UTC (rev 197) +++ trunk/scst/src/dev_handlers/scst_user.c 2007-09-25 09:46:36 UTC (rev 198) @@ -2092,6 +2092,7 @@ int res, rc; struct dev_user_cmd *ucmd; struct scst_user_dev *dev = (struct scst_user_dev*)tgt_dev->dev->dh_priv; + struct dev_user_cmd *ucmd_to_abort = NULL; TRACE_ENTRY(); @@ -2107,15 +2108,15 @@ ucmd->user_cmd.tm_cmd.fn = mcmd->fn; if (mcmd->cmd_to_abort != NULL) { - struct dev_user_cmd *ucmd_to_abort = - (struct dev_user_cmd*)mcmd->cmd_to_abort->dh_priv; + ucmd_to_abort = (struct dev_user_cmd*)mcmd->cmd_to_abort->dh_priv; if (ucmd_to_abort != NULL) ucmd->user_cmd.tm_cmd.cmd_h_to_abort = ucmd_to_abort->h; } TRACE_MGMT_DBG("Preparing TM ucmd %p (h %d, fn %d, cmd_to_abort %p, " - "ucmd_to_abort %d)", ucmd, ucmd->h, mcmd->fn, - mcmd->cmd_to_abort, ucmd->user_cmd.tm_cmd.cmd_h_to_abort); + "ucmd_to_abort %p, cmd_h_to_abort %d)", ucmd, ucmd->h, + mcmd->fn, mcmd->cmd_to_abort, ucmd_to_abort, + ucmd->user_cmd.tm_cmd.cmd_h_to_abort); ucmd->state = UCMD_STATE_TM_EXECING; @@ -2158,6 +2159,7 @@ sBUG_ON(irqs_disabled()); spin_lock_irq(&dev->cmd_lists.cmd_list_lock); + out_locked_free: kfree(ucmd->cmpl); ucmd->cmpl = NULL; Modified: trunk/scst/src/dev_handlers/scst_vdisk.c =================================================================== --- trunk/scst/src/dev_handlers/scst_vdisk.c 2007-09-25 09:39:04 UTC (rev 197) +++ trunk/scst/src/dev_handlers/scst_vdisk.c 2007-09-25 09:46:36 UTC (rev 198) @@ -651,6 +651,17 @@ TRACE_ENTRY(); + switch(cmd->queue_type) { + case SCST_CMD_QUEUE_ORDERED: + TRACE(TRACE_ORDER, "ORDERED cmd %p", cmd); + break; + case SCST_CMD_QUEUE_HEAD_OF_QUEUE: + TRACE(TRACE_ORDER, "HQ cmd %p", cmd); + break; + default: + break; + } + rc = scst_check_local_events(cmd); if (unlikely(rc != 0)) goto out_done; Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2007-09-25 09:39:04 UTC (rev 197) +++ trunk/scst/src/scst_lib.c 2007-09-25 09:46:36 UTC (rev 198) @@ -404,7 +404,6 @@ spin_lock_init(&tgt_dev->sn_lock); INIT_LIST_HEAD(&tgt_dev->deferred_cmd_list); INIT_LIST_HEAD(&tgt_dev->skipped_sn_list); - INIT_LIST_HEAD(&tgt_dev->hq_cmd_list); tgt_dev->expected_sn = 1; tgt_dev->num_free_sn_slots = ARRAY_SIZE(tgt_dev->sn_slots); tgt_dev->cur_sn_slot = &tgt_dev->sn_slots[0]; @@ -2427,47 +2426,6 @@ return; } -/* sn_lock supposed to be held and IRQ off */ -static inline int __scst_check_hq_cmd(struct scst_cmd *cmd) -{ - struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; - struct scst_cmd *hq; - int res; - - TRACE_ENTRY(); - - /* According to SAM, the latest HQ cmd shall pass first */ - hq = list_entry(tgt_dev->hq_cmd_list.next, typeof(*hq), - sn_cmd_list_entry); - if ((cmd == hq) && !test_bit(SCST_TGT_DEV_HQ_ACTIVE, - &tgt_dev->tgt_dev_flags)) { - TRACE_SN("Passing HQ cmd %p", cmd); - res = 1; - list_del(&cmd->sn_cmd_list_entry); - set_bit(SCST_TGT_DEV_HQ_ACTIVE, &tgt_dev->tgt_dev_flags); - } else { - TRACE_SN("Defer HQ cmd %p", cmd); - res = 0; - cmd->hq_deferred = 1; - tgt_dev->def_cmd_count++; - } - - TRACE_EXIT_RES(res); - return res; -} - -int scst_check_hq_cmd(struct scst_cmd *cmd) -{ - struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; - int res; - - spin_lock_irq(&tgt_dev->sn_lock); - res = __scst_check_hq_cmd(cmd); - spin_unlock_irq(&tgt_dev->sn_lock); - - return res; -} - /* No locks */ struct scst_cmd *__scst_check_deferred_commands(struct scst_tgt_dev *tgt_dev) { @@ -2476,38 +2434,14 @@ spin_lock_irq(&tgt_dev->sn_lock); - if (unlikely(test_bit(SCST_TGT_DEV_HQ_ACTIVE, &tgt_dev->tgt_dev_flags))) { - if (!list_empty(&tgt_dev->hq_cmd_list)) { - int rc; - cmd = list_entry(tgt_dev->hq_cmd_list.next, - typeof(*cmd), sn_cmd_list_entry); - if (cmd->hq_deferred) { - TRACE_SN("Releasing deferred HQ cmd %p", cmd); - tgt_dev->def_cmd_count--; - cmd->hq_deferred = 0; - res = cmd; - /* - * Since __scst_check_hq_cmd() is inline, a lot - * of code should be optimized out - */ - clear_bit(SCST_TGT_DEV_HQ_ACTIVE, - &tgt_dev->tgt_dev_flags); - rc = __scst_check_hq_cmd(res); - EXTRACHECKS_BUG_ON(rc != 1); - goto out_unlock; - } - } - TRACE_SN("Turning OFF hq_cmd_active (tgt_dev %p)", - tgt_dev); - clear_bit(SCST_TGT_DEV_HQ_ACTIVE, &tgt_dev->tgt_dev_flags); - } - restart: list_for_each_entry_safe(cmd, t, &tgt_dev->deferred_cmd_list, sn_cmd_list_entry) { + EXTRACHECKS_BUG_ON(cmd->queue_type == + SCST_CMD_QUEUE_HEAD_OF_QUEUE); if (cmd->sn == expected_sn) { - TRACE_SN("Deferred command %p (sn %ld) found", - cmd, cmd->sn); + TRACE_SN("Deferred command %p (sn %ld, set %d) found", + cmd, cmd->sn, cmd->sn_set); tgt_dev->def_cmd_count--; list_del(&cmd->sn_cmd_list_entry); if (res == NULL) @@ -2528,6 +2462,8 @@ list_for_each_entry(cmd, &tgt_dev->skipped_sn_list, sn_cmd_list_entry) { + EXTRACHECKS_BUG_ON(cmd->queue_type == + SCST_CMD_QUEUE_HEAD_OF_QUEUE); if (cmd->sn == expected_sn) { atomic_t *slot = cmd->sn_slot; /* @@ -2540,8 +2476,6 @@ tgt_dev->def_cmd_count--; list_del(&cmd->sn_cmd_list_entry); spin_unlock_irq(&tgt_dev->sn_lock); - EXTRACHECKS_BUG_ON(cmd->queue_type == - SCST_CMD_QUEUE_HEAD_OF_QUEUE); if (test_and_set_bit(SCST_CMD_CAN_BE_DESTROYED, &cmd->cmd_flags)) { scst_destroy_put_cmd(cmd); @@ -2833,13 +2767,9 @@ { struct scst_cmd *res = NULL; - if (out_of_sn_cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE) { - TRACE_SN("HQ out_of_sn_cmd %p", out_of_sn_cmd); - spin_lock_irq(&out_of_sn_cmd->tgt_dev->sn_lock); - list_del(&out_of_sn_cmd->sn_cmd_list_entry); - spin_unlock_irq(&out_of_sn_cmd->tgt_dev->sn_lock); - res = scst_check_deferred_commands(tgt_dev); - } else if (out_of_sn_cmd->sn == tgt_dev->expected_sn) { + EXTRACHECKS_BUG_ON(!out_of_sn_cmd->sn_set); + + if (out_of_sn_cmd->sn == tgt_dev->expected_sn) { scst_inc_expected_sn(tgt_dev, out_of_sn_cmd->sn_slot); res = scst_check_deferred_commands(tgt_dev); } else { @@ -2864,8 +2794,8 @@ TRACE_ENTRY(); - if (out_of_sn_cmd->no_sn) { - TRACE_SN("cmd %p with no_sn", out_of_sn_cmd); + if (!out_of_sn_cmd->sn_set) { + TRACE_SN("cmd %p without sn", out_of_sn_cmd); goto out; } Modified: trunk/scst/src/scst_priv.h =================================================================== --- trunk/scst/src/scst_priv.h 2007-09-25 09:39:04 UTC (rev 197) +++ trunk/scst/src/scst_priv.h 2007-09-25 09:46:36 UTC (rev 198) @@ -90,9 +90,6 @@ /* Set if a TM command is being performed */ #define SCST_FLAG_TM_ACTIVE 2 -/* Set if scst_cmd_mem_work is scheduled */ -#define SCST_FLAG_CMD_MEM_WORK_SCHEDULED 3 - /** ** Return codes for cmd state process functions **/ @@ -222,8 +219,7 @@ static inline struct scst_cmd *scst_check_deferred_commands( struct scst_tgt_dev *tgt_dev) { - if ((tgt_dev->def_cmd_count == 0) && - likely(!test_bit(SCST_TGT_DEV_HQ_ACTIVE, &tgt_dev->tgt_dev_flags))) + if (tgt_dev->def_cmd_count == 0) return NULL; else return __scst_check_deferred_commands(tgt_dev); Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2007-09-25 09:39:04 UTC (rev 197) +++ trunk/scst/src/scst_targ.c 2007-09-25 09:46:36 UTC (rev 198) @@ -634,7 +634,7 @@ cmd->state = SCST_CMD_STATE_PRE_EXEC; break; } - if (cmd->no_sn) + if (cmd->set_sn_on_restart_cmd) scst_cmd_set_sn(cmd); /* Small context optimization */ if ((pref_context == SCST_CONTEXT_TASKLET) || @@ -955,8 +955,9 @@ { struct scst_cmd *c; - if (likely(cmd->queue_type != SCST_CMD_QUEUE_HEAD_OF_QUEUE)) + if (likely(cmd->sn_set)) scst_inc_expected_sn(cmd->tgt_dev, cmd->sn_slot); + c = scst_check_deferred_commands(cmd->tgt_dev); if (c != NULL) { unsigned long flags; @@ -1813,42 +1814,27 @@ "thread context, rescheduling"); res = SCST_CMD_STATE_RES_NEED_THREAD; scst_dec_on_dev_cmd(cmd); - goto out_dec_cmd_count; + goto out_put; } else { sBUG_ON(rc != SCST_EXEC_COMPLETED); goto out_unplug; } } - EXTRACHECKS_BUG_ON(cmd->no_sn); + if (unlikely(cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE)) + goto exec; - if (unlikely(cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE)) { - /* - * W/o get() there will be a race, when cmd is executed and - * destroyed before "goto out_unplug" - */ - scst_cmd_get(cmd); - if (scst_check_hq_cmd(cmd)) { - scst_cmd_put(cmd); - goto exec; - } else { - scst_dec_on_dev_cmd(cmd); - scst_cmd_put(cmd); - goto out_unplug; - } - } + sBUG_ON(!cmd->sn_set); expected_sn = tgt_dev->expected_sn; /* Optimized for lockless fast path */ - if ((cmd->sn != expected_sn) || unlikely(test_bit(SCST_TGT_DEV_HQ_ACTIVE, - &tgt_dev->tgt_dev_flags))) { + if ((cmd->sn != expected_sn) || (tgt_dev->hq_cmd_count > 0)) { spin_lock_irq(&tgt_dev->sn_lock); tgt_dev->def_cmd_count++; smp_mb(); - barrier(); /* to reread expected_sn & hq_cmd_active */ + barrier(); /* to reread expected_sn & hq_cmd_count */ expected_sn = tgt_dev->expected_sn; - if ((cmd->sn != expected_sn) || test_bit(SCST_TGT_DEV_HQ_ACTIVE, - &tgt_dev->tgt_dev_flags)) { + if ((cmd->sn != expected_sn) || (tgt_dev->hq_cmd_count > 0)) { /* We are under IRQ lock, but dev->dev_lock is BH one */ int cmd_blocking = scst_pre_dec_on_dev_cmd(cmd); if (unlikely(test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags))) { @@ -1859,18 +1845,16 @@ cmd->state = SCST_CMD_STATE_DEV_DONE; res = SCST_CMD_STATE_RES_CONT_SAME; } else { - TRACE_SN("Deferring cmd %p (sn=%ld, " - "expected_sn=%ld, hq_cmd_active=%d)", cmd, - cmd->sn, expected_sn, - test_bit(SCST_TGT_DEV_HQ_ACTIVE, - &tgt_dev->tgt_dev_flags)); + TRACE_SN("Deferring cmd %p (sn=%ld, set %d, " + "expected_sn=%ld)", cmd, cmd->sn, + cmd->sn_set, expected_sn); list_add_tail(&cmd->sn_cmd_list_entry, &tgt_dev->deferred_cmd_list); } spin_unlock_irq(&tgt_dev->sn_lock); /* !! At this point cmd can be already freed !! */ __scst_dec_on_dev_cmd(dev, cmd_blocking); - goto out_dec_cmd_count; + goto out_put; } else { TRACE_SN("Somebody incremented expected_sn %ld, " "continuing", expected_sn); @@ -1883,32 +1867,23 @@ count = 0; while(1) { atomic_t *slot = cmd->sn_slot; - int hq = (cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE); - int inc_expected_sn_on_done = cmd->inc_expected_sn_on_done; + int inc_expected_sn = !cmd->inc_expected_sn_on_done && + cmd->sn_set; rc = scst_do_send_to_midlev(cmd); if (rc == SCST_EXEC_NEED_THREAD) { TRACE_DBG("%s", "scst_do_send_to_midlev() requested " "thread context, rescheduling"); res = SCST_CMD_STATE_RES_NEED_THREAD; - if (unlikely(hq)) { - TRACE_SN("Rescheduling HQ cmd %p", cmd); - spin_lock_irq(&tgt_dev->sn_lock); - clear_bit(SCST_TGT_DEV_HQ_ACTIVE, - &tgt_dev->tgt_dev_flags); - list_add(&cmd->sn_cmd_list_entry, - &tgt_dev->hq_cmd_list); - spin_unlock_irq(&tgt_dev->sn_lock); - } scst_dec_on_dev_cmd(cmd); if (count != 0) goto out_unplug; else - goto out_dec_cmd_count; + goto out_put; } sBUG_ON(rc != SCST_EXEC_COMPLETED); /* !! At this point cmd can be already freed !! */ count++; - if ( !inc_expected_sn_on_done && likely(!hq)) + if (inc_expected_sn) scst_inc_expected_sn(tgt_dev, slot); cmd = scst_check_deferred_commands(tgt_dev); if (cmd == NULL) @@ -1921,7 +1896,7 @@ if (dev->scsi_dev != NULL) generic_unplug_device(dev->scsi_dev->request_queue); -out_dec_cmd_count: +out_put: __scst_put(); /* !! At this point sess, dev and tgt_dev can be already freed !! */ @@ -2293,11 +2268,41 @@ * Check here also in order to avoid unnecessary delays of other * commands. */ - if (unlikely(!cmd->sent_to_midlev) && (cmd->tgt_dev != NULL)) { - TRACE_SN("cmd %p was not sent to mid-lev (sn %ld)", - cmd, cmd->sn); - scst_unblock_deferred(cmd->tgt_dev, cmd); - cmd->sent_to_midlev = 1; + if (cmd->tgt_dev != NULL) { + if (unlikely(cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE)) { + struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; + + spin_lock_irq(&tgt_dev->sn_lock); + tgt_dev->hq_cmd_count--; + spin_unlock_irq(&tgt_dev->sn_lock); + + EXTRACHECKS_BUG_ON(tgt_dev->hq_cmd_count < 0); + + /* + * There is no problem in checking hq_cmd_count in the + * non-locked state. In the worst case we will only have + * unneeded run of the deferred commands. + */ + if (tgt_dev->hq_cmd_count == 0) { + struct scst_cmd *c = + scst_check_deferred_commands(tgt_dev); + if (c != NULL) { + spin_lock_irq(&c->cmd_lists->cmd_list_lock); + TRACE_SN("Adding cmd %p to active cmd list", c); + list_add_tail(&c->cmd_list_entry, + &c->cmd_lists->active_cmd_list); + wake_up(&c->cmd_lists->cmd_list_waitQ); + spin_unlock_irq(&c->cmd_lists->cmd_list_lock); + } + } + } + + if (unlikely(!cmd->sent_to_midlev)) { + TRACE_SN("cmd %p was not sent to mid-lev (sn %ld, set %d)", + cmd, cmd->sn, cmd->sn_set); + scst_unblock_deferred(cmd->tgt_dev, cmd); + cmd->sent_to_midlev = 1; + } } if (atomic && !cmd->tgtt->xmit_response_atomic) { @@ -2501,6 +2506,7 @@ } cmd->sn_slot = tgt_dev->cur_sn_slot; cmd->sn = tgt_dev->curr_sn; + tgt_dev->prev_cmd_ordered = 0; } else { TRACE(TRACE_MINOR, "%s", "Not enough SN slots"); @@ -2540,10 +2546,9 @@ TRACE(TRACE_SCSI|TRACE_SCSI_SERIALIZING, "HQ cmd %p " "(op %x)", cmd, cmd->cdb[0]); spin_lock_irqsave(&tgt_dev->sn_lock, flags); - /* Add in the head as required by SAM */ - list_add(&cmd->sn_cmd_list_entry, &tgt_dev->hq_cmd_list); + tgt_dev->hq_cmd_count++; spin_unlock_irqrestore(&tgt_dev->sn_lock, flags); - break; + goto out; default: PRINT_ERROR_PR("Unsupported queue type %d, treating it as " @@ -2559,7 +2564,8 @@ tgt_dev->num_free_sn_slots, tgt_dev->prev_cmd_ordered, tgt_dev->cur_sn_slot-tgt_dev->sn_slots); - cmd->no_sn = 0; + cmd->sn_set = 1; +out: return; } @@ -2652,7 +2658,7 @@ "Anonymous" : cmd->sess->initiator_name); goto out_busy; } - if (!cmd->no_sn) + if (!cmd->set_sn_on_restart_cmd) scst_cmd_set_sn(cmd); } else if (res < 0) { TRACE_DBG("Finishing cmd %p", cmd); @@ -3388,8 +3394,9 @@ } scst_cmd_get(cmd); spin_unlock_irq(&sess->sess_list_lock); - TRACE(TRACE_MGMT, "Cmd %p for tag %llu (sn %ld) found, " - "aborting it", cmd, mcmd->tag, cmd->sn); + TRACE(TRACE_MGMT, "Cmd %p for tag %llu (sn %ld, set %d, " + "queue_type %x) found, aborting it", cmd, mcmd->tag, + cmd->sn, cmd->sn_set, cmd->queue_type); mcmd->cmd_to_abort = cmd; if (mcmd->lun_set && (mcmd->lun != cmd->lun)) { PRINT_ERROR_PR("ABORT TASK: LUN mismatch: mcmd LUN %Lx, " @@ -3988,7 +3995,7 @@ if (unlikely(sess->init_phase != SCST_SESS_IPH_READY)) { switch(sess->init_phase) { case SCST_SESS_IPH_INITING: - TRACE_DBG("Moving mcmd %p to init deferred mcmd list", + TRACE_DBG("Adding mcmd %p to init deferred mcmd list", mcmd); list_add_tail(&mcmd->mgmt_cmd_list_entry, &sess->init_deferred_mcmd_list); Modified: trunk/usr/fileio/common.c =================================================================== --- trunk/usr/fileio/common.c 2007-09-25 09:39:04 UTC (rev 197) +++ trunk/usr/fileio/common.c 2007-09-25 09:46:36 UTC (rev 198) @@ -184,6 +184,17 @@ TRACE_ENTRY(); + switch(cmd->queue_type) { + case SCST_CMD_QUEUE_ORDERED: + TRACE(TRACE_ORDER, "ORDERED cmd_h %d", vcmd->cmd->cmd_h); + break; + case SCST_CMD_QUEUE_HEAD_OF_QUEUE: + TRACE(TRACE_ORDER, "HQ cmd_h %d", vcmd->cmd->cmd_h); + break; + default: + break; + } + memset(reply, 0, sizeof(*reply)); vcmd->reply->cmd_h = vcmd->cmd->cmd_h; vcmd->reply->subcode = vcmd->cmd->subcode; @@ -1601,8 +1612,8 @@ } if (err < 0) { - PRINT_ERROR_PR("write() returned %Ld from %zd (errno %d)", - (uint64_t)err, length, errno); + PRINT_ERROR_PR("write() returned %Ld from %zd (errno %d, cmd_h " + "%x)", (uint64_t)err, length, errno, vcmd->cmd->cmd_h); if (err == -EAGAIN) set_busy(reply); else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-09-25 13:39:34
|
Revision: 200 http://scst.svn.sourceforge.net/scst/?rev=200&view=rev Author: vlnb Date: 2007-09-25 06:39:25 -0700 (Tue, 25 Sep 2007) Log Message: ----------- - Increased INCOMING_MAX as suggested in http://blog.wpkg.org/2007/09/09/solving-reliability-and-scalability-problems-with-iscsi/. - Minor Makefile fixes Modified Paths: -------------- trunk/Makefile trunk/iscsi-scst/usr/iscsi_scstd.c Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2007-09-25 09:52:53 UTC (rev 199) +++ trunk/Makefile 2007-09-25 13:39:25 UTC (rev 200) @@ -25,7 +25,7 @@ USR_DIR=usr/fileio ISCSI_DIR=iscsi-scst -#ISCSI_DISTDIR=../../../../iscsi_scst_inst +#ISCSI_DISTDIR=../../../iscsi_scst_inst help: @echo " all : make all" @@ -140,7 +140,7 @@ cd $(ISCSI_DIR) && $(MAKE) iscsi_install: - cd $(ISCSI_DIR) && $(MAKE) install + cd $(ISCSI_DIR) && $(MAKE) DISTDIR=$(ISCSI_DISTDIR) install iscsi_uninstall: cd $(ISCSI_DIR) && $(MAKE) uninstall Modified: trunk/iscsi-scst/usr/iscsi_scstd.c =================================================================== --- trunk/iscsi-scst/usr/iscsi_scstd.c 2007-09-25 09:52:53 UTC (rev 199) +++ trunk/iscsi-scst/usr/iscsi_scstd.c 2007-09-25 13:39:25 UTC (rev 200) @@ -39,7 +39,7 @@ #include "iscsi_adm.h" #define LISTEN_MAX 8 -#define INCOMING_MAX 32 +#define INCOMING_MAX 256 enum { POLL_LISTEN, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-10-02 15:05:34
|
Revision: 204 http://scst.svn.sourceforge.net/scst/?rev=204&view=rev Author: vlnb Date: 2007-10-02 08:04:04 -0700 (Tue, 02 Oct 2007) Log Message: ----------- - Fixes 2 shutdown problems - Cosmetics Modified Paths: -------------- trunk/iscsi-scst/kernel/iscsi.c trunk/iscsi-scst/kernel/nthread.c trunk/iscsi-scst/kernel/param.c trunk/iscsi-scst/kernel/target.c trunk/iscsi-scst/usr/iscsi_scstd.c trunk/iscsi-scst/usr/iscsid.h trunk/iscsi-scst/usr/log.c trunk/scst/README trunk/scst/src/scst_main.c trunk/scst/src/scst_targ.c Modified: trunk/iscsi-scst/kernel/iscsi.c =================================================================== --- trunk/iscsi-scst/kernel/iscsi.c 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/iscsi-scst/kernel/iscsi.c 2007-10-02 15:04:04 UTC (rev 204) @@ -2541,7 +2541,6 @@ #endif } - module_init(iscsi_init); module_exit(iscsi_exit); Modified: trunk/iscsi-scst/kernel/nthread.c =================================================================== --- trunk/iscsi-scst/kernel/nthread.c 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/iscsi-scst/kernel/nthread.c 2007-10-02 15:04:04 UTC (rev 204) @@ -172,15 +172,15 @@ msleep(50); } + TRACE_CONN_CLOSE("Notifying user space about closing conn %p", conn); + event_send(target->tid, session->sid, conn->cid, E_CONN_CLOSE, 0); + mutex_lock(&target->target_mutex); conn_free(conn); if (list_empty(&session->conn_list)) session_del(target, session->sid); mutex_unlock(&target->target_mutex); - TRACE_CONN_CLOSE("Notifying user space about closing conn %p", conn); - event_send(target->tid, session->sid, conn->cid, E_CONN_CLOSE, 0); - TRACE_EXIT(); return; } Modified: trunk/iscsi-scst/kernel/param.c =================================================================== --- trunk/iscsi-scst/kernel/param.c 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/iscsi-scst/kernel/param.c 2007-10-02 15:04:04 UTC (rev 204) @@ -186,8 +186,13 @@ static int trgt_param(struct iscsi_target *target, struct iscsi_param_info *info, int set) { if (set) { + struct iscsi_trgt_param *prm; trgt_param_check(info); trgt_param_set(target, info); + + prm = &target->trgt_param; + PRINT_INFO_PR("Target parameter changed: queued_cmnds %d", + prm->queued_cmnds); } else trgt_param_get(&target->trgt_param, info); Modified: trunk/iscsi-scst/kernel/target.c =================================================================== --- trunk/iscsi-scst/kernel/target.c 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/iscsi-scst/kernel/target.c 2007-10-02 15:04:04 UTC (rev 204) @@ -229,26 +229,28 @@ struct iscsi_session *session, *ts; mutex_lock(&target->target_mutex); if (!list_empty(&target->session_list)) { - TRACE_DBG("target %p", target); + TRACE_MGMT_DBG("Cleaning up target %p", target); list_for_each_entry_safe(session, ts, &target->session_list, session_list_entry) { - TRACE_DBG("session %p", session); + TRACE_MGMT_DBG("Cleaning up session %p", session); if (!list_empty(&session->conn_list)) { struct iscsi_conn *conn, *tc; list_for_each_entry_safe(conn, tc, &session->conn_list, conn_list_entry) { - TRACE_DBG("conn %p", conn); + TRACE_MGMT_DBG("Mark conn %p " + "closing", conn); mark_conn_closed(conn); } } else { - TRACE_DBG("session %p with empty " - "connection list", session); + TRACE_MGMT_DBG("Freeing session %p " + "without connections", session); + session_del(target, session->sid); } } mutex_unlock(&target->target_mutex); } else { - TRACE_DBG("deleting target %p", target); + TRACE_MGMT_DBG("Deleting target %p", target); list_del(&target->target_list_entry); nr_targets--; mutex_unlock(&target->target_mutex); Modified: trunk/iscsi-scst/usr/iscsi_scstd.c =================================================================== --- trunk/iscsi-scst/usr/iscsi_scstd.c 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/iscsi-scst/usr/iscsi_scstd.c 2007-10-02 15:04:04 UTC (rev 204) @@ -209,6 +209,20 @@ return; } + if (from.ss_family == AF_INET) { + struct sockaddr_in *in = (struct sockaddr_in *)&from; + log_info("Connect from %s:%hd", inet_ntoa(in->sin_addr), + ntohs(in->sin_port)); + } else if (from.ss_family == AF_INET6) { + struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&from; + log_info("Connect from %x:%x:%x:%x:%x:%x:%x:%x.%hd", + in6->sin6_addr.s6_addr16[7], in6->sin6_addr.s6_addr16[6], + in6->sin6_addr.s6_addr16[5], in6->sin6_addr.s6_addr16[4], + in6->sin6_addr.s6_addr16[3], in6->sin6_addr.s6_addr16[2], + in6->sin6_addr.s6_addr16[1], in6->sin6_addr.s6_addr16[0], + ntohs(in6->sin6_port)); + } + if (conn_blocked) { log_warning("A connection refused\n"); close(fd); Modified: trunk/iscsi-scst/usr/iscsid.h =================================================================== --- trunk/iscsi-scst/usr/iscsid.h 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/iscsi-scst/usr/iscsid.h 2007-10-02 15:04:04 UTC (rev 204) @@ -181,6 +181,8 @@ extern int log_level; extern void log_init(void); +extern void log_info(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); extern void log_warning(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); extern void log_error(const char *fmt, ...) Modified: trunk/iscsi-scst/usr/log.c =================================================================== --- trunk/iscsi-scst/usr/log.c 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/iscsi-scst/usr/log.c 2007-10-02 15:04:04 UTC (rev 204) @@ -19,6 +19,7 @@ #include <stdio.h> #include <syslog.h> #include <sys/time.h> +#include <string.h> #include "iscsid.h" @@ -33,9 +34,15 @@ static void dolog(int prio, const char *fmt, va_list ap) { - if (log_daemon) - vsyslog(prio, fmt, ap); - else { + if (log_daemon) { + int len = strlen(fmt); + char f[len+1+1]; + if (fmt[len] != '\n') + sprintf(f, "%s\n", fmt); + else + sprintf(f, "%s", fmt); + vsyslog(prio, f, ap); + } else { struct timeval time; gettimeofday(&time, NULL); @@ -46,6 +53,14 @@ } } +void log_info(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + dolog(LOG_INFO, fmt, ap); + va_end(ap); +} + void log_warning(const char *fmt, ...) { va_list ap; Modified: trunk/scst/README =================================================================== --- trunk/scst/README 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/scst/README 2007-10-02 15:04:04 UTC (rev 204) @@ -587,7 +587,7 @@ - You may need to increase amount of requests that OS on initiator sends to the target device. To do it on Linux initiators, run - echo “512” > /sys/block/sdX/queue/nr_requests + echo “64” > /sys/block/sdX/queue/nr_requests where X is a device letter like above. Modified: trunk/scst/src/scst_main.c =================================================================== --- trunk/scst/src/scst_main.c 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/scst/src/scst_main.c 2007-10-02 15:04:04 UTC (rev 204) @@ -325,8 +325,8 @@ mutex_unlock(&scst_mutex); scst_resume_activity(); - PRINT_INFO_PR("Target %s for template %s registered successfully", - target_name, vtt->name); + PRINT_INFO_PR("Target %s (%p) for template %s registered successfully", + target_name, tgt, vtt->name); out: TRACE_EXIT(); @@ -344,7 +344,8 @@ tgt = NULL; out_err: - PRINT_ERROR_PR("Failed to register target for template %s", vtt->name); + PRINT_ERROR_PR("Failed to register target %s for template %s", + target_name, vtt->name); goto out; } @@ -393,11 +394,11 @@ del_timer_sync(&tgt->retry_timer); + PRINT_INFO_PR("Target %p for template %s unregistered successfully", + tgt, vtt->name); + kfree(tgt); - PRINT_INFO_PR("Target for template %s unregistered successfully", - vtt->name); - TRACE_EXIT(); return; } @@ -445,8 +446,8 @@ mutex_lock(&scst_suspend_mutex); - TRACE_MGMT_DBG("suspend_count %d", suspend_count); suspend_count--; + TRACE_MGMT_DBG("suspend_count %d left", suspend_count); if (suspend_count > 0) goto out_up; Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2007-10-01 08:10:31 UTC (rev 203) +++ trunk/scst/src/scst_targ.c 2007-10-02 15:04:04 UTC (rev 204) @@ -4164,7 +4164,7 @@ acg->acg_name, sess->initiator_name); sess->acg = acg; - TRACE_DBG("Assigning session %p to acg %s", sess, acg->acg_name); + TRACE_MGMT_DBG("Assigning session %p to acg %s", sess, acg->acg_name); list_add_tail(&sess->acg_sess_list_entry, &acg->acg_sess_list); TRACE_DBG("Adding sess %p to tgt->sess_list", sess); @@ -4292,6 +4292,8 @@ TRACE_ENTRY(); + TRACE_MGMT_DBG("Unregistering session %p (wait %d)", sess, wait); + #ifdef CONFIG_LOCKDEP pc = sess->shutdown_compl; #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-10-18 10:12:44
|
Revision: 205 http://scst.svn.sourceforge.net/scst/?rev=205&view=rev Author: vlnb Date: 2007-10-18 03:12:34 -0700 (Thu, 18 Oct 2007) Log Message: ----------- - Fixed BUG() with put_page_callback patch for network hardware without TX offload - Fixed 2 corner cases crashes with disabled pass-through devices - Docs updated Modified Paths: -------------- trunk/iscsi-scst/README trunk/iscsi-scst/kernel/nthread.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_main.c trunk/scst/src/scst_priv.h trunk/scst/src/scst_targ.c Modified: trunk/iscsi-scst/README =================================================================== --- trunk/iscsi-scst/README 2007-10-02 15:04:04 UTC (rev 204) +++ trunk/iscsi-scst/README 2007-10-18 10:12:34 UTC (rev 205) @@ -52,8 +52,16 @@ data will be additionally copied into temporary TCP buffers. The performance hit will be quite noticeable. -If you have error messages like: +Note, that if your network hardware does not support TX offload +functions of has them disabled, then TCP zero-copy transmit functions on +your system will not be used by Linux networking in any case, so +put_page_callback patch will not be able to improve performance for you. +You can check your network hardware offload capabilities by command +"ethtool -k ethX", where X is the network device number. At least +"tx-checksumming" and "scatter-gather" should be enabled. +If you have in your kernel log error messages like: + iscsi-scst: ***ERROR*** net_priv isn't NULL and != ref_cmd with the corresponding kernel BUG dump, then put_page_callback patch you Modified: trunk/iscsi-scst/kernel/nthread.c =================================================================== --- trunk/iscsi-scst/kernel/nthread.c 2007-10-02 15:04:04 UTC (rev 204) +++ trunk/iscsi-scst/kernel/nthread.c 2007-10-18 10:12:34 UTC (rev 205) @@ -689,6 +689,13 @@ else goto out_res; } +#ifdef NET_PAGE_CALLBACKS_DEFINED + if (atomic_read(&ref_cmd->net_ref_cnt) == 0) { + TRACE_DBG("%s", "sendpage() not called " + "get_page(), zeroing net_priv"); + sg[idx].page->net_priv = NULL; + } +#endif if (res == size) { conn->write_size = 0; return saved_size; @@ -711,6 +718,13 @@ else goto out_res; } +#ifdef NET_PAGE_CALLBACKS_DEFINED + if (atomic_read(&ref_cmd->net_ref_cnt) == 0) { + TRACE_DBG("%s", "sendpage() not called get_page(), " + "zeroing net_priv"); + sg[idx].page->net_priv = NULL; + } +#endif if (res == sendsize) { idx++; offset = 0; Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2007-10-02 15:04:04 UTC (rev 204) +++ trunk/scst/src/scst_lib.c 2007-10-18 10:12:34 UTC (rev 205) @@ -161,6 +161,7 @@ goto out; } + dev->handler = &scst_null_devtype; dev->p_cmd_lists = &scst_main_cmd_lists; atomic_set(&dev->dev_cmd_count, 0); spin_lock_init(&dev->dev_lock); @@ -357,7 +358,6 @@ tgt_dev->acg_dev = acg_dev; tgt_dev->sess = sess; atomic_set(&tgt_dev->tgt_dev_cmd_count, 0); - scst_sgv_pool_use_norm(tgt_dev); @@ -387,14 +387,14 @@ } if (dev->scsi_dev != NULL) { - TRACE_DBG("host=%d, channel=%d, id=%d, lun=%d, " + TRACE_MGMT_DBG("host=%d, channel=%d, id=%d, lun=%d, " "SCST lun=%Ld", dev->scsi_dev->host->host_no, dev->scsi_dev->channel, dev->scsi_dev->id, dev->scsi_dev->lun, (uint64_t)tgt_dev->lun); } else { - TRACE_MGMT_DBG("Virtual device SCST lun=%Ld", - (uint64_t)tgt_dev->lun); + TRACE_MGMT_DBG("Virtual device %s on SCST lun=%Ld", + dev->virt_name, (uint64_t)tgt_dev->lun); } spin_lock_init(&tgt_dev->tgt_dev_lock); Modified: trunk/scst/src/scst_main.c =================================================================== --- trunk/scst/src/scst_main.c 2007-10-02 15:04:04 UTC (rev 204) +++ trunk/scst/src/scst_main.c 2007-10-18 10:12:34 UTC (rev 205) @@ -101,7 +101,6 @@ struct scst_tasklet scst_tasklets[NR_CPUS]; - spinlock_t scst_mcmd_lock = SPIN_LOCK_UNLOCKED; LIST_HEAD(scst_active_mgmt_cmd_list); LIST_HEAD(scst_delayed_mgmt_cmd_list); @@ -138,6 +137,11 @@ MODULE_PARM_DESC(scst_max_cmd_mem, "Maximum memory allowed to be consumed by " "the SCST commands at any given time in Mb"); +struct scst_dev_type scst_null_devtype = +{ + name: "null_handler", +}; + int scst_register_target_template(struct scst_tgt_template *vtt) { int res = 0; @@ -574,7 +578,7 @@ scst_acg_remove_dev(acg_dev->acg, dev); } - scst_assign_dev_handler(dev, NULL); + scst_assign_dev_handler(dev, &scst_null_devtype); put_disk(dev->rq_disk); scst_free_device(dev); @@ -718,7 +722,7 @@ scst_acg_remove_dev(acg_dev->acg, dev); } - scst_assign_dev_handler(dev, NULL); + scst_assign_dev_handler(dev, &scst_null_devtype); PRINT_INFO_PR("Detached SCSI target mid-level from virtual device %s " "(id %d)", dev->virt_name, dev->virt_id); @@ -744,7 +748,7 @@ res = scst_dev_handler_check(dev_type); if (res != 0) - goto out_err; + goto out_error; #if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && !defined(STRICT_SERIALIZING) if (dev_type->exec == NULL) { @@ -753,14 +757,14 @@ "scst_exec_req_fifo-<kernel-version>.patch or define " "STRICT_SERIALIZING", dev_type->name); res = -EINVAL; - goto out_err; + goto out; } #endif scst_suspend_activity(); if (mutex_lock_interruptible(&scst_mutex) != 0) { res = -EINTR; - goto out_err; + goto out_err_res; } exist = 0; @@ -783,7 +787,7 @@ list_add_tail(&dev_type->dev_type_list_entry, &scst_dev_type_list); list_for_each_entry(dev, &scst_dev_list, dev_list_entry) { - if ((dev->scsi_dev == NULL) || (dev->handler != NULL)) + if ((dev->scsi_dev == NULL) || (dev->handler != &scst_null_devtype)) continue; if (dev->scsi_dev->type == dev_type->type) scst_assign_dev_handler(dev, dev_type); @@ -804,8 +808,10 @@ out_up: mutex_unlock(&scst_mutex); -out_err: +out_err_res: scst_resume_activity(); + +out_error: PRINT_ERROR_PR("Failed to register device handler \"%s\" for type %d", dev_type->name, dev_type->type); goto out; @@ -836,7 +842,7 @@ list_for_each_entry(dev, &scst_dev_list, dev_list_entry) { if (dev->handler == dev_type) { - scst_assign_dev_handler(dev, NULL); + scst_assign_dev_handler(dev, &scst_null_devtype); TRACE_DBG("Dev handler removed from device %p", dev); } } @@ -1035,6 +1041,8 @@ LIST_HEAD(attached_tgt_devs); TRACE_ENTRY(); + + sBUG_ON(handler == NULL); if (dev->handler == handler) goto out; @@ -1099,7 +1107,7 @@ out_null: if (res != 0) - dev->handler = NULL; + dev->handler = &scst_null_devtype; out: TRACE_EXIT_RES(res); Modified: trunk/scst/src/scst_priv.h =================================================================== --- trunk/scst/src/scst_priv.h 2007-10-02 15:04:04 UTC (rev 204) +++ trunk/scst/src/scst_priv.h 2007-10-18 10:12:34 UTC (rev 205) @@ -212,6 +212,8 @@ extern spinlock_t scst_temp_UA_lock; extern uint8_t scst_temp_UA[SCST_SENSE_BUFFERSIZE]; +extern struct scst_dev_type scst_null_devtype; + extern struct scst_cmd *__scst_check_deferred_commands( struct scst_tgt_dev *tgt_dev); Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2007-10-02 15:04:04 UTC (rev 204) +++ trunk/scst/src/scst_targ.c 2007-10-18 10:12:34 UTC (rev 205) @@ -2596,7 +2596,7 @@ if (tgt_dev->lun == cmd->lun) { TRACE_DBG("tgt_dev %p found", tgt_dev); - if (unlikely(tgt_dev->dev->handler == NULL)) { + if (unlikely(tgt_dev->dev->handler == &scst_null_devtype)) { PRINT_INFO_PR("Dev handler for device " "%Ld is NULL, the device will not be " "visible remotely", (uint64_t)cmd->lun); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2007-10-25 10:47:21
|
Revision: 211 http://scst.svn.sourceforge.net/scst/?rev=211&view=rev Author: vlnb Date: 2007-10-25 03:46:29 -0700 (Thu, 25 Oct 2007) Log Message: ----------- - Fixed typos noticed by Tomasz Chmielewski - Forgotten fixes for previous commit --Tohis line, and those below, will be ignored-- M trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.16.29.patch M trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.21.1.patch M trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.22.patch M trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.23.patch M trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.18.1.patch M trunk/scst-full_perf.patch M trunk/scst-release.patch Modified Paths: -------------- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.16.29.patch trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.18.1.patch trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.21.1.patch trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.22.patch trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.23.patch trunk/scst-full_perf.patch trunk/scst-release.patch Modified: trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.16.29.patch =================================================================== --- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.16.29.patch 2007-10-25 09:54:00 UTC (rev 210) +++ trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.16.29.patch 2007-10-25 10:46:29 UTC (rev 211) @@ -7,7 +7,7 @@ #endif /* WANT_PAGE_VIRTUAL */ + /* + * Used to implement support for notification on zero-copy TCP transfer -+ * completeion. Not good to have this field here, it's better to have ++ * completion. Not good to have this field here, it's better to have + * it in struct sk_buff, but it would make the code much more + * complicated and fragile, if maintained as a separate patch, since all + * skb then would have to contain only pages with the same value in this @@ -32,7 +32,7 @@ extern int net_msg_burst; #endif -+/* Support for notification on zero-copy TCP transfer completeion */ ++/* Support for notification on zero-copy TCP transfer completion */ +#define NET_PAGE_CALLBACKS_DEFINED +typedef void (*net_get_page_callback_t)(struct page *page); +typedef void (*net_put_page_callback_t)(struct page *page); Modified: trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.18.1.patch =================================================================== --- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.18.1.patch 2007-10-25 09:54:00 UTC (rev 210) +++ trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.18.1.patch 2007-10-25 10:46:29 UTC (rev 211) @@ -7,7 +7,7 @@ #endif /* WANT_PAGE_VIRTUAL */ + /* + * Used to implement support for notification on zero-copy TCP transfer -+ * completeion. Not good to have this field here, it's better to have ++ * completion. Not good to have this field here, it's better to have + * it in struct sk_buff, but it would make the code much more + * complicated and fragile, if maintained as a separate patch, since all + * skb then would have to contain only pages with the same value in this @@ -32,7 +32,7 @@ extern int net_msg_burst; #endif -+/* Support for notification on zero-copy TCP transfer completeion */ ++/* Support for notification on zero-copy TCP transfer completion */ +#define NET_PAGE_CALLBACKS_DEFINED +typedef void (*net_get_page_callback_t)(struct page *page); +typedef void (*net_put_page_callback_t)(struct page *page); Modified: trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.21.1.patch =================================================================== --- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.21.1.patch 2007-10-25 09:54:00 UTC (rev 210) +++ trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.21.1.patch 2007-10-25 10:46:29 UTC (rev 211) @@ -7,7 +7,7 @@ #endif /* WANT_PAGE_VIRTUAL */ + /* + * Used to implement support for notification on zero-copy TCP transfer -+ * completeion. Not good to have this field here, it's better to have ++ * completion. Not good to have this field here, it's better to have + * it in struct sk_buff, but it would make the code much more + * complicated and fragile, if maintained as a separate patch, since all + * skb then would have to contain only pages with the same value in this @@ -32,7 +32,7 @@ extern int net_msg_burst; #endif -+/* Support for notification on zero-copy TCP transfer completeion */ ++/* Support for notification on zero-copy TCP transfer completion */ +#define NET_PAGE_CALLBACKS_DEFINED +typedef void (*net_get_page_callback_t)(struct page *page); +typedef void (*net_put_page_callback_t)(struct page *page); Modified: trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.22.patch =================================================================== --- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.22.patch 2007-10-25 09:54:00 UTC (rev 210) +++ trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.22.patch 2007-10-25 10:46:29 UTC (rev 211) @@ -7,7 +7,7 @@ #endif /* WANT_PAGE_VIRTUAL */ + /* + * Used to implement support for notification on zero-copy TCP transfer -+ * completeion. Not good to have this field here, it's better to have ++ * completion. Not good to have this field here, it's better to have + * it in struct sk_buff, but it would make the code much more + * complicated and fragile, if maintained as a separate patch, since all + * skb then would have to contain only pages with the same value in this @@ -32,7 +32,7 @@ extern int net_msg_burst; #endif -+/* Support for notification on zero-copy TCP transfer completeion */ ++/* Support for notification on zero-copy TCP transfer completion */ +#define NET_PAGE_CALLBACKS_DEFINED +typedef void (*net_get_page_callback_t)(struct page *page); +typedef void (*net_put_page_callback_t)(struct page *page); Modified: trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.23.patch =================================================================== --- trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.23.patch 2007-10-25 09:54:00 UTC (rev 210) +++ trunk/iscsi-scst/kernel/patches/put_page_callback-2.6.23.patch 2007-10-25 10:46:29 UTC (rev 211) @@ -7,7 +7,7 @@ #endif /* WANT_PAGE_VIRTUAL */ + /* + * Used to implement support for notification on zero-copy TCP transfer -+ * completeion. Not good to have this field here, it's better to have ++ * completion. Not good to have this field here, it's better to have + * it in struct sk_buff, but it would make the code much more + * complicated and fragile, if maintained as a separate patch, since all + * skb then would have to contain only pages with the same value in this @@ -32,7 +32,7 @@ extern int net_msg_burst; #endif -+/* Support for notification on zero-copy TCP transfer completeion */ ++/* Support for notification on zero-copy TCP transfer completion */ +#define NET_PAGE_CALLBACKS_DEFINED +typedef void (*net_get_page_callback_t)(struct page *page); +typedef void (*net_put_page_callback_t)(struct page *page); Modified: trunk/scst-full_perf.patch =================================================================== --- trunk/scst-full_perf.patch 2007-10-25 09:54:00 UTC (rev 210) +++ trunk/scst-full_perf.patch 2007-10-25 10:46:29 UTC (rev 211) @@ -1,15 +1,17 @@ Index: scst/src/Makefile =================================================================== ---- scst/src/Makefile (revision 324) +--- scst/src/Makefile (revision 210) +++ scst/src/Makefile (working copy) -@@ -114,13 +114,13 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextr +@@ -114,7 +114,7 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextr #EXTRA_CFLAGS += -DSTRICT_SERIALIZING -EXTRA_CFLAGS += -DEXTRACHECKS +#EXTRA_CFLAGS += -DEXTRACHECKS - #EXTRA_CFLAGS += -fno-inline + #EXTRA_CFLAGS += -DUSE_EXPECTED_VALUES + #EXTRA_CFLAGS += -DALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ +@@ -123,7 +123,7 @@ EXTRA_CFLAGS += -DEXTRACHECKS #EXTRA_CFLAGS += -DTRACING @@ -20,7 +22,7 @@ #EXTRA_CFLAGS += -DDEBUG_OOM Index: scst/src/dev_handlers/Makefile =================================================================== ---- scst/src/dev_handlers/Makefile (revision 324) +--- scst/src/dev_handlers/Makefile (revision 208) +++ scst/src/dev_handlers/Makefile (working copy) @@ -68,10 +68,10 @@ endif Modified: trunk/scst-release.patch =================================================================== --- trunk/scst-release.patch 2007-10-25 09:54:00 UTC (rev 210) +++ trunk/scst-release.patch 2007-10-25 10:46:29 UTC (rev 211) @@ -1,14 +1,17 @@ Index: scst/src/Makefile =================================================================== ---- scst/src/Makefile (revision 324) +--- scst/src/Makefile (revision 210) +++ scst/src/Makefile (working copy) -@@ -114,13 +114,13 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextr +@@ -114,16 +114,16 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextr #EXTRA_CFLAGS += -DSTRICT_SERIALIZING -EXTRA_CFLAGS += -DEXTRACHECKS +#EXTRA_CFLAGS += -DEXTRACHECKS + #EXTRA_CFLAGS += -DUSE_EXPECTED_VALUES + #EXTRA_CFLAGS += -DALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ + #EXTRA_CFLAGS += -fno-inline -#EXTRA_CFLAGS += -DTRACING @@ -21,7 +24,7 @@ #EXTRA_CFLAGS += -DDEBUG_OOM Index: scst/src/dev_handlers/Makefile =================================================================== ---- scst/src/dev_handlers/Makefile (revision 324) +--- scst/src/dev_handlers/Makefile (revision 208) +++ scst/src/dev_handlers/Makefile (working copy) @@ -68,10 +68,10 @@ endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |