From 8b77aa8ad2601061f48d2eae2c454e0c54dd66d4 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 26 Jun 2008 16:35:10 +0000 Subject: [PATCH] Minor cleanups and docs updates git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@422 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- AskingQuestions | 3 +++ README | 8 ++++--- doc/Makefile | 2 ++ doc/scst_pg.sgml | 6 ++--- doc/scst_user_spec.txt | 2 ++ iscsi-scst/AskingQuestions | 3 +++ iscsi-scst/README | 3 ++- iscsi-scst/kernel/target.c | 2 +- iscsi-scst/usr/ctldev.c | 4 ---- qla2x00t/qla2x00-target/AskingQuestions | 3 +++ qla2x00t/qla2x00-target/README | 14 +++++++---- qla2x00t/qla2x00-target/qla2x00t.c | 2 +- scst/AskingQuestions | 3 +++ scst/README | 31 +++++++++++++++---------- scst/src/scst_main.c | 20 +++++++++------- 15 files changed, 69 insertions(+), 37 deletions(-) diff --git a/AskingQuestions b/AskingQuestions index 4869ce525..0eace059d 100644 --- a/AskingQuestions +++ b/AskingQuestions @@ -313,4 +313,7 @@ reading and minimal thinking effort. Also it is very desirable if you attach to your question full kernel log from target since it's booted. +If you experience kernel crash, hang, etc., you should follow +REPORTING-BUGS file from your kernel source tree. + Vladislav Bolkhovitin , http://scst.sourceforge.net diff --git a/README b/README index 0aa5ee3c5..4a3b41e27 100644 --- a/README +++ b/README @@ -4,11 +4,13 @@ as the following: 1. SCST core in scst/ subdirectory -2. Target drivers in own subdirectories qla2x00t/, iscsi-scst/, etc. +2. Administration utility for SCST core scstadmin in scstadmin/ -3. User space programs in usr/ subdirectory, like fileio_tgt. +3. Target drivers in own subdirectories qla2x00t/, iscsi-scst/, etc. -4. Some various docs in doc/ subdirectory. +4. User space programs in usr/ subdirectory, like fileio_tgt. + +5. Some various docs in doc/ subdirectory. Those subprojects are in most cases independent from each other, although some of them depend from the SCST core. They put in the single diff --git a/doc/Makefile b/doc/Makefile index 3fc8dd41f..f613e169d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -54,7 +54,9 @@ $(SOURCE_NAME).rtf: $(SOURCE) $(COMMAND)rtf $(SOURCE) clean: + @mv scst_user_spec.txt scst_user_spec.tx rm -f *.txt *.html *.tex *.dvi *.ps *.pdf *.info *.lyx *.rtf + @mv scst_user_spec.tx scst_user_spec.txt extraclean: clean diff --git a/doc/scst_pg.sgml b/doc/scst_pg.sgml index 4443b3799..b9d0069a8 100644 --- a/doc/scst_pg.sgml +++ b/doc/scst_pg.sgml @@ -5,7 +5,7 @@ Generic SCSI Target Middle Level for Linux - Vladislav Bolkhovitin < + Vladislav Bolkhovitin Version 0.9.5 2006/12/01, actual for SCST 0.9.5 and later @@ -39,8 +39,8 @@ required. 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 +kernel drivers development. For example, a target driver for QLogic +22xx/23xx 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. diff --git a/doc/scst_user_spec.txt b/doc/scst_user_spec.txt index 9cd035819..e1fd9071c 100644 --- a/doc/scst_user_spec.txt +++ b/doc/scst_user_spec.txt @@ -872,3 +872,5 @@ one - 1M, for it the VTL also will be asked to allocate the buffer. Then, if no more 4K commands come for some time, for it SCST_USER_ON_CACHED_MEM_FREE subcommand will be returned to the VTL in order to ask it to free that buffer. + +Vladislav Bolkhovitin diff --git a/iscsi-scst/AskingQuestions b/iscsi-scst/AskingQuestions index 4869ce525..0eace059d 100644 --- a/iscsi-scst/AskingQuestions +++ b/iscsi-scst/AskingQuestions @@ -313,4 +313,7 @@ reading and minimal thinking effort. Also it is very desirable if you attach to your question full kernel log from target since it's booted. +If you experience kernel crash, hang, etc., you should follow +REPORTING-BUGS file from your kernel source tree. + Vladislav Bolkhovitin , http://scst.sourceforge.net diff --git a/iscsi-scst/README b/iscsi-scst/README index 9e4b8c7e1..eaa3a1f21 100644 --- a/iscsi-scst/README +++ b/iscsi-scst/README @@ -111,7 +111,8 @@ Usage ISCSI parameters like iSNS, CHAP and target parameters are configured in iscsi-scstd.conf. All LUN information is configured using the regular -SCST interface. The LUN information in iscsi-scstd.conf will be ignored. +SCST interface. It is highly recommended to use scstadmin utility for +that purpose. The LUN information in iscsi-scstd.conf will be ignored. This is because now responsibilities are divided (as it should be) between the target driver (iSCSI-SCST) and the SCST core as it logically should be: the target driver is responsible for handling targets and diff --git a/iscsi-scst/kernel/target.c b/iscsi-scst/kernel/target.c index 4a4b102ee..19f7b8113 100644 --- a/iscsi-scst/kernel/target.c +++ b/iscsi-scst/kernel/target.c @@ -223,7 +223,7 @@ void target_del_all(void) TRACE_MGMT_DBG("%s", "Deleting all targets"); - /* Complete brain damage, ToDo */ + /* Not the best, ToDo */ while (1) { mutex_lock(&target_mgmt_mutex); diff --git a/iscsi-scst/usr/ctldev.c b/iscsi-scst/usr/ctldev.c index 6301a9549..7eb888261 100644 --- a/iscsi-scst/usr/ctldev.c +++ b/iscsi-scst/usr/ctldev.c @@ -144,10 +144,6 @@ static int iscsi_conn_destroy(u32 tid, u64 sid, u32 cid) return err; } -/** - ** ToDo: the below code is a brain damage, rewrite it. - **/ - static int __conn_close(int fd, u32 tid, u64 sid, u32 cid, void *arg) { return ki->conn_destroy(tid, sid, cid); diff --git a/qla2x00t/qla2x00-target/AskingQuestions b/qla2x00t/qla2x00-target/AskingQuestions index 4869ce525..0eace059d 100644 --- a/qla2x00t/qla2x00-target/AskingQuestions +++ b/qla2x00t/qla2x00-target/AskingQuestions @@ -313,4 +313,7 @@ reading and minimal thinking effort. Also it is very desirable if you attach to your question full kernel log from target since it's booted. +If you experience kernel crash, hang, etc., you should follow +REPORTING-BUGS file from your kernel source tree. + Vladislav Bolkhovitin , http://scst.sourceforge.net diff --git a/qla2x00t/qla2x00-target/README b/qla2x00t/qla2x00-target/README index 7dbbf7593..e24302797 100644 --- a/qla2x00t/qla2x00-target/README +++ b/qla2x00t/qla2x00-target/README @@ -13,7 +13,7 @@ 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. -This version is compatible with SCST version 1.0.0 and higher. +This version is compatible with SCST core version 1.0.0 and higher. The original initiator driver was taken from the kernel 2.6.17.8. @@ -62,12 +62,18 @@ subdirectory. The target driver will be installed in /lib/modules/`you_kernel_version`/extra. To uninstall it, type 'make uninstall'. -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: +After the drivers are loaded and adapters successfully initialized by +the initiator driver, including firmware image load, 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 +Then you should configure exported devices using the corresponding +interface of SCST core. It is highly recommended to use scstadmin +utility for that purpose. + Compilation options ------------------- diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 189ff5ece..d9df17f55 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -176,7 +176,7 @@ static void q2t_modify_command_count(scsi_qla_host_t *ha, int cmd_count, /* ha->hardware_lock supposed to be held on entry */ static void __q2t_send_notify_ack(scsi_qla_host_t *ha, uint16_t target_id, uint16_t status, uint16_t task_flags, - uint16_t seq_id, uint32_t add_flags, uint16_t resp_code, + uint16_t seq_id, uint32_t add_flags, uint16_t resp_code, int resp_code_valid, uint16_t ox_id) { nack_entry_t *ntfy; diff --git a/scst/AskingQuestions b/scst/AskingQuestions index 4869ce525..0eace059d 100644 --- a/scst/AskingQuestions +++ b/scst/AskingQuestions @@ -313,4 +313,7 @@ reading and minimal thinking effort. Also it is very desirable if you attach to your question full kernel log from target since it's booted. +If you experience kernel crash, hang, etc., you should follow +REPORTING-BUGS file from your kernel source tree. + Vladislav Bolkhovitin , http://scst.sourceforge.net diff --git a/scst/README b/scst/README index e02c3fb1f..1d60569c0 100644 --- a/scst/README +++ b/scst/README @@ -95,6 +95,9 @@ Then, to see your devices remotely, you need to add them to at least are seen remotely. There must be LUN 0 in each security group, i.e. LUs numeration must not start from, e.g., 1. +It is highly recommended to use scstadmin utility for configuring +devices and security groups. + If you experience problems during modules load or running, check your kernel logs (or run dmesg command for the few most recent messages). @@ -343,18 +346,22 @@ Access and devices visibility management (LUN masking) ------------------------------------------------------ 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 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 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. +group of initiators to have different views of LUs/LUNs (security groups) +each with appropriate access permissions. It is highly recommended to +use scstadmin utility for that purpose instead of described in this +section low level interface. + +Initiator is represented as an SCST session. The 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 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 "names". File diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 863ecf67c..f231258b8 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -497,14 +497,18 @@ int scst_suspend_activity(bool interruptible) * reference counting? That would mean to switch off from lockless * implementation of scst_translate_lun().. ) */ - PRINT_INFO("Waiting for %d active commands to complete... This might " - "take few minutes for disks or few hours for tapes, if you " - "use long executed commands, like REWIND or FORMAT. In case, " - "if you have a hung user space device (i.e. made using " - "scst_user module) not responding to any commands, if might " - "take virtually forever until the corresponding user space " - "program recovers and starts responding or gets killed.", - atomic_read(&scst_cmd_count)); + + if (atomic_read(&scst_cmd_count) != 0) { + PRINT_INFO("Waiting for %d active commands to complete... This " + "might take few minutes for disks or few hours for " + "tapes, if you use long executed commands, like " + "REWIND or FORMAT. In case, if you have a hung user " + "space device (i.e. made using scst_user module) not " + "responding to any commands, if might take virtually " + "forever until the corresponding user space " + "program recovers and starts responding or gets " + "killed.", atomic_read(&scst_cmd_count)); + } res = scst_susp_wait(interruptible); if (res != 0)