CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
adapter_efa_tx.c File Reference

This file contains definitions and functions for the EFA Tx adapter. More...

#include "adapter_efa.h"
#include "adapter_efa_probe_rx.h"
#include "adapter_efa_probe_tx.h"
#include "endpoint_manager.h"
#include "internal_tx.h"
#include "private.h"
#include "cdi_os_api.h"

Functions

static CdiReturnStatus PostTxData (EfaEndpointState *endpoint_state_ptr, const struct iovec *msg_iov_ptr, int iov_count, const void *context_ptr, bool flush_packets)
 
static bool GetCompletions (LibfabricApi *libfabric_api_ptr, struct fid_cq *completion_queue_ptr, struct fi_cq_data_entry *comp_array, int *packet_ack_count_ptr)
 
static bool Poll (EfaEndpointState *efa_endpoint_ptr)
 
CdiReturnStatus EfaTxEndpointOpen (EfaEndpointState *endpoint_state_ptr, const char *remote_address_str, int dest_port)
 
CdiReturnStatus EfaTxEndpointPoll (EfaEndpointState *endpoint_state_ptr)
 
CdiReturnStatus EfaTxEndpointReset (EfaEndpointState *endpoint_state_ptr)
 
CdiReturnStatus EfaTxEndpointClose (EfaEndpointState *endpoint_state_ptr)
 
EndpointTransmitQueueLevel EfaGetTransmitQueueLevel (const AdapterEndpointHandle handle)
 
CdiReturnStatus EfaTxEndpointSend (const AdapterEndpointHandle handle, const Packet *packet_ptr, bool flush_packets)
 
CdiReturnStatus EfaTxEndpointStart (EfaEndpointState *endpoint_state_ptr)
 
void EfaTxEndpointStop (EfaEndpointState *endpoint_state_ptr)
 

Detailed Description

This file contains definitions and functions for the EFA Tx adapter.

Function Documentation

◆ EfaGetTransmitQueueLevel()

EndpointTransmitQueueLevel EfaGetTransmitQueueLevel ( const AdapterEndpointHandle handle)

◆ EfaTxEndpointClose()

CdiReturnStatus EfaTxEndpointClose ( EfaEndpointState * endpoint_ptr)

◆ EfaTxEndpointOpen()

CdiReturnStatus EfaTxEndpointOpen ( EfaEndpointState * endpoint_ptr,
const char * remote_address_str,
int dest_port )

◆ EfaTxEndpointPoll()

CdiReturnStatus EfaTxEndpointPoll ( EfaEndpointState * endpoint_ptr)

◆ EfaTxEndpointReset()

CdiReturnStatus EfaTxEndpointReset ( EfaEndpointState * endpoint_ptr)

◆ EfaTxEndpointSend()

CdiReturnStatus EfaTxEndpointSend ( const AdapterEndpointHandle handle,
const Packet * packet_ptr,
bool flush_packets )

◆ EfaTxEndpointStart()

CdiReturnStatus EfaTxEndpointStart ( EfaEndpointState * endpoint_ptr)

◆ EfaTxEndpointStop()

void EfaTxEndpointStop ( EfaEndpointState * endpoint_ptr)

◆ GetCompletions()

static bool GetCompletions ( LibfabricApi * libfabric_api_ptr,
struct fid_cq * completion_queue_ptr,
struct fi_cq_data_entry * comp_array,
int * packet_ack_count_ptr )
static

Poll libfabric for completion queue events.

Parameters
libfabric_api_ptrPointer to libfabric V-table API.
completion_queue_ptrPointer to libfabric completion queue to poll.
comp_arrayPointer to an array of completion queue data entries which will be filled in for any completion or error events read for the endpoint.
packet_ack_count_ptrPointer to the number of elements in ret_packet_ack_state_ptr_array on input; on output, the location is updated with the number of events that were read into the array. This may be zero up to the original value passed in or exactly one if an error event was read.
Returns
true if zero or more completion events were read, false if an error event was read.

◆ Poll()

static bool Poll ( EfaEndpointState * efa_endpoint_ptr)
static

Used to poll for any pending Tx completion events and process them.

Parameters
efa_endpoint_ptrPointer to EFA endpoint state data.
Returns
true if useful work was done, false if the function did nothing productive.

◆ PostTxData()

static CdiReturnStatus PostTxData ( EfaEndpointState * endpoint_state_ptr,
const struct iovec * msg_iov_ptr,
int iov_count,
const void * context_ptr,
bool flush_packets )
static

This function sends the packet using the libfabric fi_sendmsg function.

Parameters
endpoint_state_ptrPointer to EFA endpoint state structure.
msg_iov_ptrPointer to vector structure containing the message to be sent.
iov_countA count value to identify which msg_iov_ptr.
context_ptrA pointer to a data structure holding packet context information.
flush_packetsTrue to flush any cached Tx packets, otherwise cache them as libfabric allows.
Returns
If kCdiStatusOk, no error. If kCdiStatusRetry, then need to check completions and then retry. Otherwise an error has occurred.