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 Home Page

Theory of Operation

The Rx Reorder sublock receives an SgList. In each SgList is a pointer to a linked list of SglEntry(s).
The first SglEntry has a CDI Header that contains the sequence number of this SgList.

While most lists will arrive in order, they may also arrive in a random order. This is the nature of the
transfer from the Tx to the Rx through the network.

This module will take these out of order SgLists and put them in order. It does so by maintaining a doubly-linked
list of type RxReorderList. When an entire payload of data has been received, there should be only one
RxReorderList present, which represents the entire payload. If there are more than one RxReorderLists present,
then this means that some out of order list(s) have been received that are not properly attached.

The figure below shows an SgList received by this module.

SgList

The next figure shows an Rx Reorder List. These are the lists that are created and stored when an out of order
list is received. They contain an SgList (with the CDI Header removed), a next pointer, a previous pointer, and a top
and bottom sequence number. These two numbers represent the top of and bottom of this list, respectively.

RxReorderList

Example reorder sequence

What follows is an example sequence that illustrates the creation and attachment of RxReorderLists and SgLists.
When a new SgList is added to an existing RxReorderList.SgList, it will be represented with a yellow background:

New SgList attached to RxReorderList.SgList


When a new RxReorderList is created it will have a pink background:

New RxReorderList

The notation of the RxReorderList is "top-bot". E.g. An RxReorderList having 101 at the top and 230 at the bottom
is designated as 101-230. A list containing only one element would have the number repeated. E.g. An RxReorderList with
only element 7 would be designated 7-7.

Example arrival sequence: 2, 7, 6, 4, 5, 0, 1, 3.

This example payload consists of 8 SgLists.

Sequence 2 arrives and there are no RxReorderLists, so one is created. The SgList sent is added to the SgList in
RxReorderList, and the CDI header is removed.

Sequence 2

Sequence 7 arrives, which is out of order so a new RxReorderList is created for it and that list is attached to the right.

Sequence 7

Sequence 6 arrives, which is belongs at the top of the existing RxReorderList 7-7, so it is placed there.

Sequence 6

Sequence 4 arrives, which does not belong on any existing list, so a new RxReorderList is created for it and that
list is placed between the 2-2 and 6-7 reorder lists.

Sequence 4

Sequence 5 arrives, which belongs at the bottom of the existing RxReorderList 4-4, so it is placed there.
List 6-7 is then attached to the bottom of list 4-5. The memory resource for list 6-7 is then returned to the pool.

Sequence 5

Sequence 0 arrives, which is out of order so a new RxReorderList is created for it and that list is placed to left of list 2-2.

Sequence 0

Sequence 1 arrives, which belongs at the bottom of the existing RxReorderList 0-0, so it is placed there.
List 2-2 is then attached to the bottom of list 0-1. The memory resource for list 2-2 is then returned to the pool.

Sequence 1

Sequence 3 arrives, which belongs at the bottom of the existing list 0-2, so it is placed there.
List 4-7 is then attached to the bottom of list 0-3. The memory resource for list 4-7 is then returned to the pool.

Sequence 3

At this point there is one list (0-7), which represents the entire example payload.