Files
scst/mpt
Vladislav Bolkhovitin cc28ddcdf2 Apparently the SCST code with debugging and/or tracing enabled compiles fine as
an external module. When applying the SCST kernel patch to the mainstream 
kernel tree with debugging and/or tracing enabled however, the resulting code
triggers a compiler error. This is because the symbols DEBUG and TRACING
conflict with symbols with the same named defined in unrelated kernel headers.
The patch below resolves these conflicts by renaming the following preprocessor 
symbols:
- DEBUG into CONFIG_SCST_DEBUG.
- DEBUG_DIGEST_FAILURES into CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES.
- DEBUG_OOM into CONFIG_SCST_DEBUG_OOM.
- DEBUG_RETRY into CONFIG_SCST_DEBUG_RETRY.
- DEBUG_SN into CONFIG_SCST_DEBUG_SN.
- DEBUG_TM into CONFIG_SCST_DEBUG_TM.
- EXTRACHECKS into CONFIG_SCST_EXTRACHECKS.
- SCST_HIGHMEM into CONFIG_SCST_HIGHMEM.
- STRICT_SERIALIZING into CONFIG_SCST_STRICT_SERIALIZING.
- TM_DBG_GO_OFFLINE into CONFIG_SCST_TM_DBG_GO_OFFLINE. Mapped 0/1 values
  into macro undefined / macro defined.
- TRACING into CONFIG_SCST_TRACING.
- USE_EXPECTED_VALUES into CONFIG_SCST_USE_EXPECTED_VALUES.
- In qla_isp/linux/isp_scst.c, renamed DEBUG into DEBUG_ISP_SCST.
- In qla_isp/..., renamed SCSI_TARGET in SCST_SCSI_TARGET.
- In qla_isp/..., renamed SCSI_TARGET_DEV in SCST_SCSI_TARGET_DEV.
Additionally, all CONFIG_SCSI_TARGET* macro's are renamed into CONFIG_SCST* in
order to avoid confusion between the STGT CONFIG-symbols and the SCST CONFIG-
symbols.

The following additional options are now configurable through Kconfig:
- CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
- CONFIG_SCST_STRICT_SERIALIZING
- CONFIG_SCST_STRICT_SECURITY
- CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
- CONFIG_SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING
- CONFIG_SCST_USE_EXPECTED_VALUES
- CONFIG_SCST_DEBUG_OOM
- CONFIG_SCST_DEBUG_RETRY
- CONFIG_SCST_DEBUG_SN
- CONFIG_SCST_DEBUG_TM
- CONFIG_SCST_TM_DBG_GO_OFFLINE

The patch below has been verified as follows:
- Verified that the following command does not print any new warning messages:
  make -s clean && make -C srpt -s clean && make -s scst iscsi-scst && make -C srpt -s
- Verified as follows that the internal SCST patches still apply cleanly:
  for p in *patch; do patch -p0 --dry-run -f -s <$p; done
- Checked that the patch generated by generate-kernel-patch still applies
  cleanly to the 2.6.25.7 kernel, and that the patched kernel tree still
  compiles, installs and boots fine, that the iscsi-scst, ib_srpt,
  scst_disk and scst_vdisk modules still load, and that iSCSI communication
  still works fine. All SCST kernel configuration options that could be
  enabled have been enabled during this test.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@453 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-07-10 10:49:06 +00:00
..
2008-07-09 06:53:41 +00:00
2006-12-13 11:42:59 +00:00

Target driver for LSI/MPT XXX cards
===================================

Version X.X.X, XX XXX 200X
--------------------------

This driver was originally developed by Hu Gang and then is developed by
Erik Habbinga <erikhabbinga@inphase-tech.com>. It is on the early stage
of development.

The current maintainer of this driver is Erik. Please send him all
question related to it (CC: scst-devel@lists.sourceforge.net).

Building from the Linux kernel tree
-----------------------------------

To build from the kernel tree, you should:

1. Link drivers/message/fusion/mpt_scst to $(SCST_DIR)/mpt.

2. Copy or link Makefile and Kconfig from $(SCST_DIR)/mpt/in-tree to
$(SCST_DIR)/mpt (Makefile will be replaced).

3. Patch drivers/message/fusion/Makefile and
drivers/message/fusion/Kconfig by diffs from $(SCST_DIR)/mpt/in-tree

4. 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
and ports it to the SCST architecture.

The LSI hardware returns an error when it realizes that command
status and sense data cannot be sent in the same transaction.
This happens during non-packetized SCSI command handling (not FC or
SAS).  For SCSI implementations, the driver speculatively caches
sense data.  If the hardware reports that the sense data could not
be sent, the driver will return the cached sense data without
involving SCST if the next command is REQUEST SENSE.  Cached sense
data is discarded on bus reset or if the next command after sense
send failure was not REQUEST SENSE.

Caching sense data in this fashion probably won't work in a tagged
command queuing environment. If SCSI hardware is being used, the
driver inspects responses to the INQUIRY command and clears the
BQUE and CMDQUE bits in the standard INQUIRY response to disable
tagged command queuing.

Known issues
------------

Newer versions of SCSI HBA firmware have a bug where the incorrect
amount of data is transferred for non-divisible-by-4 length transfers
(like standard 14 byte REQUEST SENSE). It's hit or miss for recently
bought cards if it has bad firmware or not. Some recently acquired PCIe
SCSI HBA had a mix of good and bad target firmware. Revision 1.03.29 is
where it broke, and all the target firmware on LSI's website is 1.03.34,
which is broken for target mode. As a workaround the SCSI parallel
transfer rate is forced to very slow asynchronous wide (Fast-5), which
doesn't quite hit >> 10 MB/sec, depending on the SCSI HBA firmware
revision. LSI is aware of the problem and the driver will be updated to
restore functionality upon a new good SCSI HBA firmware release.