Class CompletionTable
Defined in File completion_table.hpp
Class Documentation
-
class CompletionTable
The completion table is the class that allows to advance the DMA buffer read pointer as completion objects from zero-copy send operations are returned by the network.
This class is used by felix-tohost in zero-copy sending mode: in this case the read pointer can be advanced only when the network send operation is complete (and not before, to prevent firmware overwriting the outstanding data. For each chunk to be sent the address of address of the first block it belongs to is pushed to the table. If the address already exists the corresponding counter is increased by one. Each completion object reporting the success of the send operation contains the block address. When the completion object is read the correspoding address counter is decreased by one. When the counter goes to zero the address entry is removed. The read pointer returned by the completion table points to the first entry whose counter is not zero. The implementations uses two std::maps to deal with the wrap-around of DMA buffer addresses.
Public Functions
-
CompletionTable()
-
void push(uint32_t addr)
Push a new message address to the completion table.
- Parameters:
addr -- address in DMA buffer of the outstanding network message.
-
int update(uint32_t addr)
Update the completion table as a send completion is processed.
- Parameters:
addr -- address in DMA buffer of the outstanding network message.
- Returns:
error codes defined within the class
-
uint32_t get_rd() const
- Returns:
the DMA read pointer within the completion table.
-
uint32_t get_count(uint32_t addr) const
- Returns:
the counter corresponding to the given address.
-
uint32_t get_previous_rd() const
- Returns:
the DMA read pointer returned in the last call of get_rd()
-
size_t get_entries() const
- Returns:
the number of address
-
void inspect() const
dump the content of the table
-
bool is_empty() const
- Returns:
true if the table is empty
-
CompletionTable()