From owner-freebsd-scsi@FreeBSD.ORG Fri Jun 25 13:49:53 2010 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5172106566C for ; Fri, 25 Jun 2010 13:49:53 +0000 (UTC) (envelope-from leo@nec-labs.com) Received: from mail.nec-labs.com (mail.nec-labs.com [138.15.200.209]) by mx1.freebsd.org (Postfix) with ESMTP id 3DA448FC1C for ; Fri, 25 Jun 2010 13:49:52 +0000 (UTC) Received: from mail.nec-labs.com (localhost.localdomain [127.0.0.1]) by mail.nec-labs.com (8.14.3/8.14.3) with ESMTP id o5PDnnW6019806 for ; Fri, 25 Jun 2010 09:49:49 -0400 Received: from [138.15.166.202] (gsd2.nec-labs.com [138.15.166.202]) by mail.nec-labs.com (8.14.3/8.14.3) with ESMTP id o5PDnnF7019802 for ; Fri, 25 Jun 2010 09:49:49 -0400 Message-ID: <4C24B3FF.2040208@nec-labs.com> Date: Fri, 25 Jun 2010 09:49:51 -0400 From: Leo Prasath Arulraj User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Thunderbird/3.0.4 MIME-Version: 1.0 To: freebsd-scsi@freebsd.org References: <4C23655F.1070408@nec-labs.com> In-Reply-To: <4C23655F.1070408@nec-labs.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Scsi target mode with qlogic 2312 card help X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 13:49:53 -0000 I managed to get the scsi target mode running by changing the isp_freebsd.c driver code to explicity put the bus in target mode when it loads. Earlier it used to "defer putting the bus in target mode". The initiator reports "scsi scan: INQUIRY result too short (5), using 36" . Does anyone have pointers on this ? Thanks. Now , my scsi_target code when run on 0:0:0 shows : scsi_target: sending ccb (0x332) scsi_target: sending ccb (0x334) .... .... scsi_target: sending ccb (0x332) scsi_target: sending ccb (0x334) scsi_target: sending ccb (0x332) scsi_target: sending ccb (0x334) scsi_target: sending ccb (0x332) scsi_target: sending ccb (0x334) scsi_target: main loop beginning scsi_target: read ready scsi_target: event -1 done scsi_target: Working on ATIO 0x2826e740 scsi_target: tcmd_handle atio 0x2826e740 ctio 0x2826e8c0 atioflags 0x8000 scsi_target: INQUIRY from 1: 12 20 0 0 24 0 scsi_target: sending ccb (0x933) While the Linux initiator shows : QLogic Fibre Channel HBA Driver: 8.03.01-k10 qla2xxx 0000:01:06.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 qla2xxx 0000:01:06.0: Found an ISP2300, irq 16, iobase 0xf7e18000 qla2xxx 0000:01:06.0: Configuring PCI space... qla2xxx 0000:01:06.0: Configure NVRAM parameters... qla2xxx 0000:01:06.0: Verifying loaded RISC code... scsi(5): **** Load RISC code **** qla2xxx 0000:01:06.0: firmware: requesting ql2300_fw.bin scsi(5): Verifying Checksum of loaded RISC code. scsi(5): Checksum OK, start firmware. qla2xxx 0000:01:06.0: Allocated (412 KB) for firmware dump... scsi(5): Issue init firmware. DEBUG: detect hba 5 at address = f5ea0000 scsi5 : qla2xxx qla2xxx 0000:01:06.0: QLogic Fibre Channel HBA Driver: 8.03.01-k10 QLogic QLA2310 - ISP2300: PCI-X (66 MHz) @ 0000:01:06.0 hdma-, host#=5, fw=3.03.28 IPX scsi(5): Asynchronous P2P MODE received. scsi(5): Asynchronous LOOP UP (2 Gbps). qla2xxx 0000:01:06.0: LOOP UP detected (2 Gbps). scsi(5): Asynchronous PORT UPDATE. scsi(5): Port database changed ffff 0006 0000. scsi(5): Asynchronous PORT UPDATE ignored 0000/0006/0000. scsi(5): qla2x00_reset_marker() scsi(5): qla2x00_loop_resync() scsi(5): F/W Ready - OK scsi(5): fw_state=3 (8cc0, f5f8, 2e81, ffff) curr time=ffff30e2. scsi(5): Configure loop -- dpc flags =0x112e0 scsi(5): LOOP READY scsi(5): qla2x00_loop_resync - end scsi scan: INQUIRY result too short (5), using 36 qla2xxx_eh_abort(5): aborting sp f69bcf60 from RISC. pid=3. scsi(5): ABORT status detected 0x5-0x0. qla2xxx 0000:01:06.0: scsi(5:0:1): Abort command issued -- 1 3 2002. qla2xxx_eh_abort(5): aborting sp f69bcf60 from RISC. pid=3. scsi(5): ABORT status detected 0x5-0x0. qla2xxx 0000:01:06.0: scsi(5:0:1): Abort command issued -- 1 3 2002. qla2xxx 0000:01:06.0: scsi(5:0:1): DEVICE RESET ISSUED. qla2xxx 0000:01:06.0: scsi(5:0:1): DEVICE RESET SUCCEEDED. qla2xxx_eh_abort(5): aborting sp f69bcf60 from RISC. pid=3. scsi(5): ABORT status detected 0x5-0x0. qla2xxx 0000:01:06.0: scsi(5:0:1): Abort command issued -- 1 3 2002. qla2xxx 0000:01:06.0: scsi(5:0:1): TARGET RESET ISSUED. qla2xxx 0000:01:06.0: scsi(5:0:1): TARGET RESET SUCCEEDED. qla2xxx 0000:01:06.0: scsi(5:0:1): BUS RESET ISSUED. scsi(5): Asynchronous P2P MODE received. scsi(5): fcport-0 - port retry count: 29 remaining scsi(5): qla2x00_reset_marker() scsi(5): fcport-0 - port retry count: 28 remaining scsi(5): fcport-0 - port retry count: 27 remaining scsi(5): fcport-0 - port retry count: 26 remaining scsi(5): fcport-0 - port retry count: 25 remaining scsi(5): fcport-0 - port retry count: 24 remaining scsi(5): fcport-0 - port retry count: 23 remaining On 06/24/2010 10:02 AM, Leo Prasath Arulraj wrote: > Hi, > > I am trying to run the /usr/share/examples/scsi_target example scsi > emulator code using : > > isp0: port 0xdc00-0xdcff mem > 0xfcf00000-0xfcf00fff irq 16 at device 6.0 on pci1 > > cards. I am new to this but have spent about 2 weeks trying to get > this working. > > Can someone tell me if I am missing something very basic ? > > Setup: > > 2 machines both with qlogic isp 2312 cards connected with a fibre > channel. Both machines run FreeBSD 8. > > On the target machine : the kernel options are : > > # SCSI peripherals > device scbus # SCSI bus (required for SCSI) > device targ > device targbh > device ispfw > options CAMDEBUG > options > CAM_DEBUG_FLAGS=CAM_DEBUG_INFO|CAM_DEBUG_CDB|CAM_DEBUG_TRACE|CAM_DEBUG_SUBTRACE|CAM_DEBUG_XPT|CAM_DEBUG_PERIPH > > options AHC_TMODE_ENABLE=0x8 > options ISP_TARGET_MODE > options VFS_AIO > > I have tried both with and without setting the following hints : > > hint.isp.0.iid="0" > hint.isp.0.role="target" > hint.isp.0.portwnn="w0000000000000000" > hint.isp.0.nodewnn="w0000000000000001" > > I run the command : > > ./scsi_target -d 0:0:0 ./vol > > and get the output with a list of INOT and ATIOs followed by a final > "entering main loop" message. > > But when I run camcontrol rescan all on the other machine, the > emulated disk does not show up. I tried both with and without these > hints : > > hint.isp.0.topology="nport" > hint.isp.0.iid="0" > hint.isp.0.portwnn="w0000000000000002" > hint.isp.0.nodewnn="w0000000000000003" > hint.isp.0.role="initiator" > > Any help is really appreciated. > > Thanks, > Leo. >