[root@proj ]# dmesg -c >/dev/null [root@proj ]# rmmod qla2xxx [root@proj ]# modprobe qla2xxx [root@proj ]# dmesg | grep -E 'qla2xxx .* QLogic | Found an ISP' qla2xxx [0000:01:00.0]-001d: Found an ISP2532 irq 16 iobase 0xffffc9000413e000. qla2xxx [0000:01:00.0]-00fb:164: QLogic QLE2562 - PCI-Express Dual Channel 8Gb Fibre Channel HBA. qla2xxx [0000:01:00.1]-001d: Found an ISP2532 irq 17 iobase 0xffffc9000417c000. qla2xxx [0000:01:00.1]-00fb:165: QLogic QLE2562 - PCI-Express Dual Channel 8Gb Fibre Channel HBA.The above information not only contains the HBA model number (QLE2562) but also the RISC controller ID (ISP2532).
qla2xxx 0000:13:00.0: Firmware image unavailable. qla2xxx 0000:13:00.0: Failed to initialize adapter
ISP Model | Firmware file name |
---|---|
ISP 21XX | ql2100_fw.bin |
ISP 22XX | ql2200_fw.bin |
ISP 2300 | ql2300_fw.bin |
ISP 2322 | ql2322_fw.bin |
ISP 24XX | ql2400_fw.bin |
ISP 25XX | ql2500_fw.bin |
ISP 2031 | ql2600_fw.bin |
ISP 27XX | ql2700_fw.bin |
[root@proj ]# /opt/QLogic_Corporation/QConvergeConsoleCLI/qaucli -fc -b all /lib/firmware/ql2500_fw.bin
[root@proj ]# apt-get install gcc libncurses5-dev linux-headers-`uname -r` lsscsi patch subversionOn RHEL/CentOS/SL systems these packages can be installed as follows:
[root@proj ]# yum install gcc ncurses-devel kernel-devel lsscsi patch subversionAnd on SUSE systems these packages can be installed by running the following command:
[root@proj ]# zypper install gcc ncurses-devel kernel-devel lsscsi patch subversion
[root@proj ]# git clone git://git.qlogic.com/scst-qla2xxx.git
[root@proj ]# svn co https://svn.code.sf.net/p/scst/svn/trunk scstAfter the above command finished a directory called 'scst' will have been created in the current directory, which is /root in this how-to.
[root@proj ]# cd scst [root@proj scst]# ln -s ../scst-qla2xxx/drivers/scsi/qla2xxx qla2x00t_git
[root@proj ]# cd /usr/src [root@proj src ]# tar -xjf /usr/src/linux-3.11.8.tar.bz2Instructions for obtaining a distribution-specific kernel source tree vary. An example for Debian:
[root@proj src ]# apt-get install linux-source-`uname -r` [root@proj src ]# tar xjf linux-source-`uname -r`.tar.bz2
[root@proj src ]# ln -s linux-3.11 linux [root@proj src ]# cd linux [root@proj linux ]# patch -p1 < /root/scst/scst/kernel/scst_exec_req_fifo-3.11.patch
[root@proj linux ]# pwd /usr/src/linux [root@proj linux ]# make menuconfigIf you have built a 32-bit kernel make sure to disable HIGHMEM4G and HIGHMEM64G, i.e.
[root@proj linux ]# grep -i highmem .config CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set # CONFIG_HIGHMEM64G is not setIf you have built a 32-bit kernel on a system with more than 1GB of memory, consider to change CONFIG_VMSPLIT option to an appropriate value.
[root@proj linux ]# make -j$(ls -1d /sys/devices/system/cpu/cpu[0-9]* | wc -l) bzImage modules [root@proj linux ]# make modules_install install
[root@proj ]# echo blacklist qla2xxx >/etc/modprobe.d/blacklist-qla2xxx.conf [root@proj ]# rmmod qla2xxx
[root@proj scst ]# pwd /root/scst [root@proj scst ]# make 2release
[root@proj ]# cd /root/scst [root@proj scst ]# BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y make all installVerify that compilation and installation succeeded:
[root@proj scst]# ls -l /lib/modules/`uname -r`/extra/qla2* -rw-r--r-- 1 root root 36756 Jun 20 18:46 qla2x00tgt.ko -rw-r--r-- 1 root root 160192 Jun 20 18:46 qla2xxx_scst.ko
[root@proj scst]# ls -l /lib/modules/`uname -r`/extra total 232 drwxr-xr-x 2 root root 4096 Jun 20 18:43 dev_handlers -rw-r--r-- 1 root root 36756 Jun 20 18:46 qla2x00tgt.ko -rw-r--r-- 1 root root 160192 Jun 20 18:46 qla2xxx_scst.ko -rw-r--r-- 1 root root 190848 Jun 20 18:43 scst.ko [root@proj scst]# ls -l /lib/modules/`uname -r`/extra/dev_handlers total 192 -rw-r--r-- 1 root root 11757 Jun 20 18:43 scst_cdrom.ko -rw-r--r-- 1 root root 10111 Jun 20 18:43 scst_changer.ko -rw-r--r-- 1 root root 12420 Jun 20 18:43 scst_disk.ko -rw-r--r-- 1 root root 12449 Jun 20 18:43 scst_modisk.ko -rw-r--r-- 1 root root 10131 Jun 20 18:43 scst_processor.ko -rw-r--r-- 1 root root 10081 Jun 20 18:43 scst_raid.ko -rw-r--r-- 1 root root 12563 Jun 20 18:43 scst_tape.ko -rw-r--r-- 1 root root 37937 Jun 20 18:43 scst_user.ko -rw-r--r-- 1 root root 50194 Jun 20 18:43 scst_vdisk.kowhere:
[root@proj ]# for m in scst qla2xxx_scst qla2x00tgt scst_vdisk scst_user scst_disk ...; do modprobe $m; doneThis will result in the following dmesg output:
scst: SCST version 2.0.0 loaded successfully (max mem for commands 16251MB, per device 6500MB) scst: Enabled features: TRACING scst: Target template qla2x00tgt registered successfully scst: Virtual device handler vdisk for type 0 registered successfully scst: Virtual device handler "scst_user" registered successfully
[root@proj ]# type update-initrd >/dev/null 2>&1 && update-initrd -c -k `uname -r` [root@proj ]# type update-initramfs >/dev/null 2>&1 && update-initramfs -c -k `uname -r` [root@proj ]# if type mkinitrd >/dev/null 2>&1; then if { rpm -q sles-release || rpm -q openSUSE-release; } >/dev/null 2>&1; then mkinitrd; else mkinitrd -f /boot/initramfs-`uname -r`.img `uname -r`; fi; fi
[root@proj ]# dd if=/dev/zero of=/mnt/disk1 bs=1024k count=512 512+0 records in 512+0 records out [root@proj ]# ls -l /mnt/disk1 -rw-r--r-- 1 root root 536870912 Jun 23 13:27 /mnt/disk1 [root@proj ]# file /mnt/disk1 /mnt/disk1: data
[root@proj ]# make -C scstadmin -s install
modprobe qla2x00tgt find /sys/kernel/scst_tgt/targets/qla2x00t -name enabled | \ while read f; do echo 1 >$f & done; wait find /sys -name issue_lip | while read f; do echo 1 >$f & done; wait { cat <<EOF HANDLER vdisk_fileio { DEVICE disk1 { filename /mnt/disk1 } } EOF for p in /sys/kernel/scst_tgt/targets/qla2x00t/*; do [ -d $p ] || continue cat <<EOF TARGET_DRIVER qla2x00t { TARGET $(basename $p) { enabled 1 LUN 0 disk1 } } EOF done } >scst.confCheck the generated config file. If it looks fine to you, move it to the default location:
mv -i scst.conf /etc/scst.confThe SCST configuration in that file can be applied via scstadmin:
[root@proj ]# scstadmin -config /etc/scst.conf Collecting current configuration: done. -> Checking configuration file 'qq' for errors. -> Done, 0 warnings found. -> Opening device 'disk1' using handler 'vdisk_fileio': done. -> Adding device 'disk1' at LUN 0 to driver/target 'qla2x00t/25:00:00:f0:98:87:92:f3': done. -> Enabling driver/target 'qla2x00t/25:00:00:f0:98:87:92:f3': done. All done.The same can be done directly via the sysfs interface of SCST:
[root@proj ]# echo "add_device disk1 filename=/mnt/disk1" >/sys/kernel/scst_tgt/handlers/vdisk_fileio/mgmt [root@proj ]# echo "add disk1 0" >/sys/kernel/scst_tgt/targets/qla2x00t/25:00:00:f0:98:87:92:f3/luns/mgmt [root@proj ]# echo "1" >/sys/kernel/scst_tgt/targets/qla2x00t/25:00:00:f0:98:87:92:f3/enabled
[root@proj ]# ls -d /sys/kernel/scst_tgt/targets/qla2x00t/*/sessions/*|sed 's,.*/,,' | sort -u 10:00:00:00:c9:95:c7:1a 10:00:00:00:c9:95:c7:1b 21:00:00:24:ff:46:c0:84 21:00:00:24:ff:46:c0:85 21:00:00:24:ff:6c:ca:d8 21:00:00:24:ff:6c:ca:d9 21:00:00:24:ff:6c:ca:da 21:00:00:24:ff:6c:ca:dbMore information about initiator group configuration together with an example can be found in the scst.conf man page.
Without loading appropriate device handler, corresponding device will be invisible for remote initiators, hence we have to add them manually.But as I've already loaded the device handler (scst_vdisk) on the target, I don't have to perform any additional steps.
[root@initiator ]# echo "- - -" >/sys/class/scsi_host/hostX/scanwhere X is the host number.