From: "Elliott, Robert (Server Storage)" <Elliott@hp.com> To: "T10@t10.org" <T10@t10.org> Date: Wed, 12 Dec 2007 20:19:20 +0000 Subject: RE: SAS - Protocol-Specific Port log page X-Message-Number: 8295 Formatted message: HTML-formatted message Attachment #1: image001.png Attachment #2: image002.png ________________________________ From: owner-t10@t10.org [mailto:owner-t10@t10.org] On Behalf Of Mike Berhan Sent: Wednesday, December 12, 2007 12:49 PM To: T10@t10.org Subject: SAS - Protocol-Specific Port log page I am currently working with a SAS 1.1 device and reviewing the SAS-1.1 and SAS-2 specification. I have some questions / comments regarding the protocol specific port log page for SAS. Before I get to that, I need to provide some simple screenshots of an actual SAS 1.1 device to help describe my question. The first eight bytes of the "Protocol-Specific Port log parameter for SAS" are similar between SAS-1.1 and SAS-2. The SAS-1.1 decoding is below. SAS-2 marks the "DS" bit as Obsolete, uses "Format and Linking" instead of "LBIN" and "LP", and defines offset 6 as the "Generation Code." [cid:003105519@12122007-2BCF] An array of "SAS Phy Log Desriptor" entries follows this 8 byte header. The number of entries in the array is given to us in the "Number of Phys" entry seen above. OK, so far so good. In reviewing SAS-1.1, the SAS phy log descriptor is a fixed 48 byte structure as you see here: [cid:003105519@12122007-2BD6] Traversing through the array of SAS phy log descriptors is rather simple as you know the number of Phys and you know that each descriptor is 48 bytes in length. The complexity comes with SAS-2. This specification defines variable length SAS phy log descriptors. Offset 3 of the above structure is now defined as the "SAS Phy Log Descriptor Length". The structure is larger than 48 bytes and contains a variable number of Phy Event Descriptors. In my task, I do not have the luxury of enumerating various information from the device so I do not know if it's a SAS-1.1 or SAS-2 device. All I have is the log sense data to analyze. I need to know if I'm looking at a SAS-1.1 descriptor or a SAS-2 descriptor. The first method, or perhaps I should call it a hack, that comes to mind is: If ( DescriptorOffset[3]==0 ) // It's a fixed 48 byte descriptor (i.e. SAS-1.1) else // it's a variable length descriptor, total len = DescriptorOffset[3]+4 RE: That's the intended algorithm. Always consider that byte to be a LENGTH field, but special-case the length of 00h to mean 48 total bytes. Now finally to my question. If all I have access to is this log page, would the above pseudo code be the preferred method of knowing which descriptor the device is returning? If not, is there another field in the descriptor that would be preferred? Should a "Version" field be introduced so that the application layer knows which version of the structure they are looking at and which fields are valid? RE: T10 usually rejects Version fields; witness the response to 07-403r0. Another question. If I could enumerate more information from the device, what would be the preferred way to detect a SAS-1.1 vs SAS-2 device from the application layer? Would the "Version Descriptors" in the Inquiry page be the recommended method? Thinking out loud, should SAS-2 introduce a new "cleaner" sub-page instead of expanding the current page? I am not a big fan of variable sized arrays nested within other variable sized arrays. RE: The page needs to report a variable number of events (vendor-specific) for a variable number of phys (fixed by the hardware design) configured as a variable number of ports (determined by what the phys happen to be attached to); I don't think any other solution is going to be much cleaner. The event information could be given its own subpage, leaving the old page alone, but log page subpages didn't even exist in SPC-4 until June 2006; the event descriptors were added to SAS-2 in January 2006. ------- Mike Berhan busTRACE Technologies 9700 Village Center Drive Suite 50-F Granite Bay, CA 95746 916.773.4554 phone 916.218.6283 fax http://www.bustrace.com