From owner-freebsd-stable@FreeBSD.ORG Thu Jun 24 18:13:39 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDE311065673; Thu, 24 Jun 2010 18:13:39 +0000 (UTC) (envelope-from aoyama@peach.ne.jp) Received: from moon.peach.ne.jp (unknown [IPv6:2001:380:e06:127::53]) by mx1.freebsd.org (Postfix) with ESMTP id 8672A8FC19; Thu, 24 Jun 2010 18:13:39 +0000 (UTC) Received: from moon.peach.ne.jp (localhost [127.0.0.1]) by moon.peach.ne.jp (Postfix) with ESMTP id A502578C6A; Fri, 25 Jun 2010 03:13:38 +0900 (JST) Received: from artemis (unknown [192.168.2.20]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by moon.peach.ne.jp (Postfix) with ESMTP id 939A778C67; Fri, 25 Jun 2010 03:13:38 +0900 (JST) Message-ID: From: "Daisuke Aoyama" To: , , Date: Fri, 25 Jun 2010 03:12:38 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-2022-jp"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 X-Virus-Scanned: ClamAV using ClamSMTP Cc: Subject: iSCSI boot driver version 0.1.1 for iBFT X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 18:13:39 -0000 Hello, I made small device driver for the first time. It is published on my blog. Because it is written in Japanese, I try to write here. This module provides initial connection of the iSCSI target with setting via iBFT (iSCSI Boot Firmware Table). Currently, it is intended to use Intel NIC and istgt (iSCSI target). Any other cards, targets may not work. Also, I'm developing under FreeBSD 7.3. (build check under 8.1) Please refer to Microsoft website about iBFT: http://www.microsoft.com/whdc/system/platform/firmware/ibft.mspx I did't use iscsi_initiator.ko within kernel module. So, I'm creating a small version of initiator based on iscsi-2.2.4 and istgt-20100606. Now it have only one cmd holding space in the iSCSI session and use polling. It should be added the queuing/asynchronous operation :) After loading it via /boot/loader.conf, you can install to/boot from the iSCSI target as same as a local SCSI harddisk. Complex settings such as TFTP, NFS, DHCP and PXE are no longer needed. Just use /dev/da0 and so on. How to compile: isboot is a stand alone iSCSI initiator, but source code is depend on the header file of iscsi-2.2.4. You need to extract iscsi-2.2.4 before compiling isboot. # cd /usr/src # tar xvf /path/to/iscsi-2.2.4.tar.gz # tar xvf /path/to/isboot-0.1.1.tar.gz # make buildkernel # make installkernel or # cd /usr/src/sys/modules/iscsi/isboot # make obj # make depend # make all # make install After above install, you have /boot/kernel/isboot.ko. Using as module: Add isboot_load="YES" to /boot/loader.conf. Setup iSCSI target. (recommend istgt-20100407 or later) Configure NIC BIOS to connect the target. Try to boot the server. If the NIC find the target, iBFT can be found by isboot. Then, isboot create own bus for CAM device with iBFT parameters. All LUNs in the target are appeared in the bus. Once FreeBSD + isboot is booted, you can handle it by camcontrol and other normal way as same as SCSI HDD. If you want full install and boot demo, please download FreeNAS 0.7.2 5226 p4 from my blog and try it without local harddisk. FYI: FreeNAS 0.7.1 5127 (stable) includes istgt-20100407. FYI: FreeNAS 0.7.2 5226 p3 includes istgt-20100606. FYI: FreeNAS 0.7.2 5226 p4 includes istgt-20100606 + isboot-0.1.1. sysctl MIBs (read only): net.isboot.version net.isboot.nic net.isboot.device hw.ibft.nic_gateway hw.ibft.nic_prefix hw.ibft.target_lun hw.ibft.target_port hw.ibft.target_address hw.ibft.target_name hw.ibft.initiator_address hw.ibft.initiator_name Performance (read from the target): All using Intel PRO/1000 PT Server Adapter. istgt 20100606 + isboot 0.1 with header/data digest(CRC32C): # dd if=/dev/da6 of=/dev/null bs=1m count=1k 1024+0 records in 1024+0 records out 1073741824 bytes transferred in 20.452429 secs (52499477 bytes/sec) istgt 20100606 + isboot 0.1 with header digest: # dd if=/dev/da6 of=/dev/null bs=1m count=1k 1024+0 records in 1024+0 records out 1073741824 bytes transferred in 17.684945 secs (60715022 bytes/sec) istgt 20100606 + isboot 0.1 without digest: # dd if=/dev/da6 of=/dev/null bs=1m count=1k 1024+0 records in 1024+0 records out 1073741824 bytes transferred in 17.508400 secs (61327239 bytes/sec) Notes/Known Issues/Limitations: bootup/reconnect time might be a little long. ifconfig(8),route(8),etc should not change booted NIC and critical path. Unload the module will cause to panic. IPv6 is not tested. DNS is not configured. Queuing is not supported at this time. CHAP is not supported at this time. Can't configure iSCSI parameter without modifing soure code. Can't reject running XPT command when the socket is lost. Can't exchange the session to iscsi_initiator.ko. The source code depend on iscsi initiator's structure. (first I tried to use it, but finally gave up) The controller such as iscontrol(8) is not provided. Documentation is not written. I'm new to the kernel land. If you have any suggestion, please tell me. Download here (the page is Japanese only): isboot-0.1.1 http://shell.peach.ne.jp/aoyama/archives/1179 FreeNAS 0.7.2 5226 p4 http://shell.peach.ne.jp/aoyama/archives/1181 FYI: danny's iscsi initiator: ftp://ftp.cs.huji.ac.il/users/danny/freebsd/iscsi-2.2.4.tar.gz Regards, Daisuke Aoyama