From sacadmin Mon Mar 10 13:32:23 2008
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 m2AKWNbt017872;
	Mon, 10 Mar 2008 13:32:23 -0700 (PDT)
Received: (from markcarl@localhost)
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit) id m2AKWNab017868;
	Mon, 10 Mar 2008 13:32:23 -0700 (PDT)
Date: Mon, 10 Mar 2008 13:32:23 -0700 (PDT)
From: Mark Carlson <markcarl@sac.sfbay.sun.com>
Message-Id: <200803102032.m2AKWNab017868@sac.sfbay.sun.com>
To: PSARC-record@sac.sfbay.sun.com
Cc: Hyon.Kim@sun.com
Subject: fcinfo(1M) support on a target mode port [PSARC/2008/187 FastTrack timeout 03/17/2008]
Status: RO
Content-Length: 571


Template Version: @(#)sac_nextcase 1.64 07/13/07 SMI
This information is Copyright 2008 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 fcinfo(1M) support on a target mode port
    1.2. Name of Document Author/Supplier:
	 Author:  Hyon Kim
    1.3  Date of This Document:
	10 March, 2008
4. Technical Description
    See the case directory for more detail

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		NWS
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open


From Mark.Carlson@sun.com Mon Mar 10 13:42:58 2008
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m2AKgwah018321
	for <psarc-ext@sac.sfbay.sun.com>; Mon, 10 Mar 2008 13:42:58 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m2AKgvKm052859
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Mon, 10 Mar 2008 14:42:58 -0600 (MDT)
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 <0JXJ00D0387LG500@nwk-avmta-1.sfbay.Sun.COM> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Mon, 10 Mar 2008 13:42:57 -0700 (PDT)
Received: from brmea-mail-2.sun.com ([192.18.98.43])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JXJ00BE687LO340@nwk-avmta-1.sfbay.Sun.COM> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Mon,
 10 Mar 2008 13:42:57 -0700 (PDT)
Received: from fe-amer-09.sun.com ([192.18.109.79])
	by brmea-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m2AKgv0j025473	for
 <psarc-ext@sun.com>; Mon, 10 Mar 2008 20:42:57 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0JXJ00J018343G00@mail-amer.sun.com>
 (original mail from Mark.Carlson@Sun.COM)
 for psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Mon,
 10 Mar 2008 14:42:57 -0600 (MDT)
Received: from Macintosh-39.local ([71.237.94.98])
 by mail-amer.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28
 2007)) with ESMTPSA id <0JXJ00GZA87JK390@mail-amer.sun.com> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Mon,
 10 Mar 2008 14:42:56 -0600 (MDT)
Date: Mon, 10 Mar 2008 14:42:55 -0600
From: "Mark A. Carlson" <Mark.Carlson@sun.com>
Subject: fcinfo(1M) support on a target mode port [PSARC/2008/187 FastTrack
 timeout 03/17/2008]
Sender: Mark.Carlson@sun.com
To: PSARC-EXT <psarc-ext@sun.com>
Cc: Hyon Kim <Hyon.Kim@sun.com>
Message-id: <47D59D4F.4010207@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213)
Status: RO
Content-Length: 11030

I am sponsoring this case for Hyon Kim. This case makes a minor
change to fcinfo for target mode FC ports. Materials are in the
case directory.

-- mark


                 fcinfo(1M) support on a target mode port

Currently fcinfo(1M) shows FC port info on a host through FC-HBA APIs.
Sun VSL(libsun_fc.so) for FC-HBA Sun VSL is based on the fp(7d) transport
driver so won't discover target mode FC port which is associated with
COMSTAR(PSARC/2007/523) project.  This fasttrack is to enable fcinfo(1M)
to discover the target mode FC port in addition to the current initiator 
mode
FC port.  Sun private extensions to libHBAAPI.so are made to allow the 
target
mode FC-HBA port discovery in addition to the existing intiator FC-HBA port
support.  The oprations related to port attributes and remote port discovery
are supported through the same existing interfaces.

1. fcinfo change

   The 'fcinfo hba-port' command displays locally discovered FC 
initiator mode
   ports.  New options, -i and -t, are introduced to return initiator mode
   ports and target mode ports respectively.  The default behavior of the
   'fcinfo hba-port' is to display both the initiator mode and the 
target mode
   ports. If there is no target mode port configured on the host, it will
   display only the initiator mode port so no change to the existing
   initiator only configuration.  A new field, Port Mode, is added to
   the hba-port output to indicate the mode of a port.

   The 'fcinfo remote-port' on the target mode port works in the
   same way it works on the initiator port.  A new field, Port
   Symbolic Name, is added to the output to show alias name
   for logged-in initiators in addition to the FC WWN information.
    
   Following example outputs show related changes.

# fcinfo hba-port -t
HBA Port WWN: 210000e08b909221
        Port Mode: Target
        Port ID: 10900
        OS Device Name: Not Applicable
        Manufacturer: QLogic Corp.
        Model: c50f5be0
        Firmware Version: 4.3.0
        FCode/BIOS Version: N/A
        Type: F-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 200000e08b909221
HBA Port WWN: 210100e08bb09221
        Port Mode: Target
        Port ID: 10700
        OS Device Name: Not Applicable
        Manufacturer: QLogic Corp.
        Model: c50f57e0
        Firmware Version: 4.3.0
        FCode/BIOS Version: N/A
        Type: F-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 200100e08bb09221
   
   
   The following example shows two initiator and two target mode ports
   are discovered through -i and -t option.

# fcinfo hba-port -it
HBA Port WWN: 210000e08b1e5d01
        Port Mode: Initiator
        OS Device Name: /dev/cfg/c1
        Manufacturer: QLogic Corp.
        Model: 375-3108-xx
        Firmware Version: 3.3.26
        FCode/BIOS Version:  fcode: 1.13;
        Type: N-port
        State: online
        Supported Speeds: 1Gb 2Gb
        Current Speed: 2Gb
        Node WWN: 200000e08b1e5d01
HBA Port WWN: 210100e08b3e5d01
        Port Mode: Initiator
        OS Device Name: /dev/cfg/c2
        Manufacturer: QLogic Corp.
        Model: 375-3108-xx
        Firmware Version: 3.3.26
        FCode/BIOS Version:  fcode: 1.13;
        Type: N-port
        State: online
        Supported Speeds: 1Gb 2Gb
        Current Speed: 2Gb
        Node WWN: 200100e08b3e5d01
HBA Port WWN: 210000e08b909221
        Port Mode: Target
        Port ID: 10900
        OS Device Name: Not Applicable
        Manufacturer: QLogic Corp.
        Model: c50f5be0
        Firmware Version: 4.3.0
        FCode/BIOS Version: N/A
        Type: F-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 200000e08b909221
HBA Port WWN: 210100e08bb09221
        Port Mode: Target
        Port ID: 10700
        OS Device Name: Not Applicable
        Manufacturer: QLogic Corp.
        Model: c50f57e0
        Firmware Version: 4.3.0
        FCode/BIOS Version: N/A
        Type: F-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 200100e08bb09221

   
   The -l option for link status works on the target mode port
   in the same way it works on the initiator mode hba port.

# fcinfo hba-port -lt
HBA Port WWN: 210000e08b909221
        Port Mode: Target
        Port ID: 10900
        OS Device Name: Not Applicable
        Manufacturer: QLogic Corp.
        Model: c50f5be0
        Firmware Version: 4.3.0
        FCode/BIOS Version: N/A
        Type: F-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 200000e08b909221
        Link Error Statistics:
                Link Failure Count: 1
                Loss of Sync Count: 0
                Loss of Signal Count: 0
                Primitive Seq Protocol Error Count: 0
                Invalid Tx Word Count: 0
                Invalid CRC Count: 0
HBA Port WWN: 210100e08bb09221
        Port Mode: Target
        Port ID: 10700
        OS Device Name: Not Applicable
        Manufacturer: QLogic Corp.
        Model: c50f57e0
        Firmware Version: 4.3.0
        FCode/BIOS Version: N/A
        Type: F-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 200100e08bb09221
        Link Error Statistics:
                Link Failure Count: 1
                Loss of Sync Count: 0
                Loss of Signal Count: 0
                Primitive Seq Protocol Error Count: 0
                Invalid Tx Word Count: 0
                Invalid CRC Count: 0

   An example for remote-port discovery on a target mode port.
    
# fcinfo remote-port -p 210100e08bb09221
Remote Port WWN: 210100e08b296a60
        Active FC4 Types: SCSI,IP
        SCSI Target: unknown
        Port Symbolic Name: host-sys1:/pci@8,700000/SUNW,qlc@5,1/fp@0,0
        Node WWN: 200100e08b296a60
Remote Port WWN: 210000e08b072ab5
        Active FC4 Types: SCSI,IP
        SCSI Target: unknown
        Port Symbolic Name: host-sys2:/pci@8,700000/SUNW,qlc@4/fp@0,0
        Node WWN: 200000e08b072ab5

   The -s for SCSI info on a remote port is not relevant for the
   target mode so it won't be supported.

# fcinfo remote-port -p 210100e08bb09221 -s
Error: Unsupported option for target mode: s.
 

2. Sun extensions of FC-HBA common library

    The following interfaces will be added to the libHBAAPI.so for FC target
    mode port support.

    HBA_UINT32 Sun_HBA_GetNumberOfTgtAdapters():
        returns number of target mode port

    HBA_STATUS Sun_HBA_GetTgtAdapterName(HBA_UINT32, char*)
        returns the name of a target mode adapter.

    HBA_HANDLE Sun_HBA_OpenTgtAdapter(char*):
        returns the handle for the given target mode adapter name.

    HBA_STATUS Sun_HBA_OpenTgtAdapterByWWN(HBA_HANDLE *handle, HBA_WWN wwn):
        returns the handle for the given WWN if there is a match.

    Note that they are corresponding to the initiator mode support APIs,
    HBA_GetNumberOfAdapters(), HBA_GetAdapterName(), HBA_OpenAdapter()
    and HBA_OpenAdapterByWWN().

  2.1  Supported existing HBA and HBA Port related interfaces

    Using the function categories defined in
    FC-HBA standard(T11 SM-HBA-2 Section 8)  the following list show
    supported APIs on the target mode port.

    2.1.1 HBA and FC_Port Information Functions

    HBA_CloseAdapter()
    HBAGetAdapterAttributes()
    - HBA_ADAPTERATTRIBUTES
    - Manufacturer
    - SerialNumber
    - Model
    - ModelDescription
    - NodeWWN
    - NodeSymbolicName
    - HardwareVersion
    - DriverVersion
    - OptionROMVersion
    - FirmwareVersion
    - VendorSpecificID
    - NumberOfPorts
    - DriverName
    HBAGetAdapterPortAttributes()
    - HBA_PORTATTRIBUTES
    - NodeWWN
    - PortWWN
    - PortFcId
    - PortType
    - PortState
    - PortSupportedClassofService
    - PortSupportedFc4Types
    - PortActiveFc4Types
    - PortSymbolicName
    - OSDeviceName    
    - PortSupportedSpeed
    - PortSpeed    
    - PortMaxFrameSize
    - FabricName
    - NumberofDiscoveredPorts

    Note that the OSDeviceName field from AdapterPortAttributes will be 
set to
    "Not Applicable" since COMSTAR FC port provider is not port based bound.

    HBAGetDiscoveredPortAttributes()
     : same as HBAGetAdpaterPortAttributes
    HBAGetPortAttributesByWWN()
     : same as HBAGetAdpaterAttributes
    HBA_GetPortStatistics()

    2.1.2 Fabric Management Functions

    HBA_SendRLS()

    2.1.2 Event Handling Functions

    HBA_RegisterForAdapterEvents()
    HBA_RegisterForAdapterPortEvents()
    HBA_RegisterForAdapterAddEvents()
    HBA_RegisterForAdapterPortStatEvents()
    HBA_RegisterForTargetEvents()
    HBA_RegisterForLinkEvents()
    HBA_RemoveCallback()

    Note that FCP/SCSI information functions are not applicable to the 
remote
    initiator port.

  2.2 Sun HBA API Vendor Specific Library(VSL)

    The existing libsun_fc.so will provide the target mode support mentioned
    above through the fct driver which is developed as COMSTAR port 
provider.

3. Interface Table

   
___________________________________________________________________________
   | Interface                     | Classification   | 
Comments             |
   
|_______________________________|__________________|______________________|
   | fcinfo(1M) hba-port           |                  
|                      |
   |            --Initiator(-i)    | Committed        | Option for 
displaying|
   |                               |                  | initiator mode 
ports.|
   |            --Target(-t)       | Committed        | Option for 
displaying|
   |                               |                  | target mode 
ports.   |
   
|_______________________________|__________________|______________________|
   | Sun_HBA_GetNumberOfTgtAdapters| Private          | Getting number 
of    |
   |                               |                  | target mode 
ports.   |
   | Sun_HBA_GetTgtAdapterName     | Private          | Getting adapter 
name |
   |                               |                  | of target mode 
ports.|
   | Sun_HBA_OpenTgtAdapter        | Private          | Getting handle 
of    |
   |                               |                  | a target mode 
port.  |
   | Sun_HBA_OpenTgtAdapterByWWN   | Private          | Getting handle 
of    |
   |                               |                  | target mode 
ports for|
   |                               |                  | a given 
WWN.         |
   
|_______________________________|__________________|______________________|

4. Reference

   PSARC 2007/523 COMSTAR: Common Multiprotocol SCSI Target
   PSARC 2006/230 fcinfo logical-unit subcommand
   PSARC 2004/291 Fibre Channel HBA Port Utility
   SHARC 2004/054 Enhanced support for T11 FC-HBA
   PSARC 2002/644 FibreChannel HBA API V2
   PSARC 2001/481 Sun SNIA HBA API library


From Mark.Carlson@sun.com Thu Mar 13 17:25:13 2008
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m2E0PDEn021163
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 13 Mar 2008 17:25:13 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id m2E0PBUU023167
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Thu, 13 Mar 2008 18:25:12 -0600 (MDT)
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 <0JXP0070J2HZTS00@nwk-avmta-1.sfbay.Sun.COM> for psarc-ext@sun.com
 (ORCPT psarc-ext@Sun.COM); Thu, 13 Mar 2008 17:25:11 -0700 (PDT)
Received: from brmea-mail-3.sun.com ([192.18.98.34])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0JXP00KDK2HY2350@nwk-avmta-1.sfbay.Sun.COM> for
 psarc-ext@sun.com (ORCPT psarc-ext@Sun.COM); Thu,
 13 Mar 2008 17:25:10 -0700 (PDT)
Received: from fe-amer-09.sun.com ([192.18.109.79])
	by brmea-mail-3.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m2E0PAq2024887	for
 <psarc-ext@Sun.COM>; Fri, 14 Mar 2008 00:25:10 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0JXP00J012GHD400@mail-amer.sun.com>
 (original mail from Mark.Carlson@Sun.COM)
 for psarc-ext@Sun.COM (ORCPT psarc-ext@Sun.COM); Thu,
 13 Mar 2008 18:25:10 -0600 (MDT)
Received: from Macintosh-39.local ([71.237.94.98])
 by mail-amer.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28
 2007)) with ESMTPSA id <0JXP003B22HP0QE0@mail-amer.sun.com> for
 psarc-ext@Sun.COM (ORCPT psarc-ext@Sun.COM); Thu,
 13 Mar 2008 18:25:02 -0600 (MDT)
Date: Thu, 13 Mar 2008 18:24:58 -0600
From: "Mark A. Carlson" <Mark.Carlson@sun.com>
Subject: Re: fcinfo(1M) support on a target mode port [PSARC/2008/187 FastTrack
 timeout 03/17/2008]
In-reply-to: <47D59D4F.4010207@sun.com>
Sender: Mark.Carlson@sun.com
To: PSARC-EXT <psarc-ext@sun.com>
Cc: Hyon Kim <Hyon.Kim@sun.com>
Message-id: <47D9C5DA.5060709@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <47D59D4F.4010207@sun.com>
User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213)
Status: RO
Content-Length: 52

This case was approved in PSARC this week.

-- mark

