RE: The limitation of scsi target and lun supported under Linux?

WANG,YIDING (yiding_wang@am.exch.hp.com)
Tue, 28 Sep 1999 11:16:33 -0600


Thanks for the response.

The scsi support depends on two sources. One from OS target driver and
another from spec.
Even wide scsi support 16 targets, most Unix OSes support 32 and more. For
example, Solaris
support 128 target and 32 lun each. Unixware has 8 bit for target under
UW7. From scsi
III, massive lun is supported. It all depends on how OS target driver
implemented. Since
I don't see any document regarding this isuue for Linux, I need to know the
limitation.

I am doing Fibre Channel device support which using SCSI III protocal.
Currently many
vendor requires large number device support. For example, EMC asks at least
256 LUN is
supported.

In the HBA driver, the limitation is defined in the structure of Scsi_Host
with max_id and
max_lun. Both value could be vary from host side but the limitation from
target driver
side is the key.

>From code "scsi_.c" routine "scan_scsi()", it looks like there is no
limitation for max
target supported. It all depends on the max_id passed by host driver.
However, there is
a limitation for max_lun which is 8 defined by "max_scsi_luns = 8".

As you mentioned here the max LUN could be 127, could you tell me where it
is defined and
how it was passed during the scsi device scanning phase?

Even by looking into the source code and got the conclusion of no limitatin
for scsi target support and max. 8 LUN is supported, still I have question
of the limitation of target and lun current Linux can support? This is due
to my feeling that there should be a limitation for target support and 8 lun
support is too few. Also Benjamin mentioned 127 lun supoort although I
don't know where the number comes from.

If anyone knows for sure, please confirm!

Many thanks!

-eddie

-----Original Message-----
From: Benjamin Scott [mailto:dragonhawk@iname.com]
Sent: Monday, September 27, 1999 9:30 PM
To: WANG,YIDING (HP-SanJose,ex1)
Subject: Re: The limitation of scsi target and lun supported under
Linux?

On Mon, 27 Sep 1999, WANG,YIDING (HP-SanJose,ex1) wrote:
> Linux scsi support has max_id and max_lun defined in Scsi_Host structure.
> Both of them are defined as "unsigned int" which is a 4 byte value.

They are defined that way because an int is (per the C standard) supposed
to
be the most "comfortable" (read: fast) data type a particular architecture
can
work with.

> Does Linux really be able to support defined bit number of device?
> max_id could be 2^31 = 2G, and max_lun could be the same.

The SCSI specification limits you to 127 LUNs per SCSI target.

The number of SCSI targets depends on the width of your SCSI bus. Narrow
SCSI has 8 pins, thus 8 targets (including the host adapter). 16-bit wide
SCSI supports a maximum of 16 targets. And so on...

--
Benjamin Scott
dragonhawk@iname.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/