Files
scst/mvsas_tgt
Yan Burman e8f0d9af09 Merged revisions 5671,5687-5697,5723 via svnmerge from
svn+ssh://yanb123@svn.code.sf.net/p/scst/svn/branches/3.0.x

................
  r5671 | bvassche | 2014-07-10 09:27:29 +0300 (Thu, 10 Jul 2014) | 1 line
  
  scst: Create /var/lib/scst/pr and /var/lib/scst/vdev_mode_pages during installation (merge r5669 and r5670 from trunk)
................
  r5687 | bvassche | 2014-07-20 08:59:31 +0300 (Sun, 20 Jul 2014) | 1 line
  
  iscsi-scst: Handle data buffers with non-zero offset correctly (merge r5683 from trunk)
................
  r5688 | bvassche | 2014-07-20 09:01:49 +0300 (Sun, 20 Jul 2014) | 1 line
  
  Makefile: Only report which RPMs have been built if "make rpm" is run as a non-privileged user (merge r5560 from trunk)
................
  r5689 | bvassche | 2014-07-20 09:03:55 +0300 (Sun, 20 Jul 2014) | 1 line
  
  fcst: Remove an unused variable (merge r5605 from trunk)
................
  r5690 | bvassche | 2014-07-20 09:04:43 +0300 (Sun, 20 Jul 2014) | 1 line
  
  fcst: Move exch_done() calls into ft_cmd_done() (merge r5606 from trunk)
................
  r5691 | bvassche | 2014-07-20 09:05:27 +0300 (Sun, 20 Jul 2014) | 1 line
  
  fcst: Handle frame send failures properly (merge r5607 from trunk)
................
  r5692 | bvassche | 2014-07-20 09:07:57 +0300 (Sun, 20 Jul 2014) | 1 line
  
  qla2x00t: Documentation / source code comment / log messages spelling fix (merge r5555 from trunk)
................
  r5693 | bvassche | 2014-07-20 09:46:28 +0300 (Sun, 20 Jul 2014) | 1 line
  
  scst: Make lockdep_assert_held() easier to use (merge r5573 from trunk)
................
  r5694 | bvassche | 2014-07-20 09:47:58 +0300 (Sun, 20 Jul 2014) | 1 line
  
  scst: Leave out FSF mail address (merge r5572 from trunk)
................
  r5695 | bvassche | 2014-07-20 09:52:12 +0300 (Sun, 20 Jul 2014) | 1 line
  
  Change BUG_ON(1) into BUG() (merge r5618 from trunk)
................
  r5696 | bvassche | 2014-07-20 09:54:00 +0300 (Sun, 20 Jul 2014) | 1 line
  
  iscsi-scst: Suppress a compiler warning (merge r5614 from trunk)
................
  r5697 | bvassche | 2014-07-20 10:03:04 +0300 (Sun, 20 Jul 2014) | 1 line
  
  scst/include/scst.h: Define lockdep_assert_held() only once (follow-up for r5693)
................
  r5723 | vlnb | 2014-08-21 08:21:55 +0300 (Thu, 21 Aug 2014) | 11 lines
  
  Merged revisions 5721 via svnmerge from 
  svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk
  
  ........
    r5721 | vlnb | 2014-08-20 22:17:47 -0700 (Wed, 20 Aug 2014) | 5 lines
    
    Fix incorrect address computation during receive PDUs preparations
    
    Found and fix suggested by Кирилл Тюшев <kirill.tyushev8@gmail.com>
  ........
................


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x-iser@5739 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-27 13:49:04 +00:00
..
2009-06-18 09:12:44 +00:00
2014-02-24 06:56:44 +00:00

LIBSAS driver for Marvell 88SE63xx/64xx/68xx/94xx SAS controller
======================================================

This driver 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 mode only,
when a host acts as the initiator and the target simultaneously, is
supported as well.

This version is compatible with SCST core version 1.0.0 and higher and
Linux kernel 2.6.25 and higher,  which must include libsas module.

The original initiator driver was taken from the kernel 2.6.25.


See also "ToDo" for list of known issues and unimplemented 
features.


Installation:
------------
Only vanilla kernels from kernel.org are supported, but it should work
on vendors' kernels, if you manage to successfully compile on them. The
main problem with vendor's kernels is that they often contain patches,
which will appear only in the next version of the vanilla kernel,
therefore it's quite hard to track such changes. Thus, if during
compilation for some vendor kernel your compiler complains about
redefinition of some symbol, you should either switch to vanilla kernel,
or change as necessary the corresponding to that symbol "#if
LINUX_VERSION_CODE" statement.

At first, make sure that the link "/lib/modules/`you_kernel_version`/build" 
points to the source code for your currently running kernel.

Second, patch the libsas and then make libsas module to install in in your 
currently running kernel, also you should add ATA support for libsas in the 
kerenl if you want to support SATA device.

The codes have included the SCST code for supportting target, you need patch 
the kernel use the patch file in ./scst/kernel. To compile the target driver,
at first, build scst in scst directory, then insmod scst_disk.ko to support 
real disk, insmod scst_vdisk.ko to support vdisk, etc.
then, you should make sure the make option SUPPORT_TARGET has been enabled
in Makefile of mvsas, and then type 'make' in mvsas/ subdirectory. It will build 
mvsas.ko module.

To install the target driver, type 'make install' in mvsas/
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 and adapters are successfully initialized by
the initiator driver, including firmware image load, you can type following
command to show the detailed phy info,
cat /sys/class/scsi_host/hostX/target_mode
X is the host number of the controller, then you can get the info like

phy  dev sas address     attach dev type   attach sas address  target mode
0    5005043011ab004b    SAS  END DEVICE   5000c50008424415    0
1    5005043011ab004b    SAS  END DEVICE   5000c500064c363d    0
2    5005043011ab004b                      0                   0
3    5005043011ab004b    SAS  END DEVICE   500000e0192a37e2    0
4    5005043011ab0000    SAS  EXPANDER     5000155d220bc23f    0
5    5005043011ab0000    SAS  EXPANDER     5000155d220bc23f    0
6    5005043011ab0000    SAS  EXPANDER     5000155d220bc23f    0
7    5005043011ab0000    SAS  EXPANDER     5000155d220bc23f    0

then you can choose the one phy to enable the target mode of it.The target 
mode should be enabled/disable via a sysfs interface on a per card basis. Under 
the appropriate scsi_host there is an entry 'target_mode', where you should
type command like:

echo "enable X" >/sys/class/scsi_host/hostY/target_mode
echo "disable X" >/sys/class/scsi_host/hostY/target_mode

X is the phy number, Y is the host number of controller.

eg: echo "disable 1" >/sys/class/scsi_host/host4/target_mode

when you try to enale one phy of the controller, driver will enable all the
phys which have the same SAS address.

Then you should configure exported devices using the corresponding
interface of SCST core. you can configure the target group
as README file of SCST described, like:

echo "add 1:0:1:0 0" >/proc/scsi_tgt/groups/Default/devices

also you can delete a LUN from target, like:

echo "del 1:0:1:0 0" >/proc/scsi_tgt/groups/Default/devices

for details of configure target disk group, pleae refer to README of SCST.

note: 
1. Appropriate phy should be setted to target mode for initiator to detect 
   disks by this phy.
2. In example "add 2:0:0:0 1" the '1' is the LUN in the target, LUN 0 must 
   exist with a target. 
3. When one device is added to target disk group, target driver will notify
   initiator the changing of the phy mode and arriving of the disk, but some
   initiator driver don't support phy mode changing well, so 'rmmod' and 
   'modprobe'/'insmod' the initiator driver is neccessary.


following is an example for configuring the target driver.

> modprobe libsas
> insmod mvsas.ko
> echo 1 >/sys/class/scsi_host/host4/target_mode
> echo "add 4:0:0:0 0" >/proc/scsi_tgt/groups/Default/devices

Compilation options
-------------------

There are the following compilation options, that could be commented
in/out in Makefile:

 - CONFIG_SCST_DEBUG - turns on some debugging code, including some logging.
   Makes the driver considerably bigger and slower, producing large amount of
   log data.

 - CONFIG_SCST_TRACING - turns on ability to log events. Makes the driver
   considerably bigger and leads to some performance loss.

 - MV_DEBUG -  turns on some debugging code for target driver itself.


Send patches and questions about this driver to
scst-devel@lists.sourceforge.net, CC: Andy Yan <ayan@marvell.com>.