How to build and configure QLogic target driver for 22xx/23xx/24xx/25xx adapters on Ubuntu/Debian. A Step by step guide.
+
+
+
+
+ Prerequisites:
+
+
Ubuntu/Debian 64bit base installation as minumum, fully updated.
+
Working internet/network connection from this installation (for apt).
+
Knowledge of configuring a Linux Kernel (a good base to work on is the configuration from the running kernel after installation)
+
Check if there are any patches for your kernel here
+
+
+
+
+
+ Note 1: I know this guide never builds a debian kernel package, i did not care about this, i only wanted to get the Generic SCSI Target Subsystem for Linux to work. I also know its not a good idea to compile anything as root, but again: i did not care about that either: the machine was a clean install, nobody will ever get hurt by me compiling a kernel or anything else as root.
+
+
+ Note 2: I have to thank the original creator of this guide. I can not find your name but i can say i would not have been able to make it work wihtout it. I have based this document on that HowTo as a template.
+
+
+
ON TARGET
+
+
Run the following apt command to install everything you might need or find useful:
+
+
Get the appropiate firmware for your QLogic card from
+ ftp://ftp.qlogic.com/outgoing/linux/firmware/ and put it under /lib/firmware.
+ It is strongly recommended to use firmware version 5.x or higher for 24xx/25xx adapters. See
+ here
+ for more details why.
+
+
+
+ Without a firmware image during boot or when you manually insert the QLogic module, you might
+ get the following error message in the logs (dmesg, /var/log/kern.log or /var/log/syslog)
+
+
Get the SCST code. It is possibile either from the SCST downloads page
+ or from the SVN code base.
+
+ Below we will consider the case of the downloaded from the SVN code. For the release code everything is the same.
+ You only need unpack all downloaded SCST archives in one directory. It then will contain similar content as
+ ~scst/trunk/ below.
+
+ # svn co https://scst.svn.sourceforge.net/svnroot/scst
+
+ If the command returns successfully then you'll have 'scst'
+ directory under your current directory ( here it is /root )
+ Make sure you disable kernel hacking feature, and enable
+ "Device Drivers->SCSI device support->SCSI low level drivers->Qlogic 2xxx target mode support"
+ (i.e. CONFIG_SCSI_QLA2XXX_TARGET=y)
+ Also turn OFF HIGHMEM4G|HIGHMEM64G, i.e.
+
+ # grep -i highmem /usr/src/linux/.config
+ CONFIG_NOHIGHMEM=y
+ # CONFIG_HIGHMEM4G is not set
+ # CONFIG_HIGHMEM64G is not set
+
+ If you have system with more than 1GB of memory, consider to change CONFIG_VMSPLIT option to the corresponding value.
+
+ # pwd
+ /usr/src/linux
+ # make menuconfig
+ # make bzImage
+ # make modules
+ # make modules_install
+ # make install
+
+
+
Reboot the machine and during boot select the modified kernel to boot from.
+
Depending on your requirement (performance/debugging) apply the appropiate
+ patches that comes with choose the appropriate SCST build mode. By default SCST has debug build mode.
+ Here is how to switch to the release mode:
+
+ # pwd
+ /root/scst/trunk
+ # make debug2release
+
+
+
First make sure that the link "/lib/modules/`uname -r`/build"
+ points to the current running kernel sources. Now build the modules.
+
+
+
Build scst.
+
+ # cd /root/scst/trunk/scst/src
+ # make all (here I am building everything)
+ # make install
+
+
+
Build QLogic target driver
+
+ # cd /root/scst/trunk/qla2x00t/qla2x00-target/
+ # make
+ # make install
+
+
+
+
+
+
Insert the modules.
+ The driver modules will be installed in '/lib/modules/`you_kernel_version`/extra'.
+ In addition, scst.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.
+
+ # ls -l /lib/modules/`uname -r`/extra
+ total 232
+ drwxr-xr-x 2 root root 4096 Jun 20 18:43 dev_handlers
+ -rw-r--r-- 1 root root 36756 Jun 20 18:46 qla2x00tgt.ko
+ -rw-r--r-- 1 root root 160192 Jun 20 18:46 qla2xxx.ko
+ -rw-r--r-- 1 root root 190848 Jun 20 18:43 scst.ko
+ # ls -l /lib/modules/`uname -r`/extra/dev_handlers
+ total 192
+ -rw-r--r-- 1 root root 11757 Jun 20 18:43 scst_cdrom.ko
+ -rw-r--r-- 1 root root 10111 Jun 20 18:43 scst_changer.ko
+ -rw-r--r-- 1 root root 12420 Jun 20 18:43 scst_disk.ko
+ -rw-r--r-- 1 root root 12449 Jun 20 18:43 scst_modisk.ko
+ -rw-r--r-- 1 root root 10131 Jun 20 18:43 scst_processor.ko
+ -rw-r--r-- 1 root root 10081 Jun 20 18:43 scst_raid.ko
+ -rw-r--r-- 1 root root 12563 Jun 20 18:43 scst_tape.ko
+ -rw-r--r-- 1 root root 37937 Jun 20 18:43 scst_user.ko
+ -rw-r--r-- 1 root root 50194 Jun 20 18:43 scst_vdisk.ko
+
+ Where:
+ - scst - SCST itself
+ - scst_disk - device handler for disks (type 0)
+ - scst_tape - device handler for tapes (type 1)
+ - scst_processor - device handler for processors (type 3)
+ - scst_cdrom - device handler for CDROMs (type 5)
+ - scst_modisk - device handler for MO disks (type 7)
+ - scst_changer - device handler for medium changers (type 8)
+ - scst_raid - device handler for storage array controller (e.g. raid) (type C)
+ - scst_vdisk - device handler for virtual disks (file, device or ISO CD image).
+ - scst_user - user space device handler
+
+ You can insert any of these modules by 'modprobe' program, I've inserted all
+ the modules !!!
+
+ # for _mod in scst qla2xxx qla2x00tgt scst_vdisk scst_user scst_disk [...etc snip]; do modprobe $_mod; done
+
+
+ < snip from dmesg >
+
+ scst: SCST version 2.0.0 loaded successfully (max mem for commands 16251MB, per device 6500MB)
+ scst: Enabled features: TRACING
+ scst: Target template qla2x00tgt registered successfully
+ scst: Virtual device handler vdisk for type 0 registered successfully
+ scst: Virtual device handler "scst_user" registered successfully
+
+ < snip from dmesg >
+
+
Now let's create our virtual device:
+
+ # dd if=/dev/zero of=/mnt/disk1 bs=1024k count=512
+ 512+0 records in
+ 512+0 records out
+ # ls -l /mnt/disk1
+ -rw-r--r-- 1 root root 536870912 Jun 23 13:27 /mnt/disk1
+ # file /mnt/disk1
+ /mnt/disk1: data
+
+
+
To see the device remotely, we have to add it to at least in the LUNs set for our target.
+ We must have LUN 0 (LUs numeration must not start from, e.g., 1).
+
+ The simplest way to do that is to write an scstadmin's config file:
< snip from README >
+ Without loading appropriate device handler, corresponding device
+ will be invisible for remote initiators, hence we have to
+ add them manully.
+ < snip from README >
+
+ But as I've already loaded the device handler(scst_vdisk) on the target,
+ hence I don't need to perform step 17.
+
+
+
After enabling the target mode on the target (see step 16),
+ to see new targets and devices you need either to rescan
+ initiator(s) manually, for example, by rmmod/modprobe the
+ corresponding FC device module on the initiator, or reboot the initiator itself.
+ Automatic discovery isn't supported by all known initiators,
+ so you need a way to make SCSI subsystem on the initiator to do the new devices discovery and hence be able to see
+ the new devices attached.
+
+ Alternatively, if your initiator already connected to the target and you simply added new devices to it, you can try to run
+ a manual rescan by:
+
+
+
\ No newline at end of file
diff --git a/qla2x00t/qla2x00-target/qla2x00t-howto.html b/qla2x00t/doc/qla2x00t-howto.html
similarity index 100%
rename from qla2x00t/qla2x00-target/qla2x00t-howto.html
rename to qla2x00t/doc/qla2x00t-howto.html
diff --git a/www/comparison.html b/www/comparison.html
index 2f66fce83..cd67cfff3 100644
--- a/www/comparison.html
+++ b/www/comparison.html
@@ -37,6 +37,7 @@
Automatic sessions reassignment (changes in the
@@ -145,10 +143,10 @@ resized through AENs or Unit Attentions (initiators can instantly see
any target reconfiguration in a PnP-like manner)
+
-
-
-
-
Bidirectional Commands
+
+
-
-
+
Bidirectional Commands
+
+
-
+
-
Extended CDB (size >16 bytes)
+
+
-
-
+
Extended CDB (size >16 bytes)
+
+
-
+
Descriptor sense support
+
+
-
-
@@ -159,12 +157,12 @@ any target reconfiguration in a PnP-like manner)
+
-
Safe RESERVE/RELEASE implementation according to
-SCSI requirements 12
Support for AENs (initiators can instantly see any
@@ -466,54 +462,43 @@ target reconfiguration in a PnP-like manner)
+
- 2. All iSCSI management implemented in user space and actual data transfers in kernel space without user space involved.
-
3. ISER target driver has long known (since Feb 2008) data corruption problem, which localization hasn't been
- determined yet and might be in the STGT core. See
- here,
- here and
- here.
-
-
4. The result "in average" is listed. One target can be better somewhere, another one somewhere else. Although manual tuning of target and
+
3. The result "in average" is listed. One target can be better somewhere, another one somewhere else. Although manual tuning of target and
system parameters tends the restore the difference listed in the comparison. You can find example measurements here,
here and here.
-
5. All SCST and its drivers' kernel patches supposed to be applied and SCST with the drivers built in the release or performance build.
+
4. All SCST and its drivers' kernel patches supposed to be applied and SCST with the drivers built in the release or performance build.
Without the kernel patches SCST performance will be at "****+" level, except for the case, when user space backstorage handler used
with iSCSI-SCST iSCSI target driver, where performance will be at "***+" level.
-
6. There is no performance data for LIO, which allow to make a direct comparison with other targets.
- The conclusion was made based on source code study. LIO should have performance on the IET level or less,
- because of more processing overhead. It might be much less for small block sizes. Also the single I/O thread per-device
- approach LIO has is not optimal in many cases.
-
-
7. In SCST data are always passed in zero-copy manner between target and backend drivers without need for any
+
5. In SCST data are always passed in zero-copy manner between target and backend drivers without need for any
additional kernel patches, except in case, when local access (scst_local) used with user space backend.
-
8. Some zero-copy functionality isn't available from user space, sometimes fundamentally.
+
6. Some zero-copy functionality isn't available from user space, sometimes fundamentally.
For instance, zero-copy FILEIO with page cache or zero-copy send to a socket. Also STGT can't use splice() for in-kernel
target drivers, because it has memory management in user space. To use splice() with socket-based user space target drivers
STGT would need a deep redesign of internal interactions between target drivers, core and backend handlers. But in
some cases STGT can use zero-copy sendfile().
-
9. Local access to emulated backstorage devices" means that you can access emulated by a SCSI target devices
+
7. "Local access to emulated backstorage devices" means that you can access emulated by a SCSI target devices
locally on the target host. For instance, you can mount your ISO image from emulated by the target
CDROM device locally on the target host.
-
10. "Advanced devices access control" means that different initiators can see different sets
+
8. "Advanced devices access control" means that different initiators can see different sets
of devices from the same target. This feature is required for hardware targets, which don't have ability
to create virtual targets.
-
11. "Cache safe" means that cache synchronization commands (SYNCHRONIZE_CACHE and FUA attribute) from initiators perform
+
9. "Cache safe" means that cache synchronization commands (SYNCHRONIZE_CACHE and FUA attribute) from initiators perform
what they expected to perform, i.e. push all the requested blocks from all caches, including devices' caches,
to non-volatile media.
-
12. SCSI requires that if an initiator clears reservation held by another initiator, the reservation holder must be notified
+
10. SCSI requires that if an initiator clears reservation held by another initiator, the reservation holder must be notified
about the reservation clearance. Otherwise, several initiators can at the same time change supposed to be protected by the
reservation data, which can corrupt them. This is what was called
"Russian roulette with your data" on the VMware
community forum by someone working for VMware. But, sure, it can affect not only VMware, but also any other cluster
implementation, relying on this functionality.
-
13. After a task management command completed and before the corresponding response was sent to the initiator, who sent that task management
+
11. After a task management command completed and before the corresponding response was sent to the initiator, who sent that task management
command, all the affected SCSI commands must get into a state, where they can't affect following after
the tasks management response commands from this initiator. This is the safe implementation.
The unsafe implementation only marks all the affected
@@ -523,44 +508,43 @@ target reconfiguration in a PnP-like manner)
+
-
-
14. Both IET and LIO report in INQUIRY command response support for full task management model. But they process ORDERED
+
12. Both IET and LIO report in INQUIRY command response support for full task management model. But they process ORDERED
commands the same way as SIMPLE commands, i.e. allow free reorder of them before they get executed. That violates SCSI standard
and can lead to a data corruption to any application relying on commands order provided by ORDERED attribute.
-
15. LIO exports the information needed for an RFC 4455 implementation, but requires additional RFC 4455 implementing module.
+
13. LIO exports the information needed for an RFC 4455 implementation, but requires additional RFC 4455 implementing module.
At the moment, there is no open source implementation of such module.
-
16. SCSI pass-through mode allows to export your local SCSI-capable device. For instance with it you can share your parallel
+
14. SCSI pass-through mode allows to export your local SCSI-capable device. For instance with it you can share your parallel
SCSI tape or SATA DVD-RW device to your iSCSI network.
-
17. STGT and LIO don't emulate all the necessary SCSI host functionality to allow to share SCSI devices
+
15. STGT and LIO don't emulate all the necessary SCSI host functionality to allow to share SCSI devices
in pass-through mode to several initiators, although LIO has some necessary processing, but not all.
They can only pass SCSI commands from initiators to
SCSI devices and responses back. This is safe only with a single initiator. This limitation
isn't enforced anyhow and both STGT and LIO don't issue any warning about it, so an user will not be notified about this
limitation and can quietly corrupt his/her data. You can find more technical information about it
here.
- Also neither STGT, nor LIO in pass-through mode do the necessary sense processing for tape devices to
- correctly return residual information, so tapes can used with them with limited functionality.
+ Also LIO in pass-through mode doesn't do necessary sense processing for tape devices to
+ correctly return residual information, so tapes can used with it with limited functionality.
-
18. You can find a proposal how to implement zero-copy FILEIO in SCST on the
+
16. You can find a proposal how to implement zero-copy FILEIO in SCST on the
Contributing page.
-
19. Doesn't need any kernel patch, except in the case, when used with user space backend.
+
17. Doesn't need any kernel patch, except in the case, when used with user space backend.
-
20. Connections and sessions reinstatement is, basically, a kind of Task Management command, because it implies commands aborting.
+
18. Connections and sessions reinstatement is, basically, a kind of Task Management command, because it implies commands aborting.
So, similarly to the safe task management above, a safe implementation of connections and sessions reinstatement
must not accept SCSI commands from new connection/session until all the SCSI commands in
being reinstated connection/session get into a state, where they can't affect new commands.
-
21. "Safe restart" means that after the iSCSI target restart, all the connected initiators will seamlessly restore all existing before
+
19. "Safe restart" means that after the iSCSI target restart, all the connected initiators will seamlessly restore all existing before
the restart connections. "Not safe" means that, most likely, the connected initiators will fail to restore
existing connections with some errors. However, your iSCSI initiator also should be able to handle the safe restart. For instance,
old (pre-CentOS/RHEL 5) open-iscsi has problems in this area. But the latest versions do it pretty well.
-
22. All ALUA states
- transitioning implemented as empty placeholders, which means this implementation can't be used to build ALUA-based
- clusters without additional code.
+
20. Generic implementation, i.e. not coupled to any particular cluster implementation, which means it is needed additional effort
+ to used with each particular cluster setup.
The latest stable released version of SCST core is 2.0.0.1. It requires Linux kernel 2.6.18 or higher.
- More detail information you could find in its README file.
+
The latest stable released version of SCST core is 2.0.0.1. The latest updates for it
+ you can find it in the SVN branch 2.0.0.x.
+
+
The latest stable pre release version is 2.1-rc1. You can find it in the SVN branch 2.1.0.x.
You can also download prebuilt SCST modules for
Scientific Linux CERN 5 (RHEL5-based),
diff --git a/www/index.html b/www/index.html
index 4946ae8f9..16bf3b9d8 100644
--- a/www/index.html
+++ b/www/index.html
@@ -151,6 +151,7 @@
LIO, from recently being renamed to TCM, is another independent from SCST implementation
+ of SCSI target framework for Linux. It's started as PyX iSCSI target and then was
+ accommodated to other transports. But it's still in many kinds iSCSI-oriented.
+ You can find an example when people are not happy with it
+ here.
+
+
LIO maintainer, Nicholas Bellinger, is very good in building personal relationships and promoting LIO,
+ although often using misleading half, less-then-half and simply deceitful statements
+ about LIO current state, capabilities and future directions as well as about its competitor, SCST.
+ For instance, he setup LIO targets comparison page with obviously wrong statements about SCST, like
+ that it isn't fully zero copy or it isn't a generic target engine (while LIO, of course, is fully
+ zero-copy and fully generic target engine). Any
+ attempts
+ to correct it were simply ignored.
+
+
With those tricks Nicholas Bellinger was capable to attract key Linux kernel developers, and
+ they suddenly changed their opinion about Linux SCSI target subsystem in the opposite direction.
+ They previously asserted that
+ in-kernel SCSI target is the wrong direction, SCSI target must be in the user space, so
+ STGT is what everybody needed. Now their opinion is that SCSI target driver should be in the kernel space
+ and the only target good for them is LIO, doesn't matter that:
+
+
+
SCST is a lot more mature and advanced
+
+
SCST from the beginning is a generic SCSI target
+
+
SCST has a lot more features
+
+
SCST has better performance
+
+
SCST has a lot more users
+
+
SCST has much bigger community
+
+
+
+
So, rejecting base principles of the Linux kernel community that the best code should win, the worst
+ code was chosen.
+
+
You can find more background behind choosing LIO as the mainline kernel SCSI target
+ subsystem if you read this thread
+ as well as searching for targets related topics in Linux kernel and Linux SCSI mailing lists.
+
+
Particularly notable is that James Bottomley from the beginning was telling that SCST
+ can't be merged in the mainline kernel, because it doesn't offer a drop in replacement for STGT
+ to avoid having 2 target infrastructures in the kernel at the same time. But, since LIO can't
+ offer user space backend drivers and doesn't have ibmvstgt driver analog, for LIO the drop in replacement wasn't
+ a requirement, so 2.6.38+ kernels successfully have both STGT and LIO.
Also don't be deceived by the fact that some (small) part of STGT was accepted into the kernel.
- It doesn't mean that STGT has the "kernel quality". STGT as a whole similarly to any other
- out-of-kernel-tree project lives on its own, hence has its own quality level, which isn't necessary better, than the
- quality level of SCST.
+
Time has proved that STGT is too weak to satisfy modern storage requirements. Now it is obsolete and
+ soon going to be removed from the mainline kernel.