CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
This file contains the definitions of the functions that comprise the CDI Core SDK's API. More...
This file contains the definitions of the functions that comprise the CDI Core SDK's API.
CdiReturnStatus CdiCoreConnectionDestroy | ( | CdiConnectionHandle | handle | ) |
Destroy a specific TX or RX connection and free resources that were created for it.
handle | Connection handle returned by Cdi...TxCreate() API functions. |
int CdiCoreGather | ( | const CdiSgList * | sgl_ptr, |
int | offset, | ||
void * | dest_data_ptr, | ||
int | byte_count ) |
Gather received data represented by a scatter-gather list into a contiguous buffer. The caller is responsible for ensuring that the destination buffer is large enough to hold the data.
A subset of the entire payload of the SGL can be extracted by using a non-zero value for offset and/or a smaller number for byte_count than sgl->total_data_size. The number of bytes copied is the smaller of (sgl->total_data_size - offset) or byte_count.
sgl_ptr | The scatter-gather list containing the data to be gathered. |
offset | Number of bytes to skip in SGL before starting the copy. |
dest_data_ptr | Where to write the gathered data in linear format. |
byte_count | The number of bytes to copy. |
CdiPtpTimestamp CdiCoreGetPtpTimestamp | ( | CdiPtpTimestamp * | ret_ptp_time_ptr | ) |
Get the current TAI time as a PTP timestamp.
There seems to be no trivial solutions for automatically getting the current leap second adjustment. All leap second adjustments occur on either December 31st or June 30th. The next possible leap second introduction is June 30th 2021. This function applies a fixed 37 second adjustment to UTC time to get TAI time.
ret_ptp_time_ptr | Pointer to CdiPtpTimestamp to return the current PtpTimestamp to. This may be NULL. |
const CdiCoreReadOnlySettings * CdiCoreGetSettings | ( | ) |
Returns the core configuration read-only settings.
uint64_t CdiCoreGetTaiTimeMicroseconds | ( | ) |
Get the current TAI time in microseconds.
void CdiCoreGetUtcTime | ( | struct timespec * | ret_time_ptr | ) |
Get the current synced AWS network UTC time in a timespec structure. This function will be kept up to date with the best practices for getting high accuracy time from Amazon Time Sync Service as improved accuracy time is available. All EC2 instances that call this function should be using the Amazon Time Sync Service. Amazon Time Sync Service setup directions for Linux can be found at: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html#configure-amazon-time-service. For Windows follow the directions at: https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/windows-set-time.html
ret_time_ptr | Address where to write the UTC timestamp in a timespec structure as defined by time.h. |
uint64_t CdiCoreGetUtcTimeMicroseconds | ( | void | ) |
Get the current synced AWS network UTC time in microseconds. It uses CdiCoreGetUtcTime().
CdiReturnStatus CdiCoreInitialize | ( | const CdiCoreConfigData * | core_config_ptr | ) |
Initialize the SDK. Must be called once before using any other SDK APIs. When done, must call CdiCoreShutdown() once.
NOTE: Newly created data structures that are passed in to this function should be properly initialized before being programmed with user values. Use memset or a zero structure initializer (= {0}) to set the whole structure to zero before setting the desired members to the actual values required.
core_config_ptr | Pointer to core configuration data that is used to initialize the SDK. Value is required and cannot be NULL. Copies of the data in the configuration data structure are made as needed. A local variable can be used for composing the structure since its contents are not needed after this function returns. |
CdiReturnStatus CdiCoreNetworkAdapterDestroy | ( | CdiAdapterHandle | handle | ) |
Free resources associated with the specified network adapter that was previously created using CdiCoreNetworkAdapterInitialize(). NOTE: Before calling this function, all connections that use the adapter should be closed using CdiCoreConnectionDestroy().
handle | Handle of network adapter to destroy. |
CdiReturnStatus CdiCoreNetworkAdapterInitialize | ( | CdiAdapterData * | adapter_data_ptr, |
CdiAdapterHandle * | ret_handle_ptr ) |
Create an instance of a network adapter. CdiCoreNetworkAdapterDestroy() must be called before CdiCoreShutdown() but after all connections using the adapter are closed using CdiCoreConnectionDestroy().
NOTE: Currently if the shared memory provider is enabled in the EFA Adapter (see FI_EFA_ENABLE_SHM_TRANSFER in CDI), libfabric uses fork() to determine capability (see rxr_check_cma_capability() in the EFA provider). This causes a double flush of cached write data of any open files. By default, the shared memory provider is disabled. If enabled, all open files must have used fflush() prior to using this API function. The CDI SDK always flushes all open log files that were created using the CDI logger API functions.
NOTE: Newly created data structures that are passed in to this function should be properly initialized before being programmed with user values. Use memset or a zero structure initializer (= {0}) to set the whole structure to zero before setting the desired members to the actual values required.
adapter_data_ptr | Pointer to network adapter configuration data. Copies of the data in the configuration data structure are made as needed. A local variable can be used for composing the structure since its contents are not needed after this function returns. |
ret_handle_ptr | Pointer to returned instance handle (used as parameter for other API functions). |
CdiReturnStatus CdiCoreRxFreeBuffer | ( | const CdiSgList * | sgl_ptr | ) |
Free the receive buffer that was used in one of the Cdi...RxCallback() API functions.
sgl_ptr | The scatter-gather list containing the memory to be freed. |
CdiReturnStatus CdiCoreShutdown | ( | void | ) |
Application is shutting down. Stop open connections and free-up all resources being used by the SDK.
CdiReturnStatus CdiCoreStatsReconfigure | ( | CdiConnectionHandle | handle, |
const CdiStatsConfigData * | config_ptr ) |
Configure transfer statistics.
handle | Connection handle returned by Cdi...TxCreate() API functions. |
config_ptr | Pointer to statistics configuration data. Copies of the data in the configuration data structure are made as needed. A local variable can be used for composing the structure since its contents are not needed after this function returns. |
const char * CdiCoreStatusToString | ( | CdiReturnStatus | status | ) |
Returns a short string that briefly describes the meaning of an CDI status code.
status | The value to be converted to a string. |