fcinfo(1M) support on a target mode port [PSARC/2008/187 FastTrack timeout 03/17/2008]
Mark A. Carlson
Mark.Carlson at sun.com
Mon Mar 10 13:42:55 PDT 2008
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 at 8,700000/SUNW,qlc at 5,1/fp at 0,0
Node WWN: 200100e08b296a60
Remote Port WWN: 210000e08b072ab5
Active FC4 Types: SCSI,IP
SCSI Target: unknown
Port Symbolic Name: host-sys2:/pci at 8,700000/SUNW,qlc at 4/fp at 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
More information about the opensolaris-arc
mailing list