CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
The declarations in this header file correspond to the definitions in adapter.c. More...
Go to the source code of this file.
Data Structures | |
struct | Packet |
struct | AdapterEndpointState |
Structure used to hold adapter endpoint state. More... | |
struct | RxAdapterConnectionState |
This defines a structure that contains the state information for an rx adapter connection. More... | |
struct | AdapterDataConnectionState |
This defines a structure that contains the state information for a data adapter connection (type is kEndpointTypeData). This adapter type is used to transmit all data that is not part of a control interface. More... | |
struct | AdapterControlConnectionState |
This defines a structure that contains the state information for a control interface adapter connection (type is kEndpointTypeControl). More... | |
struct | PollThreadState |
This defines a structure that contains the state information for a single instance of a poll thread. More... | |
struct | ThreadUtilizationState |
Type used to hold thread utilization state data. More... | |
struct | AdapterConnectionState |
Structure used to hold adapter connection state. More... | |
struct | AdapterVirtualFunctionPtrTable |
Structure definition used to define the virtual table API interface for adapters. More... | |
struct | CdiAdapterState |
Structure definition behind the handles shared with the user's application program. Its contents are opaque to the user's program where it only has a pointer to a declared but not defined structure. More... | |
struct | CdiAdapterConnectionConfigData |
Structure definition used to configure an adapter endpoint. More... | |
struct | CdiAdapterEndpointConfigData |
Structure definition used to configure an adapter endpoint. More... | |
Typedefs | |
typedef struct ControlInterfaceState * | ControlInterfaceHandle |
Forward reference. | |
typedef void(* | MessageFromEndpoint) (void *param_ptr, Packet *packet_ptr, EndpointMessageType message_type) |
Prototype of function used to process packet messages from the endpoint. | |
typedef struct AdapterEndpointState * | AdapterEndpointHandle |
Forward declaration to create pointer to adapter endpoint state when used. | |
typedef struct AdapterConnectionState * | AdapterConnectionHandle |
Forward declaration to create pointer to adapter connection state when used. | |
Enumerations | |
enum | AdapterPacketAckStatus { kAdapterPacketStatusOk , kAdapterPacketStatusFailed , kAdapterPacketStatusNotConnected } |
Values used for adapter packet acknowledgment status. More... | |
enum | EndpointDirection { kEndpointDirectionSend , kEndpointDirectionReceive , kEndpointDirectionBidirectional } |
The direction of packets that an endpoint will be used for. More... | |
enum | EndpointDataType { kEndpointTypeData , kEndpointTypeControl } |
The type of transmission data that an endpoint will be used for. More... | |
enum | EndpointTransmitQueueLevel { kEndpointTransmitQueueEmpty , kEndpointTransmitQueueIntermediate , kEndpointTransmitQueueFull , kEndpointTransmitQueueNa } |
enum | EndpointMessageType { kEndpointMessageTypePacketSent , kEndpointMessageTypePacketReceived } |
enum | PollState { kPollStart , kPollRunning , kPollStopping , kPollStopped } |
Values used to determine current running state of a poll thread. More... | |
The declarations in this header file correspond to the definitions in adapter.c.
typedef void(* MessageFromEndpoint) (void *param_ptr, Packet *packet_ptr, EndpointMessageType message_type) |
Prototype of function used to process packet messages from the endpoint.
param_ptr | A pointer to data used by the function. |
packet_ptr | A pointer to packet state data. |
message_type | Endpoint message type. |
Values used for adapter packet acknowledgment status.
enum EndpointDataType |
enum EndpointDirection |
The direction of packets that an endpoint will be used for.
enum EndpointMessageType |
Enumeration of possible values used to specify the type of message generated from an endpoint using the MessageFromEndpoint callback function.
Enumerator | |
---|---|
kEndpointMessageTypePacketSent | Packet was sent. |
kEndpointMessageTypePacketReceived | Packet was received. |
Enumeration of possible values that can be returned from the EfaGetTransmitQueueLevel() adapter API function.
enum PollState |
CdiReturnStatus CdiAdapterCloseEndpoint | ( | AdapterEndpointHandle | handle | ) |
Close an endpoint and free its resources.
handle | The handle of the endpoint which is to be closed. |
CdiReturnStatus CdiAdapterCreateConnection | ( | CdiAdapterConnectionConfigData * | config_data_ptr, |
AdapterConnectionHandle * | return_handle_ptr ) |
Create an adapter connection. An endpoint is a one-way communications channel on which packets can be sent to or received from a remote host whose address and port number are specified here.
NOTE: This API only creates resources used by the endpoint. The CdiAdapterStartEndpoint() function must be used to start it.
config_data_ptr | Pointer to adapter endpoint config data. |
return_handle_ptr | The address of a location to have the newly opened endpoint's handle written. |
CdiReturnStatus CdiAdapterDestroyConnection | ( | AdapterConnectionHandle | handle | ) |
Destroy a connnection closing related open endpoints, freeing their resources.
handle | The handle of the connection which is to be closed. |
CdiReturnStatus CdiAdapterEnqueueSendPacket | ( | const AdapterEndpointHandle | handle, |
const struct sockaddr_in * | destination_address_ptr, | ||
Packet * | packet_ptr ) |
Add a single packet to the send packet queue. The packet will be sent to the remote host for the specified endpoint. Only valid for endpoints that were open for sending. NOTE: This function is called by the main payload thread TxPayloadThread() as well as by EFA probe control. MEMORY NOTE: The Packet structure is not copied, it is merely referenced. Its storage must come from a pool.
handle | The handle of the endpoint through which to send the packet. |
destination_address_ptr | Pointer to destination address data (sockaddr_in). |
packet_ptr | The address of the packet to enqueue for sending to the connected endpoint. |
CdiReturnStatus CdiAdapterEnqueueSendPackets | ( | const AdapterEndpointHandle | handle, |
const CdiSinglyLinkedList * | packet_list_ptr ) |
Add a list of packets to the send packet queue. The packets will be sent to the remote host for the specified endpoint. Only valid for endpoints that were open for sending. NOTE: This function is called by the main payload thread TxPayloadThread() as well as by EFA probe control. MEMORY NOTE: While the packet_list_ptr's contents are copied, the Packet structures referenced by it are not copied. Their storage must come from a pool.
handle | The handle of the endpoint through which to send the packet. |
packet_list_ptr | The address of the list of packets to enqueue for sending to the connected endpoint. |
CdiReturnStatus CdiAdapterFreeBuffer | ( | const AdapterEndpointHandle | handle, |
const CdiSgList * | sgl_ptr ) |
Free a buffer that was provided by the endpoint in a received packet through the queue function. The resources returned to the endpoint include the SGList structure, all of the SGL entries in the list, and the memory buffers addressed by the entries.
handle | The handle of the endpoint from which the packet was received. |
sgl_ptr | The SGL describing the resources to be returned to the endpoint. |
CdiReturnStatus CdiAdapterGetPort | ( | const AdapterEndpointHandle | handle, |
int * | port_number_ptr ) |
Gets the number of the port to which the specified endpoint is using.
handle | The handle of the endpoint to get the port number from. |
port_number_ptr | Address of where the port number will be written. |
EndpointTransmitQueueLevel CdiAdapterGetTransmitQueueLevel | ( | AdapterEndpointHandle | handle | ) |
Checks transmitter queue level. A polled mode endpoint will return kEndpointTransmitBufferFull when its transmit queue is full while awaiting acknowledgements. Non-polled endpoints always return kEndpointTransmitBufferNa.
handle | The handle of the endpoint for which to check its transmit queue level. |
CdiReturnStatus CdiAdapterOpenEndpoint | ( | CdiAdapterEndpointConfigData * | config_data_ptr, |
AdapterEndpointHandle * | return_handle_ptr ) |
Opens an endpoint for the specified connection. An endpoint is a one-way communications channel on which packets can be sent to or received from a remote host whose address and port number are specified here.
NOTE: This function only creates resources used by the endpoint. The CdiAdapterStartEndpoint() function must be used to start it.
config_data_ptr | Pointer to adapter endpoint config data. |
return_handle_ptr | The address of a location to have the newly opened endpoint's handle written. |
CdiReturnStatus CdiAdapterPollEndpoint | ( | AdapterEndpointHandle | handle | ) |
While a connection is open, this API function must be called on a regular basis to perform poll mode processing without having to create additional adapter worker threads.
handle | The handle of the endpoint to poll. |
void CdiAdapterPollThreadFlushResources | ( | AdapterEndpointHandle | handle | ) |
Flush resources associate with PollThread(). NOTE: This function should only be called after the thread has been paused using EndpointManagerThreadWait().
handle | The handle of the endpoint to flush resources. |
CdiReturnStatus CdiAdapterResetEndpoint | ( | AdapterEndpointHandle | handle | ) |
Reset an endpoint and free its resources.
handle | The handle of the endpoint to reset. |
CdiReturnStatus CdiAdapterShutdown | ( | CdiAdapterHandle | adapter | ) |
Shut down the adapter and free all of the resources associated with it. The caller must not use the adapter's handle for any purpose after this function returns.
adapter | A handle to the adapter to close. |
CdiReturnStatus CdiAdapterStartEndpoint | ( | AdapterEndpointHandle | handle | ) |
Starts an endpoint for the specified connection.
handle | The handle of the endpoint to started. |
CdiReturnStatus CdiAdapterStopConnection | ( | AdapterConnectionHandle | handle | ) |
Stop a connection, shutting down thread resources.
handle | The handle of the connection which is to be stopped. |
void CdiAdapterTxPacketComplete | ( | AdapterEndpointHandle | handle, |
const Packet * | packet_ptr ) |
Tx packet has ACKed.
handle | The handle of the endpoint that a Tx packet is related to. |
packet_ptr | Pointer to packet. |
CdiReturnStatus EfaNetworkAdapterInitialize | ( | CdiAdapterState * | adapter_state_ptr, |
bool | is_socket_based ) |
Initializes an EFA adapter specified by the values in the provided CdiAdapterState structure.
adapter_state_ptr | The address of the generic adapter state preinitialized with the generic values including the CdiAdapterData structure which contains the values provided to the SDK by the user program. |
is_socket_based | Specifies whether the adapter is socket-based (true) or EFA-based (false). |
CdiReturnStatus SocketNetworkAdapterInitialize | ( | CdiAdapterState * | adapter_state_ptr | ) |
Initializes socket based adapter specified by the values in the provided CdiAdapterState structure.
adapter_state_ptr | The address of the generic adapter state preinitialized with the generic values including the CdiAdapterData structure which contains the values provided to the SDK by the user program. |