FCoE SW Target Quickstart
From Open-FCoE Wiki
Contents |
[edit] Caveat
This document may not be up to date for SW target setup. If you have suggestions on how to improve this document please mail the mailing list.
Our intent is to get the initiator in-kernel and then determine a correct way to implement a SW FCoE target. We realize that this can be frustrating for users without access to HW, but we simply don't have the resources to accomplish both the initiator and target simultaneously. We would be glad to advise any developer(s) wishing to work on a target implementation and the mailing list would be the appropriate place for those discussions.
The possibilities at the time of writing this seems to be adding hooks to the initiator and maintaining kernel target code on this site or improving the STGT project that currently has a FCoE target, in userspace, based on our original "pre-arch" code.
[edit] Introduction
Here is a quick set of instructions to setup FCoE SW target.
These instructions have not been tested and may contain errors. I must admit that while writing them I ran into a few problems that I had to workout on my own. Over time installation, configuration and usage of the initiator and target will improve.
[edit] Configuration
- Fedora 7 systems
- Intel NICs - e1000 driver
- MTU = 2500
- static any IP addresses
[edit] Initial Setup
- Clone the open-fcoe-target and open-fcoe repositories
- git clone git://open-fcoe.org/archive/open-fcoe-target.git
- git clone git://open-fcoe.org/archive/open-fcoe-target-user.git
- Get and install the v2.6.23 tagged kernel
- git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
- cd linux-2.6 && git-checkout v2.6.23
- Get SCST and patch your kernel
- svn co https://scst.svn.sourceforge.net/svnroot/scst
- patch -p1 < <path-to-scst>/trunk/scst/kernel/scst_exec_req_fifo-2.6.23.patch
- Get the HBAAPI
- hbaapi_src_2.2.tgz from http://sourceforge.net/projects/hbaapi/ and untar it
- Build your kernel
- cd <path-to-2.6.23 kernel>
- I always copy in my last known good .config file and "make menuconfig", exit saving changes. There is no particular configuration that needs to be set outside of default settings.
- I did - make -j 12 && make modules && make modules_install && make install
- Modify your bootloader to boot your new kernel
- reboot
[edit] Further setup
The INSTALL document in open-fcoe-target is incorrect, you don't need the open-fcoe-upstream tree nor do you need to run the psrc.sh script.
- Build SCST
- cd <path-to-scst>/trunk/scst/src
- make && make install
- Build openfctgt
- cd <path-to-open-fcoe-target>
- make SCST=<path-to-scst>/trunk/scst install_tgt
- Build the HBA API
- Follow the instructions in the <open-fcoe>/INSTALL doc 1b->1g
- Build fcconf
- cd <path-to-open-fcoe>/usr
- make HBAAPI=<absolute-path-to-hbaapi-src> && make install
[edit] Final configuration and usage
I had some problems here. For some reason I kept getting a openfc.ko module in /lib/modules/2.6.23/extras/. It kept getting loaded and openfctgt.ko couldn't load because of duplicate symbols. Eventually I just insmod'd the openfctgt.ko and fcoe.ko modules by hand.
- Install scstadmin
- cd <path-to-scst>/trunk/scstadmin
- cp scstadmin /usr/local/sbin/
- > /etc/scst.conf
- cp init.d/scst /etc/init.d/scst
- In the SCST_MODULES definition change qla2x00tgt to fcoe
- Install lsscsi
- yum -y install lsscsi (there's probably a different tool that gets the same results)
- Add a disk to SCST - my target has a second HDD
- lsscsi - my second disk is reported as "[2:0:0:0] disk ATA ST380817AS 3.42 /dev/sdb"
- echo "assign 2:0:0:0 dev_disk" > /proc/scsi_tgt/scsi_tgt
- echo "add 2:0:0:0 0" > /proc/scsi_tgt/groups/Default/devices
- Start the target
- At this point I like to run wireshark
- fcconf <ethX> enable - where <ethX> is your device connected to the initiator.
Note that the target doesn't know it's a target and attempts FLOGIs. If you're not seeing FLOGIs from the target you have a problem.
[edit] Using FCoE SW target with FCoE initiator
Please read the FCoE Initiator_Quickstart to setup FCoE initiator, the FCoE SW target can be used back to back using crosswire ethernet connection between FCoE initiator and SW target ethernet interfaces.