isp(4) doppleganger disk devices
Ade Lovett
ade at freebsd.org
Tue Dec 4 21:20:33 PST 2007
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
More information about the freebsd-scsi
mailing list