QLogic

The Linux SCSI Target Wiki

(Difference between revisions)
Jump to: navigation, search
m
(Redirected page to Fibre Channel)
 
(18 intermediate revisions not shown)
Line 1: Line 1:
-
{{Infobox software
+
#REDIRECT [[Fibre Channel]]
-
| name                  = LIO Target
+
-
| logo                  = [[Image:Logo_QLogic.png|180px|Logo]]
+
-
| screenshot            = QLogic Corp.
+
-
| caption                = QLogic Fibre Channel fabric module
+
-
| collapsible            =
+
-
| author                = {{Nicholas Bellinger}}<br/>{{Andrew Vasquez}}<br/>{{Madhu Iyengar}}
+
-
| developer              = {{RTS legal}}
+
-
| released              = {{RTS releases|FC-QLogic|initial_date}}
+
-
| discontinued          = {{RTS releases|FC-QLogic|eol_date}}
+
-
| latest release version = {{RTS releases|FC-QLogic|release_ver}}
+
-
| latest release date    = {{RTS releases|FC-QLogic|release_date}}
+
-
| latest preview version = {{RTS releases|FC-QLogic|preview_ver}}
+
-
| latest preview date    = {{RTS releases|FC-QLogic|preview_date}}
+
-
| status                = {{RTS releases|FC-QLogic|status}}
+
-
| frequently updated    =
+
-
| programming language  = C
+
-
| operating system      = Linux
+
-
| platform              =
+
-
| size                  =
+
-
| language              =
+
-
| genre                  = Fabric module
+
-
| license                = GNU General Public License
+
-
| website                = {{RTS website}}
+
-
}}
+
-
:''See [[Target]] for a complete overview over all fabric modules.''
+
-
 
+
-
{{Image|Tcm qla2xxx-pcie-passthrough-to-baremetal.png|TCM_QLA2xxx running at line rate HW target mode from with PCIe device passthrough with MSI-X polled interrupts across Linux/SCSI qla2xxx LLD request and response rings}}
+
-
{{Image|Tcm_qla2xx-qemu-kvm-megasas-windows7-64-bit.png|TCM v4.0 QLAXXX prototype using PCIe device passthrough for target mode MSI-X interrupts, and QEMU Megasas HBA emulation into Windows7 64-bit guest.}}
+
-
 
+
-
'''[http://www.qlogic.com QLogic]''' qla2xxx series [[Fibre Channel]] ASICs and HBAs are supported by a fabric module ([http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=blob;f=drivers/scsi/qla2xxx/tcm_qla2xxx.c;hb=HEAD tcm_qla2xxx.c]) and a complementary qla2xxx target mode LLD, using the [[Target]] core infrastructure.
+
-
 
+
-
The latest version of the tcm_qla2xxx fabric module ([http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=shortlog master]). The qla2xxx LLD target mode logic was refactored from the [[Features#SCST|SCST]] qla2x00t driver, and contains a number of fixes and performance optimizations, including a modern LLD port ([http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=blob;f=drivers/scsi/qla2xxx/qla_target.c;hb=HEAD qla_target.c]) of the qla2x00t target logic.
+
-
 
+
-
== Status ==
+
-
 
+
-
The QLogic driver is in BETA, and currently being hardened in the QLogic test labs.
+
-
 
+
-
Here's an overview over the status:
+
-
 
+
-
The LLD changes and tcm_qla2xxx are now Beta status:
+
-
 
+
-
* ISP-2532 adapters have been tested in point to point (non NPIV) mode with &ge;24xx code at 8 Gb/sec.
+
-
* As requested for mainline code, support for PCI-E <= 23xx has been removed in lio-core with the following [http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=commit;h=db763cc35ca816d01cc25ee5f488f8b43bb74af5 commit]
+
-
 
+
-
== Setup ==
+
-
 
+
-
[[targetcli]] from {{RTS full}} is a comprehensive, powerful, yet easy storage management tool that can efficiently handle complex storage installations.
+
-
 
+
-
=== Getting the sources ===
+
-
 
+
-
==== Initial build: git setup ====
+
-
 
+
-
''git'' clone lio-core from <code>git://git.kernel.org/pub/scm/linux/kernel/git/nab/lio-core.git</code> as follows:
+
-
 
+
-
<pre>
+
-
git clone git://git.kernel.org/pub/scm/linux/kernel/git/nab/lio-core.git
+
-
cd lio-core
+
-
cp <your_working_config_file> .config
+
-
make menuconfig
+
-
</pre>
+
-
 
+
-
In menuconfig:
+
-
 
+
-
* Select device drivers
+
-
* Select the TCM module
+
-
* Select the modules [[FILEIO]], [[IBLOCK]], [[PSCSI]], Linux-iSCSI, then return to device drivers
+
-
* Select the SCSI device drivers, then SCSI low-level drivers.
+
-
* Select QLogic QLA2XXX Fibre Channel Support to build qla2xxx.ko, and TCM_QLA2XXX fabric modul to build tcm_qla2xxx.ko
+
-
* Save and return
+
-
 
+
-
Verify the following entries in the <code>.config</code> file (or make the corresponding changes):
+
-
 
+
-
<pre>
+
-
CONFIG_SCSI_QLA_FC=m
+
-
CONFIG_TCM_QLA2XXX=m
+
-
CONFIG_INET=y
+
-
CONFIG_SCSI_FC_ATTRS=m
+
-
CONFIGFS_FS=m
+
-
</pre>
+
-
 
+
-
If <code>CONFIGFS_FS=y</code> is set, a manual mount is required after the kernel boots:
+
-
 
+
-
<pre>
+
-
mount -t configfs configfs /sys/kernel/config
+
-
</pre>
+
-
 
+
-
==== Subsequent builds: git pull ====
+
-
 
+
-
Go to the directory where your lio-core kernel is located, and:
+
-
 
+
-
<pre>
+
-
cd <lio-core-2.6>
+
-
git pull origin tcm_qla2xxx
+
-
make clean
+
-
make oldconfig
+
-
</pre>
+
-
 
+
-
=== Building ===
+
-
 
+
-
Kernel and modules:
+
-
 
+
-
<pre>
+
-
make
+
-
make modules
+
-
make modules_install
+
-
make install
+
-
</pre>
+
-
 
+
-
=== Installing ===
+
-
 
+
-
==== New Linux kernel ====
+
-
 
+
-
Use lio-core-2.6 kernel:
+
-
 
+
-
* Change <code>/boot/grub/menu.lst</code> to select your lio-core-2.6 kernel.
+
-
* In <code>menu.lst</code>, make sure that <code>vmalloc=256m</code> is in the kernel line.
+
-
 
+
-
Normally, the latter is optional. But if <code>/proc/meminfo</code> shows vmalloc <128k, it fixes an issue with <code>fcport_lport_map</code> allocation seen by ''dmesg'' or in <code>/var/log/messages</code>. Note that <code>128m</code> may be ok but too low, and <code>512m</code> may be too high.
+
-
 
+
-
Then reboot:
+
-
 
+
-
<pre>
+
-
reboot
+
-
</pre>
+
-
 
+
-
and verify that the life kernel is indeed your new lio-core kernel:
+
-
 
+
-
<pre>
+
-
uname -a
+
-
</pre>
+
-
 
+
-
==== Loading LIO Target ====
+
-
 
+
-
Verify the presence of the following required modules with ''modprobe'': <code>tcm_qla2xxx</code>, <code>target_core_mod</code>, <code>qla2xxx</code>, <code>iscsi_target_mod</code>, <code>configfs</code>, e.g.:
+
-
 
+
-
<pre>
+
-
modprobe tcm_qla2xxx
+
-
</pre>
+
-
 
+
-
Normally all these modules should be loaded. If one is missing, you can load it as follows:
+
-
 
+
-
<pre>
+
-
insmod fs/configfs/configfs.ko
+
-
# Or do the mount command as shown above (if .config file has CONFIGFS_FS=y)
+
-
insmod /drivers/target/target_core_mod.ko
+
-
insmod /drivers/target/iscsi_target_mod.ko
+
-
modprobe tcm_qla2xxx
+
-
</pre>
+
-
 
+
-
==== Starting LIO Target ====
+
-
 
+
-
The target will be automatically started if [[targetcli]]-frozen is installed. Otherwise, start the target manually:
+
-
 
+
-
<pre>
+
-
/etc/init.d/target start
+
-
</pre>
+
-
 
+
-
To stop target:
+
-
 
+
-
<pre>
+
-
/etc/init.d/target stop
+
-
</pre>
+
-
 
+
-
To check the target status:
+
-
 
+
-
<pre>
+
-
/etc/init.d/target status
+
-
</pre>
+
-
 
+
-
=== Configuring ===
+
-
 
+
-
[[targetcli]] should be used to configure QLogic targets, please see [[QLogic/targetcli]]. The basic steps are as follows:
+
-
 
+
-
<pre>
+
-
# targetcli
+
-
  ...
+
-
/> create hba fileio
+
-
  ...
+
-
/> create storage <mylun_name> /tmp/<myfile_name> <size>
+
-
</pre>
+
-
 
+
-
Where, e.g.:
+
-
* ''size'' = 10G
+
-
* ''mylun_name'' could be <code>my_lun</code>
+
-
* ''myfile_name'' could be <code>my_file</code>
+
-
* This creates a storage object <code>my_lun</code> and a 10GB [[FILEIO]] backstore in <code>/tmp/my_file</code>.
+
-
 
+
-
Notes:
+
-
 
+
-
* By default, [[FILEIO]] uses <code>O_SYNC</code>. It allows both, exporting a shared filesystem for mounting, and creating files in the shared filesystem to be used as the backstore for raw block devices.
+
-
* Any number of virtual HBAs and assoicated devices is possible. The Target subsystem plugins ([[FILEIO]], [[IBLOCK]], [[pSCSI]], [[RAMDISK]], etc.) will report the underlying HW limitiations for things like TCQ depth, <code>MaxSectors</code>, <code>TaskAbortedStatus</code>, <code>UA Interlocking</code>, etc. All of these values are available as attributes in the [[targetcli]] device context:
+
-
 
+
-
<pre>
+
-
# targetcli
+
-
  ...
+
-
/> fileio0/my_file(/tmp/my_file)> ls attribute
+
-
  ...
+
-
</pre>
+
-
 
+
-
== Results ==
+
-
 
+
-
=== ConfigFS ===
+
-
 
+
-
See [[QLogic/configFS]] for the ConfigFS and kernel ringbuffer output of a working qla2xxx driver.
+
-
 
+
-
=== Modules ===
+
-
 
+
-
''lsmod'' output:
+
-
 
+
-
<pre>
+
-
Module                  Size  Used by
+
-
tcm_qla2xxx            16822  8
+
-
qla2xxx              327379  1 tcm_qla2xxx
+
-
iscsi_target_mod      201391  1
+
-
target_core_pscsi      11045  0
+
-
target_core_file        6307  1
+
-
target_core_iblock      6606  0
+
-
target_core_mod      207359  26 tcm_qla2xxx,iscsi_target_mod,target_core_pscsi,target_core_file,target_core_iblock
+
-
configfs              19153  2 target_core_mod
+
-
ipv6                  242427  20
+
-
</pre>
+
-
 
+
-
=== Interrupt stats ===
+
-
 
+
-
MSI-X interrupt stats for target side operation:
+
-
 
+
-
<pre>
+
-
lenny64guest0:/usr/src/lio-core-2.6.git# cat /proc/interrupts | head -n 1 ; cat /proc/interrupts | grep qla2xxx
+
-
            CPU0      CPU1      CPU2      CPU3     
+
-
  43:      11697      11610      11951      11906  PCI-MSI-edge      qla2xxx (default)
+
-
  44:      14836      14922      14582      14628  PCI-MSI-edge      qla2xxx (rsp_q)
+
-
</pre>
+
-
 
+
-
== Initiator ==
+
-
 
+
-
=== Kernel ring buffer ===
+
-
 
+
-
Initiator side ring buffer output during initiator login:
+
-
 
+
-
<pre>
+
-
scsi34 : qla2xxx
+
-
qla2xxx 0000:02:00.0: LIP reset occurred (f8f7).
+
-
qla2xxx 0000:02:00.0: LIP occurred (f8f7).
+
-
qla2xxx 0000:02:00.0: LOOP UP detected (8 Gbps).
+
-
scsi 34:0:0:0: Direct-Access    LIO-ORG  RAMDISK-MCP      4.0  PQ: 0 ANSI: 5
+
-
sd 34:0:0:0: Attached scsi generic sg2 type 0
+
-
sd 34:0:0:0: [sdb] 819200 512-byte logical blocks: (419 MB/400 MiB)
+
-
sd 34:0:0:0: [sdb] Write Protect is off
+
-
sd 34:0:0:0: [sdb] Mode Sense: 2f 00 00 00
+
-
sd 34:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
+
-
sdb: unknown partition table
+
-
sd 34:0:0:0: [sdb] Attached SCSI disk
+
-
</pre>
+
-
 
+
-
=== Device identifiers ===
+
-
 
+
-
''sg_inq -i'' initiator side output for EVPD=0x83 device identifiers:
+
-
 
+
-
<pre>
+
-
truelife:/usr/src/qemu-kvm.git# sg_inq -i /dev/sdb
+
-
VPD INQUIRY: Device Identification page
+
-
  Designation descriptor number 1, descriptor length: 20
+
-
    id_type: NAA,  code_set: Binary
+
-
    associated with the addressed logical unit
+
-
      NAA 6, IEEE Company_id: 0x1405
+
-
      Vendor Specific Identifier: 0x7bb168f6d
+
-
      Vendor Specific Identifier Extension: 0x32edd42b3d9e26df
+
-
      [0x60014057bb168f6d32edd42b3d9e26df]
+
-
  Designation descriptor number 2, descriptor length: 61
+
-
    id_type: T10 vendor identification,  code_set: ASCII
+
-
    associated with the addressed logical unit
+
-
      vendor id: LIO-ORG
+
-
      vendor specific: RAMDISK-MCP:7bb168f6-32ed-42b3-9e26-fe6aab35460a
+
-
  Designation descriptor number 3, descriptor length: 8
+
-
    transport: Fibre Channel (FCP-2)
+
-
    id_type: Relative target port,  code_set: Binary
+
-
    associated with the target port
+
-
      Relative target port: 0x1
+
-
  Designation descriptor number 4, descriptor length: 8
+
-
    transport: Fibre Channel (FCP-2)
+
-
    id_type: Target port group,  code_set: Binary
+
-
    associated with the target port
+
-
      Target port group: 0x0
+
-
  Designation descriptor number 5, descriptor length: 8
+
-
    id_type: Logical unit group,  code_set: Binary
+
-
      associated with the addressed logical unit
+
-
      Logical unit group: 0x0
+
-
  Designation descriptor number 6, descriptor length: 40
+
-
    transport: Fibre Channel (FCP-2)
+
-
    id_type: SCSI name string,  code_set: UTF-8
+
-
    associated with the target port
+
-
      SCSI name string:
+
-
      21:00:00:24:ff:31:4c:48,t,0x0001
+
-
</pre>
+
-
 
+
-
== Action Items ==
+
-
 
+
-
* Add configfs attribute in <code>/sys/kernel/config/target/core/qla2xxx/</code> to show available <code>struct scsi_qla_host</code> available for target mode registration using ''mkdir -p /sys/kernel/config/target/qla2xxx/$QLA_FC_WWPN''
+
-
* Enable proper target side SRR support in <code>qla_target.c</code>
+
-
* More testing of cable pull and shutdown with active I/O.
+
-
* Proper support for NPIV using the seperate <code>/sys/kernel/config/target/qla2xxx_npiv</code> fabric module logic.
+
-
* Proper testing with pre 24xx series adapters support
+
-
 
+
-
== Acknowledgements ==
+
-
 
+
-
Kudos to the [http://www.qlogic.com QLogic] team, in particular Madhu Iyengar, for their excellent support and guidance with the qla2xxx driver.
+
-
 
+
-
== See also ==
+
-
* [[targetcli]]: [[QLogic/targetcli]]
+
-
* [[ConfigFS]]: [[QLogic/configFS]] (low level kernel API)
+
-
* Other fabric modules: [[iSCSI]], [[Fibre Channel]], [[Fibre Channel over Ethernet|FCoE]], [[InfiniBand]], [[IBM vSCSI]], [[tcm_loop]]
+
-
* [[Target]]
+
-
 
+
-
== External links ==
+
-
* [http://en.wikipedia.org/wiki/QLogic QLogic] Wikipedia entry
+
-
* [http://en.wikipedia.org/wiki/Fibre_Channel Fibre Channel] Wikipedia entry
+
-
* [http://www.qlogic.com/Pages/default.aspx QLogic] official website
+
[[Category:Fabric modules]]
[[Category:Fabric modules]]
[[Category:Fibre Channel]]
[[Category:Fibre Channel]]
[[Category:Network protocols]]
[[Category:Network protocols]]

Latest revision as of 01:20, 5 July 2012

  1. REDIRECT Fibre Channel
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense