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

This header file contains definitions of types needed for the reordering of packets. More...

#include <stdint.h>
#include "internal.h"

Go to the source code of this file.

Functions

bool RxReorderPacketPayloadStateInit (CdiProtocolHandle protocol_handle, CdiPoolHandle payload_sgl_entry_pool_handle, CdiPoolHandle reorder_entries_pool_handle, RxPayloadState *payload_state_ptr, const CdiSgList *new_sglist_ptr, int initial_offset, int sequence_num)
 Adds initial entry to payload_state_ptr->reorder_list_ptr.
 
bool RxReorderPacket (CdiProtocolHandle protocol_handle, CdiPoolHandle payload_sgl_entry_pool_handle, CdiPoolHandle reorder_entries_pool_handle, RxPayloadState *payload_state_ptr, const CdiSgList *new_sglist_ptr, int initial_offset, int sequence_num)
 Adds an entry to the payload sgl. Also checks for and maintains outstanding packets that are received out of order. If an SGL arrives that is out of order, it will be added to a doubly linked list (reorder list) of outstanding dangling lists.
 
void RxReorderPacketFreeLists (CdiReorderList *reorder_list_ptr, CdiPoolHandle payload_sgl_entry_pool_handle, CdiPoolHandle reorder_entries_pool_handle)
 removes all lists and sgls used in processing the out of order packets
 

Detailed Description

This header file contains definitions of types needed for the reordering of packets.

Function Documentation

◆ RxReorderPacket()

bool RxReorderPacket ( CdiProtocolHandle protocol_handle,
CdiPoolHandle payload_sgl_entry_pool_handle,
CdiPoolHandle reorder_entries_pool_handle,
RxPayloadState * payload_state_ptr,
const CdiSgList * new_sglist_ptr,
int initial_offset,
int sequence_num )

Adds an entry to the payload sgl. Also checks for and maintains outstanding packets that are received out of order. If an SGL arrives that is out of order, it will be added to a doubly linked list (reorder list) of outstanding dangling lists.

Once all of the data for a payload is received, then the entries for payload_state_ptr->reorder_list_ptr->next_ptr and payload_state_ptr->reorder_list_ptr->prev_ptr will be NULL, otherwise there are dangling lists that have not been attached to the single payload list.

Parameters
protocol_handleHandle for protocol being used.
payload_sgl_entry_pool_handleHandle to memory pool of payload SGL entries.
reorder_entries_pool_handleHandle to memory pool of rx_reorder entries.
payload_state_ptrCurrent state of the payload, specifically a single rx_reorder entry.
new_sglist_ptrAn SGL to be added to the end of the payload sgl.
initial_offsetFirst SGL entry will have this offset applied
sequence_numThe sequence number of this SGL list.
Returns
True if successful.

◆ RxReorderPacketFreeLists()

void RxReorderPacketFreeLists ( CdiReorderList * reorder_list_ptr,
CdiPoolHandle payload_sgl_entry_pool_handle,
CdiPoolHandle reorder_entries_pool_handle )

removes all lists and sgls used in processing the out of order packets

Parameters
reorder_list_ptrpointer to a single list entry to start the removal process
payload_sgl_entry_pool_handlehandle to memory pool of sgls
reorder_entries_pool_handlehandle to memory pool of rx reorder lists

◆ RxReorderPacketPayloadStateInit()

bool RxReorderPacketPayloadStateInit ( CdiProtocolHandle protocol_handle,
CdiPoolHandle payload_sgl_entry_pool_handle,
CdiPoolHandle reorder_entries_pool_handle,
RxPayloadState * payload_state_ptr,
const CdiSgList * new_sglist_ptr,
int initial_offset,
int sequence_num )

Adds initial entry to payload_state_ptr->reorder_list_ptr.

Parameters
protocol_handleHandle for protocol being used.
payload_sgl_entry_pool_handleHandle to memory pool of payload SGL entries.
reorder_entries_pool_handleHandle to memory pool of rx_reorder entries.
payload_state_ptrCurrent state of the payload, specifically a single rx_reorder entry.
new_sglist_ptrAn SGL to be added to the end of the payload sgl.
initial_offsetFirst SGL entry will have this offset applied.
sequence_numThe sequence number of this SGL list.
Returns
True if successful.