From owner-freebsd-scsi@FreeBSD.ORG Fri Aug 25 22:52:23 2006 Return-Path: X-Original-To: scsi@freebsd.org Delivered-To: freebsd-scsi@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F168416A6AA; Fri, 25 Aug 2006 22:52:22 +0000 (UTC) (envelope-from wrstuden@wasabisystems.com) Received: from mononoke.wasabisystems.com (mononoke.wasabisystems.com [66.173.145.228]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0AD0D441AD; Fri, 25 Aug 2006 21:50:05 +0000 (GMT) (envelope-from wrstuden@wasabisystems.com) Received: from [10.0.0.10] (h-66-166-188-91.sndacagl.covad.net [66.166.188.91]) by mononoke.wasabisystems.com (Postfix) with ESMTP id 2819A871E9; Fri, 25 Aug 2006 17:50:02 -0400 (EDT) In-Reply-To: <44EF64CF.2060304@samsco.org> References: <000201c6c7df$cb0e8a40$0200a8c0@mrbill5> <20060825204525.GA8060@nargothrond.kdm.org> <44EF64CF.2060304@samsco.org> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <71A64AAF-B229-4109-BA2F-E2AC64A11060@wasabisystems.com> Content-Transfer-Encoding: 7bit From: William Studenmund Date: Fri, 25 Aug 2006 14:49:52 -0700 To: "Kenneth D. Merry" X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.752.2) Cc: scsi@freebsd.org Subject: Re: iSCSI/luns/check-condition 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: Fri, 25 Aug 2006 22:52:23 -0000 -----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-----