CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
This file contains definitions and functions for the EFA adapter. More...
#include "adapter_efa.h"
#include <inttypes.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <dlfcn.h>
#include "adapter_efa_probe_control.h"
#include "internal.h"
#include "internal_log.h"
#include "internal_tx.h"
#include "internal_utility.h"
#include "libfabric_api.h"
#include "private.h"
#include "cdi_os_api.h"
Data Structures | |
struct | EfaAdapterState |
Structure used to hold EFA adapter state data. More... | |
Macros | |
#define | MAX_TCP_PACKET_SIZE (9001 - 20 - 20) |
Calculate the maximum TCP payload size by starting with the jumbo frame size supported by AWS networks and subtracting space for the IP and TCP headers. The space for the Ethernet headers has already been subtracted since the true jumbo frame size supported is 9023. Reference: https://aws.amazon.com/about-aws/whats-new/2018/10/aws-direct-connect-now-supports-jumbo-frames-for-amazon-virtual-private-cloud-traffic/ https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/network_mtu.html. | |
#define | MAX_INT_STRING_LENGTH (32) |
Maximum string length of an integer value. | |
#define | DEFAULT_MSG_PREFIX_SIZE (0) |
Variable for testing parts of the code dealing with libfabric's message prefix mode. The default should be zero. But even with prefix mode turned off and the default set to non-zero, all tests should pass. This may help in determining whether an issue with message prefix mode is likely caused by a bug in the SDK or a bug in libfabric. | |
#define | CHECK_LIBFABRIC_RC(function, ret) |
Produce a log message when a libfabric call unexpectedly failed. | |
#define | FI_OPT_EFA_RNR_RETRY -(0xefa << 16) |
The define below is from libfabric_new/prov/psm3/inc/rdma/fi_ext.h. | |
Functions | |
static CdiReturnStatus | EfaConnectionCreate (AdapterConnectionHandle handle, int port_number, const char *bind_ip_addr_str) |
Forward declaration of function. | |
static CdiReturnStatus | EfaConnectionDestroy (AdapterConnectionHandle handle) |
Forward declaration of function. | |
static CdiReturnStatus | EfaEndpointOpen (AdapterEndpointHandle endpoint_handle, const char *remote_address_str, int port_number, const char *bind_ip_addr_str) |
Forward declaration of function. | |
static CdiReturnStatus | EfaEndpointPoll (AdapterEndpointHandle handle) |
Forward declaration of function. | |
static CdiReturnStatus | EfaEndpointReset (AdapterEndpointHandle handle) |
Forward declaration of function. | |
static CdiReturnStatus | EfaEndpointStart (AdapterEndpointHandle handle) |
Forward declaration of function. | |
static CdiReturnStatus | EfaEndpointClose (AdapterEndpointHandle handle) |
Forward declaration of function. | |
static CdiReturnStatus | EfaAdapterShutdown (CdiAdapterHandle adapter) |
Forward declaration of function. | |
static CdiReturnStatus | LibFabricEndpointClose (EfaEndpointState *endpoint_ptr) |
Forward declaration. | |
static CdiReturnStatus | SetMaximumEfaPayloadSize (struct fi_info *fi_ptr, EfaEndpointState *endpoint_ptr) |
static struct fi_info * | CreateHints (LibfabricApi *libfabric_api_ptr, bool is_socket_based) |
static void | LibfabricVersionSet (EfaEndpointState *endpoint_ptr, LibfabricApi *libfabric_api_ptr) |
Set libfabric API version for an endpoint. | |
static CdiReturnStatus | LibFabricEndpointOpen (EfaEndpointState *endpoint_ptr) |
static CdiReturnStatus | EfaAdapterEndpointStop (EfaEndpointState *endpoint_ptr, bool reopen) |
static CdiReturnStatus | EnvironmentVariableSet (const char *name_str, int value) |
CdiReturnStatus | EfaNetworkAdapterInitialize (CdiAdapterState *adapter_state_ptr, bool is_socket_based) |
CdiReturnStatus | EfaAdapterProbeEndpointCreate (EfaEndpointState *endpoint_ptr, ProbeEndpointHandle *ret_probe_handle) |
CdiReturnStatus | EfaAdapterEndpointStart (EfaEndpointState *endpoint_ptr) |
CdiAdapterHandle | EfaAdapterGetAdapterControlInterface (AdapterConnectionState *adapter_con_state_ptr) |
bool | EfaAdapterEndpointProtocolVersionSet (EfaEndpointState *endpoint_ptr, const CdiProtocolVersionNumber *remote_version_ptr) |
Set the protocol version for the specified endpoint. The protocol version actually used is negotiated using the specified remote version and the current version of the CDI-SDK. | |
Variables | |
static struct AdapterVirtualFunctionPtrTable | efa_endpoint_functions |
Define the virtual table API interface for this adapter. | |
This file contains definitions and functions for the EFA adapter.
#define CHECK_LIBFABRIC_RC | ( | function, | |
ret ) |
Produce a log message when a libfabric call unexpectedly failed.
|
static |
Allocate memory for a libfabric hints structure, initialize it for the EFA adapter and return a pointer to the next structure.
libfabric_api_ptr | Pointer to libfabric V-table API. |
is_socket_based | Specifies whether the adapter is socket-based (true) or EFA-based (false). |
bool EfaAdapterEndpointProtocolVersionSet | ( | EfaEndpointState * | endpoint_ptr, |
const CdiProtocolVersionNumber * | remote_version_ptr ) |
Set the protocol version for the specified endpoint. The protocol version actually used is negotiated using the specified remote version and the current version of the CDI-SDK.
endpoint_ptr | Pointer to endpoint. |
remote_version_ptr | Pointer to remote protocol version data. |
CdiReturnStatus EfaAdapterEndpointStart | ( | EfaEndpointState * | endpoint_ptr | ) |
Start the specified endpoint. This only allocates and starts low-level libfabric and EFA device driver resources. Other resources have already been created and started when the connection was created.
endpoint_ptr | Pointer to the EFA endpoint to start. |
|
static |
Stop the specified endpoint. This only stops and frees low-level libfabric and EFA device driver resources. Other resources that were created when the connection was created are not affected.
endpoint_ptr | Pointer to the adapter endpoint to stop. |
reopen | If true re-opens the libfabric endpoint, otherwise does not re-open it. |
CdiAdapterHandle EfaAdapterGetAdapterControlInterface | ( | AdapterConnectionState * | adapter_con_state_ptr | ) |
Get handle of adapter control inteface related to the specified EFA endpoint.
adapter_con_state_ptr | Pointer to adapter connection state data. |
CdiReturnStatus EfaAdapterProbeEndpointCreate | ( | EfaEndpointState * | endpoint_ptr, |
ProbeEndpointHandle * | ret_probe_handle ) |
Create probe for the specified EFA endpoint.
endpoint_ptr | Pointer to the adapter endpoint to create a probe for. |
ret_probe_handle | Pointer to returned probe handle. |
|
static |
Forward declaration of function.
Shutdown the selected adapter instance.
adapter_handle | Handle of adapter to shutdown. |
|
static |
Forward declaration of function.
Create an EFA connection using the specified adapter.
handle | Handle of adapter connection to open. |
port_number | Control interface port to use for the connection. |
bind_ip_addr_str | Pointer to string IP address to bind to. |
|
static |
Forward declaration of function.
Destroy an EFA connection to the specified adapter connection.
handle | Handle of adapter connection to close. |
|
static |
Forward declaration of function.
Close an EFA connection to the specified adapter endpoint.
endpoint_handle | Handle of adapter endpoint to close. |
|
static |
Forward declaration of function.
Open a EFA connection to the specified adapter endpoint.
endpoint_handle | Handle of adapter endpoint to open. |
remote_address_str | Pointer to remote address string. |
port_number | Port number for endpoint. |
bind_ip_addr_str | Pointer to bind address string. |
|
static |
Forward declaration of function.
Used to poll pending EFA events and process them.
endpoint_handle | Pointer endpoint state data. |
|
static |
Forward declaration of function.
Reset an EFA connection for the specified adapter endpoint.
endpoint_handle | Handle of adapter endpoint to reset. |
|
static |
Forward declaration of function.
Start an EFA connection for the specified adapter endpoint.
endpoint_handle | Handle of adapter endpoint to start. |
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). |
|
static |
Set an environment variable.
name_str | Pointer to name of variable to set. |
value | Integer value to set. |
|
static |
Forward declaration.
Close a libfabric connection to the specified endpoint.
endpoint_ptr | Pointer to EFA endpoint to close. |
|
static |
Open a libfabric connection to the specified endpoint.
endpoint_ptr | Pointer to EFA endpoint to open. |
|
static |
Set libfabric API version for an endpoint.
endpoint_ptr | Pointer to EFA endpoint to set version of libfabric. |
libfabric_api_ptr | Pointer to libfabric API version to set. |
|
static |
Determine maximum payload size that fits in a single link-level packet. Set both the adapter's maximum_payload_bytes and msg_prefix_size.
fi_ptr | Pointer to name of variable to set. |
endpoint_ptr | Pointer to the EFA endpoint state to be configured. |
|
static |
Define the virtual table API interface for this adapter.