FC/FCoE Transport
The FC/FCoE transport consists of the SCSI API, domain/port/node state machines, and unsolicited frame handler components. At the highest level, the transport serves two functions:
-
Handles the logic to manage port and process logins with remote ports (nodes), as well as remote target node discovery.
-
Provides an abstracted SCSI interface to a back-end target and/or initiator. This allows access to the functionality of the HAL while using a transport agnostic API.
The transport also performs the following:
-
Handles domain event callback notifications from the HAL.
-
Instantiates remote nodes in an FC arbitrated loop (FC-AL) topology.
-
Performs fabric login and directory services registration, and registration of SLI port with HAL.
-
Performs N_PORT to N_PORT (point to point) initialization.
-
Performs remote port discovery using directory services.
-
Performs port and process logins (PLOGI/PRLI) with remote target nodes.
-
Processes remote port ELS.
-
Exports target and initiator functions through the SCSI API.
SCSI API
To enable the development of a SCSI initiator or target at a higher level than the SLI-4 and HAL, entry points have been defined and implemented in an API that uses SCSI semantics and concepts. For details on the SCSI API, see chapter 4, SCSI API, in the
OneCore Storage Reference Driver Manual.
Domain/SLI Port/Node State Machines
The domain/SLI port/node state machines implement the functions required to establish and maintain port and process logins with remote nodes. Each node object has its own fully independent state machine instance.There are several node types that are created during the port/node state machine operation:
-
Fabric/domain node used to establish fabric logins in a switched fabric topology and during the initial steps of point to point login
-
Name services node used to communicate with the director services node
-
Fabric control node used to register for state change notifications (SCR/RSCN)
-
Remote SCSI initiator nodes
-
Remote SCSI target nodes
The port/node state machine consists of several "sub" state machines:
-
__ocs_fabric – the fabric login state machine
-
__ocs_ns – the name/directory services state machine
-
__ocs_p2p – the point to point protocol state machine
-
__ocs_d – the remote initiator/target device state machine
-
__ocs_fabctl – the fabric control node state machine
The general flow of a node in any of the state machines is as follows:
- The node is created and has transitioned to an initial state, depending on the type of node.
- Events are posted to the node state machine instance.
- ELS/BLS/FCP/TMF unsolicited frame received
- ELS/BLS/FCP/TMF response received
- HAL domain/remote node events received
- HAL send I/O completion events received
- Node shutdown
- The back-end components are notified of creation and deletion of nodes through the Domain portion of the SCSI API.
Unsolicited Frame Handler
The unsolicited frame handler provides the interface to the transport from the HAL's unsolicited FC frame events. These include:
-
ELS/BLS frames
-
FCP command frames
-
FCP TMF frames
On receipt of an unsolicited frame, the S_ID in the FC header is used to find a corresponding node object instance. If a node does not exist for the S_ID, a node object is allocated. An event applicable to the frame type is posted to the node objects state machine. In general, the unsolicited frame handler rarely makes any function or protocol decisions, but merely dispatches events to the node state machines.