Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SLI-4 APIs
FC/FCoE SLI-4

FC/FCoE SLI-4

The FC/FCoE SLI-4 component implements the commands and processing defined by the SLI-4 Architecture Specification and the SLI-4 FC and FCoE Command Reference through a lightly-abstracted API. The primary objective of this component is to provide a mechanism to access the Emulex SLI-4 hardware without enforcing a specific policy. For example, this API provides a mechanism to unregister an RPI (sli_cmd_unreg_rpi()), but does not provide details on when to invoke this function.

All meaningful communication between the driver and hardware occurs via queues. To issue commands and work requests to the hardware, the driver writes work queue entries (WQEs). Conversely, to get information about asynchronous events (for example, link events or previously submitted commands), the driver reads queue entries created by the hardware. The SLI component defines a set of common queue operations used to interact with the hardware, simplifying some of the underlying interface complexities. You can use the queue API to perform the following operations:
  • Allocating a queue type with the given number of entries. Since most queues are closely coupled to an associated queue (for example, a completion queue is tied to an event queue), this interface allows specifying the associated queue.
  • Freeing a previously allocated queue.
  • Determining if the next queue entry is valid (that is, the hardware has written a new entry).
  • Reading the next valid entry from the queue to a supplied buffer.
  • Writing an entry from a supplied buffer to the next available queue location.
The SLI-4 documentation defines registers that are predominantly used in conjunction with the previously mentioned queue operations. One exception to this characterization of SLI-4 registers is the bootstrap mailbox register (bmbx). The bootstrap mailbox register allows the driver to send commands before any of the other queues exist. Similar to the standard queue operations, the SLI component encapsulates the standard mechanism used to communicate via the bootstrap mailbox.

The OneCore Storage driver writes two types of queue entries: commands and I/O work requests. In both cases, the SLI-4 component provides helper functions to correctly format these queue entries.

The basic format of the command helper functions includes:
  • A name corresponding to the SLI-4 documentation. For example, the helper function for the INIT_LINK command is sli_cmd_init_link().
  • A buffer to hold the formatted queue entry.
  • The size of the allocated buffer.
  • Parameter options, where appropriate. For example, the INIT_VPI command requires values for the VPI and VFI. Therefore, the sli_cmd_init_vpi() function provides two additional parameters to supply the VPI and VFI values.
The basic format of the I/O work request helper functions follow a similar format, and includes:
  • A name corresponding to the SLI-4 documentation. For example, the helper function to create an ELS_REQUEST64_WQE is sli_els_request64_wqe().
  • A buffer to hold the formatted queue entry.
  • The size of the allocated buffer.
  • Parameterized command options where appropriate. For example, the ELS_REQUEST64_WQE work request requires values for the XRI and request tag. Therefore, the sli_els_request64_wqe() function has additional parameters for the XRI and tag.
Once formatted with a helper function, the queue entry can be passed to sli_queue_write() to post it to the hardware.

Note: The formatted command buffers may also be passed to the hardware through the bootstrap mailbox interface (sli_bmbx_command()).

The SLI-4 component provides assistance in decoding entries created by the hardware and read by the driver. In some cases, a SLI-4 function receives the raw buffer as input, and then returns more relevant values. For example, the sli_cq_parse() function receives the completion queue entry as input, and then returns the completion type and queue ID. In other cases, the parsing function decodes the queue entry, and then returns the results through registered callback functions. For example, the sli_cqe_async() helper function decodes asynchronous events, such as FC link events and FCoE FIP events. The drivers can register callback functions for each of these events using the SLI component.

In contrast to SLI-2 and SLI-3 drivers, SLI-4 drivers play a greater role in the allocation and assignment of hardware resources (for example, XRI, RPI, and VPI). However, the inner workings of these resources differ between different hardware. The SLI-4 component encapsulates these differences and presents a common interface to upper layers. The API presents a simple allocate or free interface.

The SLI-4 covers a range of hardware, each with different capabilities. The SLI component API provides functions to manage these differences. These functions allow drivers to query hardware capabilities (for example, the maximum SGL length), as well as configure capabilities (for example, setting the FC topology to private loop).