From cth@sac.sfbay.sun.com Mon Jun  4 21:06:24 2007
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id l5546NxL018362
	for <psarc-ext@sac.sfbay.sun.com>; Mon, 4 Jun 2007 21:06:24 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id l5544p9f010241;
	Tue, 5 Jun 2007 05:04:58 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JJ500D01A09LJ00@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 04 Jun 2007 21:04:57 -0700 (PDT)
Received: from sfbaymail2sca.sfbay.sun.com ([129.145.155.42])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JJ500029A09B570@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 04 Jun 2007 21:04:57 -0700 (PDT)
Received: from sac.sfbay.sun.com (sac.SFBay.Sun.COM [129.146.226.132])
	by sfbaymail2sca.sfbay.sun.com (8.13.6+Sun/8.12.10/ENSMAIL,v2.2)
 with ESMTP id l5544vgA015231; Mon, 04 Jun 2007 21:04:57 -0700 (PDT)
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id l5546KlN018357; Mon,
 04 Jun 2007 21:06:20 -0700 (PDT)
Received: (from cth@localhost)	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit)
 id l5546KJb018353; Mon, 04 Jun 2007 21:06:20 -0700 (PDT)
Date: Mon, 04 Jun 2007 21:06:20 -0700 (PDT)
From: Christopher Horne <cth@sac.sfbay.sun.com>
Subject: SCSI inquiry property enhancement [PSARC/2007/329 FastTrack timeout
 7/13/2007]
To: PSARC-ext@Sun.COM
Message-id: <200706050406.l5546KJb018353@sac.sfbay.sun.com>
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
Status: RO
Content-Length: 9517

I am sponsoring this following fasttrack for myself, requesting patch
binding and a timeout of 6/13/2007.

-Chris

Template Version: @(#)sac_nextcase 1.61 05/24/07 SMI
This information is Copyright 2007 Sun Microsystems

#pragma ident	"%Z%%M%	%I%	%E% SMI"

1. Introduction
    1.1. Project/Component Working Name:
	 SCSI inquiry property enhancement

    1.2. Name of Document Author/Supplier:
	 Author: Chris Horne

    1.3  Date of This Document:
	 04 June, 2007

4. Technical Description

   4.1  Problem

	Inquiry-vendor-id(9P) properties were introduced by "SCSI
	INQUIRY data properties" <http://sac.sfbay/PSARC/2000/332>.
	T10 standards describe translations between SCSI and other
	native transport/protocols, like SATA
	<http://t10.org/drafts.htm#sat->.

	During T10 translation, if the native transport representation
	of inquiry-like data does not fit the scsi_inquiry(9S) model,
	loss of information by substitution and/or truncation occurs.

	Accurate inquiry-*(9P) property values are important to FMA.
	The values are used to identify a failed drive FRU, and should
	match the information printed on the drive - including serial
	number.

	Obtaining accurate values in transport specific ways leads to
	the proliferation of transport specific interfaces - causing
	the spread of transport specific knowledge across all
	consumers.

    4.2 Proposal

	Instead of using transport specific mechanisms to obtain
	accurate inquiry-*(9P) values, the proposal is to treat the
	inquiry-*(9P) values 'figuratively'.

	Treating inquiry-*(9P) figuratively permits a T10 native
	transport translation layer (like SATA) to establish accurate
	values from native information at tran_tgt_init(9E) time. The
	native values take precedence over SCSI protocol based values
	established by SCSA during scsi_probe(9F).

	Treating inquiry-*(9P) figuratively also allows us to introduce
	new inquiry-like properties based on data other than
	scsi_inquiry(9S). This proposal introduces a new
	inquiry-serial-no(9P) property based on EVPD "Unit Serial
	Number" (page 0x80 SCSI INQUIRY data (or is established by the
	native transport at tran_tgt_init(9E) time).

	With this approach, SCSA (or new target driver code) that
	establishes a SCSI-protocol based inquiry-*(9P) value must
	first check to see if the native transport has already
	established a value - the native value takes precedence.

	NOTE: The scsi(4) compatible property defined by PSARC/2004/116
	will still be derived using scsi_inquiry(9S) data.

    4.2.1 Field Size Limitations of Existing inquiry-(9P) Properties

	An example of field size mismatch, with SATA the native
	'Identify Device Data' field that maps to INQUIRY_REVISION_ID
	is eight bytes long, but the scsi_inquiry(9S) 'inq_revision'
	field is only four bytes long.

	The current definition of "inquiry-*"(9P) properties is
	explicit about where property values come from:

	   "... it contains the SCSI vendor identification
	   inquiry data (from SCSI inquiry data bytes 8 - 15)..."

	This proposal takes the position that:

	o The current man page is defining the 'typical' source of the
	  information for property value.

	  Obtaining this information from other, more accurate, sources
	  is a compatible change.

	o The current man page definition does not define the length of
	  the property value string.

	  The current code already trims trailing blanks and adds a
	  null termination, so the property string length already lacks
	  a hard relationship with the 'typical' source.

	  For string properties, both the user and kernel interfaces to
	  obtain values define interfaces where the implementation
	  performs the value memory allocation:

	  o user applications obtain string values via
	    di_prop_lookup_strings(3DEVINFO). They get back a pointer
	    to the snapshot memory containing the value. The consumer
	    is not doing the allocation.

	  o kernel consumers use ddi_prop_lookup_string(9F), and get
	    back a pointer to the allocated string, and must call
	    ddi_prop_free(9F) when done. Again, the consumer is not
	    doing the allocation.

	  Given this, having longer property values should not be a
	  problem, making this aspect of the proposal a compatible
	  change.

	NOTE: The only known consumer of inquiry-*(9P) properties is
	the cfgadm scsi plugin code, for which it was first
	introduced.


    4.2.2 New inquiry-*(9P) properties: Serial Number

	A new inquiry-like property called 'inquiry-serial-no' is
	proposed. This property will be established by the target
	driver in the SCSI-protocol defined way: issuing a an EVPD
	"Unit Serial Number" (page 0x80) SCSI INQUIRY command.  The
	page 0x80 data returned is not in scsi_inquiry(9S) form.

	If a device does not support page 0x80, then the 
	inquiry-serial-no(9P) property is not defined.

    4.3 Example

	Example: SATA disk 'inquiry-*(9P)' properties

	    Before:
		name='inquiry-vendor-id' type=string items=1
		    value='ATA'
		name='inquiry-product-id' type=string items=1
		    value='HITACHI HDS7250S'
		name='inquiry-revision-id' type=string items=1
		    value='AJ0A'

	    After:
		name='inquiry-vendor-id' type=string items=1
		    value='HITACHI'
		name='inquiry-product-id' type=string items=1
		    value='HDS7250SASUN500G 0647KLA1NF'
		name='inquiry-revision-id' type=string items=1
		    value='K2AOAJ0A'
		name='inquiry-serial-no' type=string items=1
		    value='KRVP65ZAKLA1NF'


    4.4 Interface Table

	------------------------------------------------------------------------
	Interface		  Level			Comments
	------------------------------------------------------------------------

	Modified:
	  inquiry-vendor-id(9P)	  Committed		value is only
	  inquiry-product-id(9P)			loosely-coupled to
	  inquiry-revision-id(9P)			scsi_inquiry(9S) data.

	New:
	  inquiry-serial-no(9P)	  Committed		serial number property


    4.5 References

	o T10 SAT SCSI/ATA Translation
	  http://t10.org/drafts.htm#sat-

	o SCSI INQUIRY data properties
	  http://sac.sfbay/PSARC/2000/332

	o New SCSI Properties
	  http://sac.sfbay/PSARC/2001/319

	o SCSI target compatible property
	  http://sac.sfbay/PSARC/2004/116

    4.6 Changes to inquiry-vendor-id(9P) man page:

	See below.

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:

		ON

    6.5. ARC review type:

	FastTrack

A.1 inquiry-prop(9P) man page changes

:r!diff -U 5 inquiry-prop.man.orig inquiry-prop.man.new
{
--- inquiry-prop.man.orig	Tue May 15 09:37:49 2007
+++ inquiry-prop.man.new	Tue May 15 10:06:09 2007
@@ -1,34 +1,48 @@
 Kernel Properties for Drivers             inquiry-device-type(9P)
 
 NAME
      inquiry-device-type, inquiry-vendor-id,  inquiry-product-id,
-     inquiry-revision-id - properties from SCSI inquiry data
+     inquiry-revision-id, inquiry-serial-no
+     inquiry properties for SCSI devices.
 
 DESCRIPTION
-     These are optional properties created by the system for SCSI
-     target devices.
+     These are optional properties, typically created by the system,
+     for SCSI target devices.  References to these properties should
+     use their <sys/scsi/impl/inquiry.h> defined names.
 
-     inquiry-device-type is an integer  property.  When  present,
-     the least significant byte of the value indicates the device
-     type as defined by the SCSI standard.
+     inquiry-device-type is an integer property. When present, the
+     least significant byte of the value indicates the device type as
+     defined by the SCSI standard. Consumers of this property should
+     compare the property values with DTYPE_* values defined in
+     <sys/scsi/generic/inquiry.h>.
 
-     inquiry-vendor-id is a string  property.  When  present,  it
-     contains  the  SCSI vendor identification inquiry data (from
-     SCSI inquiry data bytes  8  -  15),  formatted  as  a  NULL-
-     terminated string.
+     inquiry-vendor-id is a string property. When present, it contains
+     the vendor information. This information typically comes from the
+     scsi_inquiry(9S) 'inq_vid' field.
 
-     inquiry-product-id is a string property.  When  present,  it
-     contains  the SCSI product identification inquiry data (from
-     SCSI inquiry data bytes 16 - 31).
+     inquiry-product-id is a string property. When present, it contains
+     the product identification. This information typically comes from
+     the scsi_inquiry(9S) 'inq_pid' field.
 
-     inquiry-revision-id is a string property. When  present,  it
-     contains  the  SCSI product revision inquiry data (from SCSI
-     inquiry data bytes 32 - 35).
+     inquiry-revision-id is a string property. When present, it
+     contains the product revision. This revision typically comes from
+     the scsi_inquiry(9S) 'inq_rev' field.
 
-     Consumers of these properties should  compare  the  property
-     values      with      DTYPE_*      values     defined     in
-     <sys/scsi/generic/inquiry.h>.
+     inquiry-serial-no is a string property. When present, it contains
+     the serial number.  The serial number is typically obtained from
+     the EVPD "Unit Serial Number" SCSI INQUIRY data (page 0x80).
 
+NOTE
+     Values established at tran_tgt_init(9E) time by an HBA driver take
+     precedence over values established by the system, and HBA driver
+     values may not be the same length as the typical scsi_inquiry(9S)
+     field.
+
 SEE ALSO
-     Writing Device Drivers
+     scsi_inquiry(9S), Writing Device Drivers
 
}

From Chris.Horne@Sun.COM Wed Jun 13 13:47:29 2007
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id l5DKlSi0022663
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 13 Jun 2007 13:47:29 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail5.uk.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id l5DKjtOU000449
	for <@newsunmail1brm.central.sun.com:PSARC-ext@sun.com>; Wed, 13 Jun 2007 21:45:56 +0100 (BST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0JJL0052BDOJLV00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@Sun.Com); Wed, 13 Jun 2007 14:45:55 -0600 (MDT)
Received: from brmea-mail-1.sun.com ([192.18.98.31])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JJL00IYSDOJUC70@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@Sun.Com); Wed,
 13 Jun 2007 14:45:55 -0600 (MDT)
Received: from fe-amer-05.sun.com ([192.18.108.179])
	by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l5DKjsYe014516	for
 <PSARC-ext@Sun.Com>; Wed, 13 Jun 2007 20:45:54 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0JJL00101D2LEK00@mail-amer.sun.com>
 (original mail from Chris.Horne@Sun.COM)
 for PSARC-ext@Sun.Com (ORCPT PSARC-ext@Sun.Com); Wed,
 13 Jun 2007 14:45:54 -0600 (MDT)
Received: from [172.20.25.50] by mail-amer.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 with ESMTPSA id <0JJL0033CDOHLQD3@mail-amer.sun.com>; Wed,
 13 Jun 2007 14:45:54 -0600 (MDT)
Date: Wed, 13 Jun 2007 14:45:00 -0600
From: Chris Horne <Chris.Horne@Sun.COM>
Subject: Re: SCSI inquiry property enhancement [PSARC/2007/329 FastTrack
 timeout 7/13/2007]
In-reply-to: <200706050406.l5546KJb018353@sac.sfbay.sun.com>
Sender: Chris.Horne@Sun.COM
To: Christopher Horne <cth@sac.sfbay.sun.com>
Cc: PSARC-ext@Sun.COM
Message-id: <4670574C.5000004@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.2.0.264296
References: <200706050406.l5546KJb018353@sac.sfbay.sun.com>
User-Agent: Thunderbird 1.5.0.8 (X11/20061204)
Status: RO
Content-Length: 159


> 1.1. Project/Component Working Name:
> SCSI inquiry property enhancement
>   
This fasttrack was approved, as specified, at today's PSARC meeting.

-Chris


