From owner-freebsd-scsi@FreeBSD.ORG Wed Dec 5 05:20:33 2007 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 8061816A469 for ; Wed, 5 Dec 2007 05:20:33 +0000 (UTC) (envelope-from ade@lovett.com) Received: from mail.lovett.com (foo.lovett.com [67.134.38.158]) by mx1.freebsd.org (Postfix) with ESMTP id 6100D13C4E9 for ; Wed, 5 Dec 2007 05:20:33 +0000 (UTC) (envelope-from ade@lovett.com) Received: from inferno.canal.lovett.com ([172.16.32.23]:54221) by mail.lovett.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68 (FreeBSD)) (envelope-from ) id 1Izm8H-000BcJ-Ap; Tue, 04 Dec 2007 20:45:13 -0800 Message-Id: <5793341B-6332-4567-B4F3-05E381690E45@freebsd.org> From: Ade Lovett To: freebsd-scsi@FreeBSD.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Tue, 4 Dec 2007 20:45:12 -0800 X-Mailer: Apple Mail (2.915) Sender: ade@lovett.com Cc: Ade Lovett Subject: isp(4) doppleganger disk devices 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: Wed, 05 Dec 2007 05:20:33 -0000 Hi folks, I have a number of JBODs that have a bunch of SATA drives in them, presented to the outside world as 2*FCAL connectors, hooked up to a Qlogic 2312 HBA. The first issue I had was that each of the 16 drives in the bay presented themselves on each of luns 0-31 during the initial loop scan, resulting in 1024 'da' devices, which, when it came later on to attach, confused the system somewhat -- of course, it also meant the machine took over 30 minutes to boot, being attached to a slow serial console. This was hackable by forcibly setting isp->isp_maxluns to 1, rather than the existing code which set maxluns based on the type of hardware. This ensured that each disk was only seen once (on lun 0), but still resulted in each of the 16 drives being presented to the FreeBSD box on both of the channels of Qlogic card. Not unreasonable in and of itself, given the potential for multipathing, but since that doesn't appear to work -- dinking first with daX, then daY, which correspond to the same drive, but on isp0 and isp1, results in somewhat entertaining behavior, we decided to go for a simple hack to hide certain devices on a per-controller basis, presenting the first half of the array only on channel 0, and the second on channel 1. With revision 1.113.2.4 (RELENG_6) of sys/dev/isp/isp.c, this was achieved with the following patch: @@ -2474,2 +2492,8 @@ fcp->portdb[i].portid = fcp->tport[loopid].portid; + + /* XXX: Supernews */ + if (isp_ignore_target(isp, i)) { + fcp->portdb[i].valid = 0; + continue; + } fcp->portdb[i].valid = 1; and a suitably defined local isp_ignore_target() function that grabbed the device unit and target number and said 'yay' or 'nay'. With a convenient device.hints, I ended up with the first half of the array being presented as da10-da17 on isp0, and the second half as da20-27 on isp1. Attempts to do this with the new isp(4) driver have proven unsuccessful so far (mainly down to my lack of full understanding of the new code). I realize of course that what I'm trying to accomplish is the result of, at best, iffy hardware, but nonetheless, is there a way to solve this as I currently have it, or an alternate approach that I haven't thought about? Help! -aDe