From owner-freebsd-scsi@FreeBSD.ORG Thu Mar 9 21:39:53 2006 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D6DD16A420 for ; Thu, 9 Mar 2006 21:39:53 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B3A943D4C for ; Thu, 9 Mar 2006 21:39:52 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [10.10.3.185] ([69.15.205.254]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id k29Ldg5S029259; Thu, 9 Mar 2006 14:39:44 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <4410A097.9030709@samsco.org> Date: Thu, 09 Mar 2006 14:39:35 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Eric Anderson References: <4395BF04.50101@centtech.com> <43960F55.3010508@root.org> <43975926.1010302@centtech.com> <43975F5F.5080901@samsco.org> <439782AA.6000408@root.org> <4397B731.6010308@centtech.com> <4397B82C.5020004@samsco.org> <4397EBC7.9030105@root.org> <440F5141.7010002@centtech.com> <44105A01.5080309@root.org> <44109AEA.5030209@centtech.com> In-Reply-To: <44109AEA.5030209@centtech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=3.8 tests=none autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: freebsd-scsi@freebsd.org, Nate Lawson Subject: Re: scsi-target and the buffer cache 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: Thu, 09 Mar 2006 21:39:53 -0000 Eric Anderson wrote: > Nate Lawson wrote: > >> [mailing list changed to scsi@] >> >> Eric Anderson wrote: >> >>> Nate Lawson wrote: >>> >>>> Scott Long wrote: >>>> >>>>> Eric Anderson wrote: >>>>> >>>>>> Nate Lawson wrote: >>>>>> >>>>>>> Agree 100%. While having it in usermode means there are boundary >>>>>>> crossings that increase per-transaction latency, the actual bulk >>>>>>> data transfer is via zero-copy IO and you should be able to >>>>>>> exceed the data transfer rates of several 10K RPM drives on >>>>>>> decent hardware. >>>>>> >>>>>> >>>>>> Ok, great.. Now, will scsi_target work ok with raw devices, or >>>>>> only files? (although I'm not sure theres all that much >>>>>> difference really). >>>>>> >>>>> >>>>> You can write your userland code to use whatever files or devices you >>>>> want. Are you talking about the scs_target.c code in >>>>> /usr/share/examples? That's just a skeletal example that you can use >>>>> as a starting point for your own work. >>>> >>>> >>>> No, it's not just a skeletal example. You can point it at a raw >>>> device as the backing store file and it will work as a block device >>>> (i.e. RBC command set). It has been tested as working at least >>>> moderately fast over SCSI, FC, and firewire. >>>> >>> >>> I'm finally getting around to playing with this, and I'm having some >>> problems. First, I can't seem to make one isp card in target mode >>> and the other an initiator. I've messed with adding the following to >>> loader.conf: >>> >>> hint.isp.0.role="initiator" >>> hint.isp.1.role="target" >>> >>> that still doesn't show my currently connected fiber channel devices >>> on the initiator side. >>> >>> I've tried a few different kernel options, currently I have: >>> >>> options ISP_TARGET_MODE=1 >>> device targ >>> >>> I've also tried just: >>> >>> options ISP_TARGET_MODE >>> >>> and that doesn't seem to allow me to select one either. >> >> >> hints aren't needed. Here's an intro on how to use it: >> http://root.org/~nate/freebsd/scsi/README.targ >> >> The same card is in target or initiator mode based on the scsi_target >> user program. When it's running, target mode is enabled. > > > Hmm. Then shouldn't a > > camcontrol rescan all > camcontrol devlist -v > > show me all the devices on the FC network? If I remove the target mode > stuff out, and do that, I see all my devices. With it in, I see no > devices. > When I run the scsi_target tool (scsi_target -d 0:3:0 /mnt/testfile), it > shows a bunch of "sending ccb (0x332)" and (0x334) messages alternating > for a couple hundred lines, then "main loop beginning" and a few other > messages. If you want the full details, I'd be glad to sent them. > > Once scsi_target is running, my other FC initiator (FreeBSD 6.1- also) > can see it. > > >> >>> Anyhow, I've compiled scsi_target (from >>> /usr/share/examples/scsi_target), and tried to run it using a 20gb >>> file as the target, and still I can't seem to get it working. >>> Is there a doc somewhere I need to read? >>> >>> Also - as a side note, the Makefile for scsi_target seems like it's >>> missing a path variable in order to do a make install, but that's not >>> a real issue. >> >> >> There was some debate when I imported it whether to make it an example >> or usr.sbin. Given the lack of updates (i.e. ki_sig or whatever), I >> probably should have put it somewhere else. > > > Is it a totally non-supported kind of tool? Is there another option for > scsi target mode? > > > Thanks! > Eric > > Can isp operate as both a target and initiator at the same time? I thought that that was a pretty rare feature. If not, then when it's in target mode it won't be able to see any other targets on the bus. Scott