tcm_loop
The Linux SCSI Target Wiki
![]() | |
---|---|
![]() tcm_loop SCSI Emulation Device | |
Original author(s) | Nicholas Bellinger |
Developer(s) | Datera, Inc. |
Initial release | May 18, 2011 |
Stable release | 4.1.0 / June 20, 2012 |
Preview release | 4.2.0-rc5 / June 28, 2012 |
Development status | Production |
Written in | C |
Operating system | Linux |
Type | Fabric module |
License | GNU General Public License |
Website | datera.io |
- See Target for a complete overview over all fabric modules.

tcm_loop is a pluggable virtual fabric module (tcm_loop.ko) for the LIO multiprotocol Target engine.
It provides full local SCSI device emulation (SPC-3 and SPC-4) for raw block storage objects. It thus makes any raw block device apear to the Target as a full SPC-3/SPC-4 SCSI compliant device with the corresponding CDB-level SAS emulation, for access from any SCSI LLD driver.
tcm_loop minimizes overhead - it delivers >12 GB/s (native) and >2 GB/s (from a single KVM guest, without hardware assist) on Intel Nehalem platforms. This provides e.g., unmodified guest operating systems, such as VMware ESX or VMware vSphere, to use the full SPC-3/SPC-4 SCSI functionality on any type of local raw block storage object they require.
tcm_loop was initially released on 10/19/2009,[1] and it went upstream into the Linux 2.6.39 kernel on 3/18/2011.[2]
Contents |
Specification compliance
The type of SCSI fabric features that are available with tcm_loop (Target mode emulated SAS ports) includes the complete set of SPC-3 logic in the Target engine including advanced features such as PRs, ALUA, etc.
Target 4 tcm_loop also supports high level fabric emulation. That is, depending on which WWN is used to create the configFS group in /sys/kernel/config/target/loopback/$WWN, it configures itself to return iSCSI, SAS or FC device identifiers for the SCSI LUN protocol identifiers in the EVPD 0x83 device identifier page.
The entire corresponding logic resides in target_core_fabric_lib.c, and is shared by the different target fabric modules. The code simply contains magic numbers defined for different protocols in SPC-4, and is commented using pieces directly from SPC-4.
Setup
targetcli from Datera, Inc. is a comprehensive, powerful, yet easy storage management tool that can efficiently handle complex storage installations. The tcm_loop fabric module can be configured as described in tcm_loop/targetcli.
Results
See tcm_loop/configFS for the configFS and kernel ringbuffer output of a working tcm_loop driver.
Other healthy results should look similar to the following examples, which are provided as a reference.
SCSI devices
The list of resulting SCSI devices with lsscsi -v output is:
[9:0:1:0] disk LIO-ORG IBLOCK 3.1 /dev/sdg dir: /sys/bus/scsi/devices/9:0:1:0 [/sys/devices/tcm_loop_0/tcm_loop_adapter_0/host9/target9:0:1/9:0:1:0] [10:0:1:0] disk LIO-ORG IBLOCK 3.1 /dev/sdh dir: /sys/bus/scsi/devices/10:0:1:0 [/sys/devices/tcm_loop_0/tcm_loop_adapter_1/host10/target10:0:1/10:0:1:0]
Block devices
The list of resulting block devices with sg_inq -i /dev/sdg is:
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: 0xa97e4ce21 Vendor Specific Identifier Extension: 0xc0711de829b000c2 [0x6001405a97e4ce21c0711de829b000c2] Designation descriptor number 2, descriptor length: 52 id_type: T10 vendor identification, code_set: ASCII associated with the addressed logical unit vendor id: LIO-ORG vendor specific: IBLOCK:a97e4ce21c0711de829b000c2943d57b Designation descriptor number 3, descriptor length: 8 transport: Serial Attached SCSI (SAS) id_type: Relative target port, code_set: Binary associated with the target port Relative target port: 0x8 Designation descriptor number 4, descriptor length: 8 transport: Serial Attached SCSI (SAS) 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: 36 transport: Serial Attached SCSI (SAS) id_type: SCSI name string, code_set: UTF-8 associated with the target port SCSI name string: naa.600140554cf3a18e,t,0x0001
Modules
The resulting loadable kernel modules (LKMs) with lsmod output are:
Module Size Used by tcm_loop 11606 9 iscsi_target_mod 205640 44 target_core_mod 226770 75 tcm_loop,iscsi_target_mod scsi_tgt 8806 1 target_core_mod configfs 21168 4 tcm_loop,iscsi_target_mod,target_core_mod dm_mirror 10356 0 dm_region_hash 7562 1 dm_mirror dm_log 6769 2 dm_mirror,dm_region_hash dm_snapshot 18562 0 pcnet32 25510 0 mii 3430 1 pcnet32
Timeline
Timeline of the LinuxIO | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Release | Details | 2011 | 2012 | 2013 | 2014 | 2015 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ||
4.x | Version | 4.0 | 4.1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Feature | LIO Core | Loop back | FCoE | iSCSI | Perf | SRP | CM WQ | FC USB 1394 | vHost | Perf | Misc | 16 GFC | iSER | Misc | VAAI | Misc | DIF Core NPIV | DIF iSER | DIF FC vhost | TCMU Xen | Misc | Misc | virtio 1.0 | Misc | NVMe OF | ||||||||||||||||||||||||||||||||||||
Linux | 2.6.38 | 2.6.39 | 3.0 | 3.1 | 3.2 | 3.3 | 3.4 | 3.5 | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | 3.12 | 3.13 | 3.14 | 3.15 | 3.16 | 3.17 | 3.18 | 3.19 | 3.20 | 3.21 | 3.22 |
See also
- targetcli
- ConfigFS: tcm_loop/configFS (low level kernel API)
- Other fabric modules: iSCSI, Fibre Channel, FCoE, InfiniBand, IBM vSCSI
- Target
Notes
- ↑ Nicholas Bellinger (10/19/2009). "[TCM_LOOP]: Add a virtual SCSI loopback fabric module". lkml.org.
- ↑ Nicholas Bellinger (3/18/2011). "[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module". lkml.org.
External links
- RisingTide Systems Official website
- RTSadmin Reference Guide
- RTSlib Referemce Guide