Fibre Channel over Ethernet

The Linux SCSI Target Wiki

Revision as of 00:35, 20 March 2010 by Admin (Talk | contribs)
Jump to: navigation, search

As of March 19th, the TCM based Open-FCoE.org target fabric module in lio-core-2.6.git/tcm_fc has been committed into lio-core-2.6.git/master as LIO v3.4.0-rc1..!

100% of logic for v3.x Target_Core_Mod/ConfigFS Persistent_Reservations and ALUA is now running in multi-fabric mode between and across LIO-Target TCM_Loop and OpenFCoE SCSI Ports..!

This would not have been possible without the tremendous contributions of tcm_fc by Joe Eykholt and his ongoing work of making libfc target capable. Thanks Joe!

The tcm_fc fabric module is based on the open-fcoe.org target code and has been modified to run using a modified upstream Linux libfc module.

This includes a patch series to reenable Point to Point module for libfc (which have been merged upstream), and a set of hooks into libfc to be able to hand off incoming FLOGI requests to FC based target modules.

The tcm_fc fabric module is using the configfs interface in /sys/kernel/config/target/fc. Note that there is NO strict open-fcoe userspace code requirement in order to get up and running.

http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=tree;f=drivers/target/tcm_fc;hb=HEAD

 # Create the '20:00:' prefixed FCoE Lport from network inteface eth0
 mkdir -p /sys/kernel/config/target/fc/20:00:00:e0:81:c0:90:b3/tpgt_1/lun/lun_0
 # Chdir and create tcm_fc_port from TCM FILEIO object
 cd /sys/kernel/config/target/fc/20\:00\:00\:e0\:81\:c0\:90\:b3/tpgt_1/lun/lun_0/
 ln -s /sys/kernel/config/target/core/fileio_0/myfile/ tcm_fc_port
 # Chdir and created '20:00' prefixed Initiator WWPN from it's own network interface
 cd ../../ ; mkdir -p acl/20:00:00:e0:81:c0:90:b2/lun_0 ; cd acl/20\:00\:00\:e0\:81\:c0\:90\:b2/lun_0
 # Create explict MappedLUN=0 for NodeACl to TPG LUN 0
 ln -s /sys/kernel/config/target/fc/20\:00\:00\:e0\:81\:c0\:90\:b3/tpgt_1/lun/lun_0/ lun_0

Here is what a running configuration looks like from /sys/kernel/config/target/fc/

target# tree /sys/kernel/config/target/fc/
 /sys/kernel/config/target/fc/
 |-- 20:00:00:e0:81:c0:90:b3
 |   `-- tpgt_1
 |       |-- acl
 |       |   `-- 20:00:00:e0:81:c0:90:b2
 |       |       |-- auth
 |       |       |   |-- node_name
 |       |       |   `-- port_name
 |       |       `-- lun_0
 |       |           `-- lun_0 -> ../../../../../../../target/fc/20:00:00:e0:81:c0:90:b3/tpgt_1/lun/lun_0
 |       `-- lun
 |           `-- lun_0
 |               |-- alua_tg_pt_gp
 |               |-- alua_tg_pt_offline
 |               |-- alua_tg_pt_status
 |               |-- alua_tg_pt_write_md
 |               `-- tcm_fc_port -> ../../../../../../target/core/fileio_0/myfile
 `-- version
 10 directories, 7 files
 [  176.370130] <<<<<<<<<<<<<<<<<<<<<< BEGIN FABRIC API >>>>>>>>>>>>>>>>>>>>>>
 [  176.371205] Initialized struct target_fabric_configfs: ffff88003787b800 for fc
 [  176.372739] <<<<<<<<<<<<<<<<<<<<<< END FABRIC API >>>>>>>>>>>>>>>>>>>>>>
 [  180.529964] Target_Core_ConfigFS: REGISTER -> group: ffffffffa02b9480 name: fc
 [  180.531086] Target_Core_ConfigFS: REGISTER -> Located fabric: fc
 [  180.531803] Target_Core_ConfigFS: REGISTER -> ffffffffa0366f70
 [  180.532506] Target_Core_ConfigFS: REGISTER -> Allocated Fabric: fc
 [  180.532921] Target_Core_ConfigFS: REGISTER -> Set tf->tf_fabric for fc
 [  180.532921] TARGET_CORE[fc]: Allocated Normal se_portal_group_t for endpoint: 20:00:00:e0:81:c0:90:b3, Portal Tag: 1
 [  188.053789] fileio/fc: Adding to default ALUA Target Port Group: alua/default_tg_pt_gp
 [  188.054913] fc_TPG[1]_LUN[0] - Activated fc Logical Unit from CORE HBA: 1
 [  211.862437] fc_TPG[1] - Added ACL with TCQ Depth: 32 for fc Initiator Node: 20:00:00:e0:81:c0:90:b2
 [  219.960620] fc_TPG[1]_LUN[0->0] - Added RW ACL for  InitiatorNode: 20:00:00:e0:81:c0:90:b2


Next, load the fcoe module and create an association to the matching LPORT interface configured with tcm_fc:

 modprobe fcoe ; echo eth0 > /sys/module/fcoe/parameters/create
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense