2001-07-20 16:46:07

by Roland Fehrenbacher

[permalink] [raw]
Subject: qlogicfc driver

Hi,

I am testing a SAN setup with a Fibre Channel RAID Controller (GMR) connected
to a QLA2200/QLA2100 via Gadzoox Cappelix Switches. The RAID controller
supports 32 LUNs on configurable SCSI target Ids. In the present case I have 3
RAID sets with pairs (SCSI Id, LUN) (0, 0) (0, 1) (1, 0), i.e. two drives with
LUN 0 and one with LUN 1. While the controller itself sees all the 3 drives
when booting up, under Linux I am only able to see the LUN 0 drives.

Kernel is stock 2.4.6 using the qlogicfc driver. I also tried to set
max_scsi_luns=32, even though the default of 8 should be enough. No success.
Of course, support for multiple LUNs is enabled in the kernel. By the way,
using the beta driver on the qlogic site (qla2x00src-v4.27Beta.tgz) also
doesn't help. So the issue might not even be driver related.

Any ideas anyone?

Thanks.

Cheers,

Roland

----
Roland Fehrenbacher
transtec AG
Waldh?rnlestrasse 18
D-72072 T?bingen
Tel.: +49(0)7071/703-320
Fax: +49(0)7071/703-90320
EMail: [email protected]
http://www.transtec.de


2001-07-20 21:58:02

by Roland Fehrenbacher

[permalink] [raw]
Subject: Re: qlogicfc driver

> While the controller itself sees all the 3 drives
> when booting up, under Linux I am only able to see the LUN 0 drives.

Update to my previous post:

The command
echo "scsi add-single-device 0 0 0 1" > /proc/scsi/scsi
makes the LUN 1 device appear, so it seems the problem is with the SCSI
scanning code.

Roland

2001-07-20 22:15:43

by jsack

[permalink] [raw]
Subject: Re: qlogicfc driver



On Fri, 20 Jul 2001, Roland Fehrenbacher wrote:

> > While the controller itself sees all the 3 drives
> > when booting up, under Linux I am only able to see the LUN 0 drives.
>
> Update to my previous post:
>
> The command
> echo "scsi add-single-device 0 0 0 1" > /proc/scsi/scsi
> makes the LUN 1 device appear, so it seems the problem is with the SCSI
> scanning code.
>


is "probe all luns" configured in your kernel?
(.config: CONFIG_SCSI_MULTI_LUN=y)

..jim

2001-07-26 14:37:29

by Roland Fehrenbacher

[permalink] [raw]
Subject: Re: qlogicfc driver

Roland> While the controller itself sees all the 3 drives when booting up,
Roland> under Linux I am only able to see the LUN 0 drives.

Roland> The command echo "scsi add-single-device 0 0 0 1" > /proc/scsi/scsi
Roland> makes the LUN 1 device appear, so it seems the problem is with the
Roland> SCSI scanning code.

In the meantime I found out that I need to identify the RAID controller as a
sparse LUN device. This works fine as long as there is a host drive mapped to
LUN 0. If there is no host drive mapped to LUN 0, we run into a bug of the SCSI
scanning code: The variable *sparse_lun=1 never gets set and any other host
drives at LUNs > 0 are not detected. This problem has already been discussed
in a different context previously
(http://groups.google.com/groups?q=scsi_scan.c&hl=en&safe=off&rnum=2&selm=F888C30C3021D411B9DA00B0D0209BE8FAB0EB%40cvo-exchange.roguewave.com).

The following patch fixes the problem, and I can't see any side effects. Please
review the patch, and if approved, include it in the kernel.

Cheers,

Roland

--- scsi_scan.c.orig Mon Jul 23 09:24:53 2001
+++ scsi_scan.c Thu Jul 26 16:29:14 2001
@@ -153,6 +153,8 @@
{"DELL", "PSEUDO DEVICE .", "*", BLIST_SPARSELUN}, // Dell PV 530F
{"DELL", "PV530F", "*", BLIST_SPARSELUN}, // Dell PV 530F
{"EMC", "SYMMETRIX", "*", BLIST_SPARSELUN},
+ {"CMD", "CRA-7280", "*", BLIST_SPARSELUN}, // CMD RAID Controller
+ {"Zzyzx", "RocketStor 500S", "*", BLIST_SPARSELUN}, // Zzyzx RocketStor Raid
{"SONY", "TSL", "*", BLIST_FORCELUN}, // DDS3 & DDS4 autoloaders
{"DELL", "PERCRAID", "*", BLIST_FORCELUN},
{"HP", "NetRAID-4M", "*", BLIST_FORCELUN},
@@ -565,20 +567,26 @@
}

/*
- * Check the peripheral qualifier field - this tells us whether LUNS
- * are supported here or not.
+ * Check for SPARSELUN before checking the peripheral qualifier,
+ * so sparse lun devices are completely scanned.
*/
- if ((scsi_result[0] >> 5) == 3) {
- scsi_release_request(SRpnt);
- return 0; /* assume no peripheral if any sort of error */
- }

/*
* Get any flags for this device.
*/
bflags = get_device_flags (scsi_result);

-
+ if (bflags & BLIST_SPARSELUN) {
+ *sparse_lun = 1;
+ }
+ /*
+ * Check the peripheral qualifier field - this tells us whether LUNS
+ * are supported here or not.
+ */
+ if ((scsi_result[0] >> 5) == 3) {
+ scsi_release_request(SRpnt);
+ return 0; /* assume no peripheral if any sort of error */
+ }
/* The Toshiba ROM was "gender-changed" here as an inline hack.
This is now much more generic.
This is a mess: What we really want is to leave the scsi_result

2001-07-26 14:42:59

by Roland Fehrenbacher

[permalink] [raw]
Subject: Re: qlogicfc driver

Roland> While the controller itself sees all the 3 drives when booting up,
Roland> under Linux I am only able to see the LUN 0 drives.

Roland> The command echo "scsi add-single-device 0 0 0 1" > /proc/scsi/scsi
Roland> makes the LUN 1 device appear, so it seems the problem is with the
Roland> SCSI scanning code.

In the meantime I found out that I need to identify the RAID controller as a
sparse LUN device. This works fine as long as there is a host drive mapped to
LUN 0. If there is no host drive mapped to LUN 0, we run into a bug of the SCSI
scanning code: The variable *sparse_lun=1 never gets set and any other host
drives at LUNs > 0 are not detected. This problem has already been discussed
in a different context previously
(http://groups.google.com/groups?q=scsi_scan.c&hl=en&safe=off&rnum=2&selm=F888C30C3021D411B9DA00B0D0209BE8FAB0EB%40cvo-exchange.roguewave.com).

The following patch fixes the problem, and I can't see any side effects. Please
review the patch, and if approved, include it in the kernel.

Cheers,

Roland

--- scsi_scan.c.orig Mon Jul 23 09:24:53 2001
+++ scsi_scan.c Thu Jul 26 16:29:14 2001
@@ -153,6 +153,8 @@
{"DELL", "PSEUDO DEVICE .", "*", BLIST_SPARSELUN}, // Dell PV 530F
{"DELL", "PV530F", "*", BLIST_SPARSELUN}, // Dell PV 530F
{"EMC", "SYMMETRIX", "*", BLIST_SPARSELUN},
+ {"CMD", "CRA-7280", "*", BLIST_SPARSELUN}, // CMD RAID Controller
+ {"Zzyzx", "RocketStor 500S", "*", BLIST_SPARSELUN}, // Zzyzx RocketStor Raid
{"SONY", "TSL", "*", BLIST_FORCELUN}, // DDS3 & DDS4 autoloaders
{"DELL", "PERCRAID", "*", BLIST_FORCELUN},
{"HP", "NetRAID-4M", "*", BLIST_FORCELUN},
@@ -565,20 +567,26 @@
}

/*
- * Check the peripheral qualifier field - this tells us whether LUNS
- * are supported here or not.
+ * Check for SPARSELUN before checking the peripheral qualifier,
+ * so sparse lun devices are completely scanned.
*/
- if ((scsi_result[0] >> 5) == 3) {
- scsi_release_request(SRpnt);
- return 0; /* assume no peripheral if any sort of error */
- }

/*
* Get any flags for this device.
*/
bflags = get_device_flags (scsi_result);

-
+ if (bflags & BLIST_SPARSELUN) {
+ *sparse_lun = 1;
+ }
+ /*
+ * Check the peripheral qualifier field - this tells us whether LUNS
+ * are supported here or not.
+ */
+ if ((scsi_result[0] >> 5) == 3) {
+ scsi_release_request(SRpnt);
+ return 0; /* assume no peripheral if any sort of error */
+ }
/* The Toshiba ROM was "gender-changed" here as an inline hack.
This is now much more generic.
This is a mess: What we really want is to leave the scsi_result