Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Aug 2006 14:49:52 -0700
From:      William Studenmund <wrstuden@wasabisystems.com>
To:        "Kenneth D. Merry" <ken@freebsd.org>
Cc:        scsi@freebsd.org
Subject:   Re: iSCSI/luns/check-condition
Message-ID:  <71A64AAF-B229-4109-BA2F-E2AC64A11060@wasabisystems.com>
In-Reply-To: <44EF64CF.2060304@samsco.org>
References:  <000201c6c7df$cb0e8a40$0200a8c0@mrbill5>	<E1GGXyv-0007JJ-RG@cs1.cs.huji.ac.il>	<F6E2AEDC-1C45-41A1-9B3A-A05E93F44456@wasabisystems.com>	<E1GGgKF-00069y-7G@cs1.cs.huji.ac.il>	<DDCEA06D-E09F-4021-8CCD-C9451CF90243@wasabisystems.com> <20060825204525.GA8060@nargothrond.kdm.org> <44EF64CF.2060304@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Aug 25, 2006, at 1:59 PM, Scott Long wrote:

> Kenneth D. Merry wrote:
>> On Fri, Aug 25, 2006 at 11:37:15 -0700, William Studenmund wrote:
>> See above...CAM sets the LUN number when it does the initial probe  
>> of a
>> LUN, and when the LUN reports it is SCSI-2 or below.
>> The problem with rejecting the LUN number on the inquiry is that the
>> initiator is issuing the inquiry to find out what SCSI rev the  
>> target is in
>> the first place.  It has to do so in a way that will work on old  
>> and new
>> targets.
>> Things work okay on LUN 0, because the LUN field is set to 0.
>> My suggestion would be to allow setting of the LUN number on the  
>> inquiry
>> command only.  That way the initiator can figure out what SCSI rev  
>> you are
>> and do things accordingly.
>> Ken
>
> Are there cases where a target has multiple LUNs that will each  
> report a different SCSI rev?  If not, then CAM should look at the  
> rev of LUN 0 of the target when deciding how to form an INQ of LUNs  
> >0.

While I think there could be a difference between reported levels, if  
LUN 0 reports > SCSI-1, then I think it's appropriate to not put the  
LUN in the CDB. SCSI-2 mentions that the LUN field should be set to  
zero as SCSI-3 may reclaim the bits (which it did).

I believe that by the time LUN 0 has been probed, the system should  
have enough information to figure out if the device is SCSI-1,  
SCSI-2. or SCSI-3 (i.e. sam-X, spc-Y, etc.). I think that Scott's  
suggestion is good; if LUN 0 is SCSI-1, fill in the LUN in the CBD.  
If LUN 0 is > SCSI-1, don't.

Also, while probing LUN 0, it's probably best to perform a REPORT  
LUNS command. If it succeeds, you 1) don't need to blindly probe, and  
2) you know that you shouldn't put the LUN in the CDB (REPORT LUNS  
appeared  in SPC, which is SCSI-3).

Take care,

Bill
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFE73CHDJT2Egh26K0RAm+qAJ4+HXmkWGjDlQ9N+NBRKLVXRmk7AgCfQHZI
RLHACxamcGkzSzAIqiRaw8g=
=JcoY
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?71A64AAF-B229-4109-BA2F-E2AC64A11060>