FD.io VPP
v20.09-64-g4f7b92f0a
Vector Packet Processing
|
Go to the source code of this file.
CLIB_MARCH_FN | ( | svm_fifo_copy_to_chunk | , |
void | , | ||
svm_fifo_t * | f, | ||
svm_fifo_chunk_t * | c, | ||
u32 | tail_idx, | ||
const u8 * | src, | ||
u32 | len, | ||
svm_fifo_chunk_t ** | last | ||
) |
CLIB_MARCH_FN | ( | svm_fifo_copy_from_chunk | , |
void | , | ||
svm_fifo_t * | f, | ||
svm_fifo_chunk_t * | c, | ||
u32 | head_idx, | ||
u8 * | dst, | ||
u32 | len, | ||
svm_fifo_chunk_t ** | last | ||
) |
|
static |
Definition at line 578 of file svm_fifo.c.
Definition at line 540 of file svm_fifo.c.
|
static |
Definition at line 729 of file svm_fifo.c.
|
static |
Definition at line 695 of file svm_fifo.c.
|
static |
Definition at line 800 of file svm_fifo.c.
|
inlinestatic |
Definition at line 957 of file svm_fifo.c.
|
static |
Definition at line 646 of file svm_fifo.c.
|
static |
Definition at line 597 of file svm_fifo.c.
Definition at line 1466 of file svm_fifo.c.
Definition at line 1485 of file svm_fifo.c.
|
static |
Add segment to fifo's out-of-order segment list.
Takes care of merging adjacent segments and removing overlapping ones.
Definition at line 178 of file svm_fifo.c.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
inlinestatic |
|
inlinestatic |
|
static |
Removes segments that can now be enqueued because the fifo's tail has advanced.
Returns the number of bytes added to tail.
Definition at line 308 of file svm_fifo.c.
void svm_fifo_add_subscriber | ( | svm_fifo_t * | f, |
u8 | sub | ||
) |
Add io events subscriber to list.
f | fifo |
sub | subscriber opaque index (typically app worker index) |
Definition at line 1241 of file svm_fifo.c.
svm_fifo_t* svm_fifo_alloc | ( | u32 | data_size_in_bytes | ) |
Creates a fifo in the current heap.
Create fifo of requested size.
Fails vs blow up the process
Definition at line 421 of file svm_fifo.c.
svm_fifo_chunk_t* svm_fifo_chunk_alloc | ( | u32 | size | ) |
Creates a fifo chunk in the current heap.
Allocate a fifo chunk on heap.
Definition at line 457 of file svm_fifo.c.
void svm_fifo_clone | ( | svm_fifo_t * | df, |
svm_fifo_t * | sf | ||
) |
Clones fifo.
Clone fifo.
Assumptions:
Definition at line 1195 of file svm_fifo.c.
|
inlinestatic |
Definition at line 99 of file svm_fifo.c.
|
inlinestatic |
Definition at line 91 of file svm_fifo.c.
void svm_fifo_del_subscriber | ( | svm_fifo_t * | f, |
u8 | subscriber | ||
) |
Remove io events subscriber form list.
f | fifo |
sub | subscriber index to be removed |
Definition at line 1249 of file svm_fifo.c.
int svm_fifo_dequeue | ( | svm_fifo_t * | f, |
u32 | len, | ||
u8 * | dst | ||
) |
Dequeue data from fifo.
Data is dequeued to consumer provided buffer and head is atomically updated. This should not be used in combination with ooo lookups. If ooo peeking of data is needed in combination with dequeuing use svm_fifo_dequeue_drop.
f | fifo |
len | length of data to dequeue |
dst | buffer to where to dequeue the data |
Definition at line 1009 of file svm_fifo.c.
int svm_fifo_dequeue_drop | ( | svm_fifo_t * | f, |
u32 | len | ||
) |
Dequeue and drop bytes from fifo.
Advances fifo head by requested amount of bytes.
f | fifo |
len | number of bytes to drop |
Definition at line 1068 of file svm_fifo.c.
void svm_fifo_dequeue_drop_all | ( | svm_fifo_t * | f | ) |
Drop all data from fifo.
Dequeue and drop all bytes from fifo.
Definition at line 1106 of file svm_fifo.c.
u8* svm_fifo_dump_trace | ( | u8 * | s, |
svm_fifo_t * | f | ||
) |
Definition at line 1383 of file svm_fifo.c.
int svm_fifo_enqueue | ( | svm_fifo_t * | f, |
u32 | len, | ||
const u8 * | src | ||
) |
Enqueue data to fifo.
Data is enqueued and tail pointer is updated atomically. If the new data enqueued partly overlaps or "touches" an out-of-order segment, said segment is "consumed" and the number of bytes returned is appropriately updated.
f | fifo |
len | length of data to copy |
src | buffer from where to copy the data |
Definition at line 838 of file svm_fifo.c.
void svm_fifo_enqueue_nocopy | ( | svm_fifo_t * | f, |
u32 | len | ||
) |
Advance tail.
Advance tail pointer.
Definition at line 933 of file svm_fifo.c.
int svm_fifo_enqueue_with_offset | ( | svm_fifo_t * | f, |
u32 | offset, | ||
u32 | len, | ||
u8 * | src | ||
) |
Enqueue a future segment.
Enqueue data to fifo with offset.
Two choices: either copies the entire segment, or copies nothing Returns 0 of the entire segment was copied Returns -1 if none of the segment was copied due to lack of space
Definition at line 896 of file svm_fifo.c.
int svm_fifo_fill_chunk_list | ( | svm_fifo_t * | f | ) |
Ensure the whole fifo size is writeable.
Allocates enough chunks to cover the whole fifo size.
f | fifo |
Definition at line 1126 of file svm_fifo.c.
|
static |
Find chunk for given byte position.
f | fifo |
pos | normalized position in fifo |
Definition at line 483 of file svm_fifo.c.
|
static |
Definition at line 495 of file svm_fifo.c.
ooo_segment_t* svm_fifo_first_ooo_segment | ( | svm_fifo_t * | f | ) |
First out-of-order segment for fifo.
f | fifo |
Definition at line 1216 of file svm_fifo.c.
void svm_fifo_free | ( | svm_fifo_t * | f | ) |
Free fifo and associated state.
f | fifo |
Definition at line 760 of file svm_fifo.c.
void svm_fifo_free_chunk_lookup | ( | svm_fifo_t * | f | ) |
Cleanup fifo chunk lookup rb tree.
The rb tree is allocated in segment heap so this should be called with it pushed.
f | fifo to cleanup |
Definition at line 753 of file svm_fifo.c.
void svm_fifo_free_ooo_data | ( | svm_fifo_t * | f | ) |
Cleanup fifo ooo data.
The ooo data is allocated in producer process memory. The fifo segment heap should not be pushed.
f | fifo to cleanup |
Definition at line 113 of file svm_fifo.c.
void svm_fifo_init | ( | svm_fifo_t * | f, |
u32 | size | ||
) |
Initialize fifo.
f | fifo |
size | size for fifo |
Definition at line 370 of file svm_fifo.c.
void svm_fifo_init_ooo_lookup | ( | svm_fifo_t * | f, |
u8 | ooo_type | ||
) |
Initialize rbtrees used for ooo lookups.
f | fifo |
ooo_type | type of ooo operation (0 enqueue, 1 dequeue) |
Definition at line 403 of file svm_fifo.c.
void svm_fifo_init_pointers | ( | svm_fifo_t * | f, |
u32 | head, | ||
u32 | tail | ||
) |
Set fifo pointers to requested offset.
Init fifo head and tail.
Definition at line 1225 of file svm_fifo.c.
u8 svm_fifo_is_sane | ( | svm_fifo_t * | f | ) |
Check if fifo is sane.
Debug only.
f | fifo |
Definition at line 1264 of file svm_fifo.c.
u32 svm_fifo_max_read_chunk | ( | svm_fifo_t * | f | ) |
Max contiguous chunk of data that can be read.
Should only be called by consumers.
Definition at line 509 of file svm_fifo.c.
u32 svm_fifo_max_write_chunk | ( | svm_fifo_t * | f | ) |
Max contiguous chunk of data that can be written.
Should only be called by producers
Definition at line 529 of file svm_fifo.c.
u32 svm_fifo_n_chunks | ( | svm_fifo_t * | f | ) |
Number of chunks linked into the fifo.
f | fifo |
Definition at line 1357 of file svm_fifo.c.
u32 svm_fifo_n_ooo_segments | ( | svm_fifo_t * | f | ) |
Number of out-of-order segments for fifo.
f | fifo |
Definition at line 1210 of file svm_fifo.c.
void svm_fifo_overwrite_head | ( | svm_fifo_t * | f, |
u8 * | src, | ||
u32 | len | ||
) |
Overwrite fifo head with new data.
This should be typically used by dgram transport protocols that need to update the dgram header after dequeuing a chunk of data. It assumes that the dgram header is at most spread over two chunks.
f | fifo |
src | src of new data |
len | length of new data |
Definition at line 773 of file svm_fifo.c.
int svm_fifo_peek | ( | svm_fifo_t * | f, |
u32 | offset, | ||
u32 | len, | ||
u8 * | dst | ||
) |
Peek data from fifo.
Data is copied from requested offset into provided dst buffer. Head is not updated.
f | fifo |
offset | offset from which to copy the data |
len | length of data to copy |
dst | buffer to where to dequeue the data |
Definition at line 1044 of file svm_fifo.c.
u8* svm_fifo_replay | ( | u8 * | s, |
svm_fifo_t * | f, | ||
u8 | no_read, | ||
u8 | verbose | ||
) |
Definition at line 1407 of file svm_fifo.c.
int svm_fifo_segments | ( | svm_fifo_t * | f, |
svm_fifo_seg_t * | fs | ||
) |
Definition at line 1142 of file svm_fifo.c.
void svm_fifo_segments_free | ( | svm_fifo_t * | f, |
svm_fifo_seg_t * | fs | ||
) |