FD.io VPP
v19.08.3-2-gbabecb413
Vector Packet Processing
|
Go to the source code of this file.
svm_fifo_t* fifo_segment_alloc_fifo | ( | fifo_segment_t * | fs, |
u32 | data_bytes, | ||
fifo_segment_ftype_t | ftype | ||
) |
Allocate fifo in fifo segment.
fs | fifo segment for fifo |
data_bytes | size of default fifo chunk in bytes |
ftype | fifo type fifo_segment_ftype_t |
Definition at line 380 of file fifo_segment.c.
int fifo_segment_attach | ( | fifo_segment_main_t * | sm, |
fifo_segment_create_args_t * | a | ||
) |
Attach as slave to a fifo segment.
Definition at line 99 of file fifo_segment.c.
int fifo_segment_collect_fifo_chunks | ( | fifo_segment_t * | fs, |
svm_fifo_t * | f | ||
) |
Collect unused chunks for fifo.
fs | fifo segment for fifo |
f | fifo whose chunks are to be collected |
Definition at line 694 of file fifo_segment.c.
int fifo_segment_create | ( | fifo_segment_main_t * | sm, |
fifo_segment_create_args_t * | a | ||
) |
Create a fifo segment and initialize as master.
Definition at line 65 of file fifo_segment.c.
void fifo_segment_delete | ( | fifo_segment_main_t * | sm, |
fifo_segment_t * | s | ||
) |
u32 fifo_segment_fl_chunk_bytes | ( | fifo_segment_t * | fs | ) |
Number of bytes on chunk free lists.
fs | fifo segment |
Definition at line 809 of file fifo_segment.c.
u32 fifo_segment_free_bytes | ( | fifo_segment_t * | fs | ) |
Fifo segment estimate of number of free bytes.
Returns fifo segment's internal estimate of the number of free bytes. To force a synchronization between the segment and the underlying memory allocator, call fifo_segment_update_free_bytes
fs | fifo segment |
Definition at line 803 of file fifo_segment.c.
void fifo_segment_free_fifo | ( | fifo_segment_t * | fs, |
svm_fifo_t * | f | ||
) |
Free fifo allocated in fifo segment.
fs | fifo segment for fifo |
f | fifo to be freed |
Definition at line 435 of file fifo_segment.c.
svm_fifo_t* fifo_segment_get_fifo_list | ( | fifo_segment_t * | fs | ) |
fifo_segment_t* fifo_segment_get_segment | ( | fifo_segment_main_t * | sm, |
u32 | segment_index | ||
) |
Definition at line 149 of file fifo_segment.c.
int fifo_segment_grow_fifo | ( | fifo_segment_t * | fs, |
svm_fifo_t * | f, | ||
u32 | chunk_size | ||
) |
Grow fifo size by adding an additional chunk of memory.
fs | fifo segment for fifo |
f | fifo to be grown |
chunk_size | number of bytes to be added to fifo |
Definition at line 645 of file fifo_segment.c.
u8 fifo_segment_has_fifos | ( | fifo_segment_t * | fs | ) |
u32 fifo_segment_index | ( | fifo_segment_main_t * | sm, |
fifo_segment_t * | s | ||
) |
Definition at line 137 of file fifo_segment.c.
void fifo_segment_info | ( | fifo_segment_t * | seg, |
char ** | address, | ||
size_t * | size | ||
) |
int fifo_segment_init | ( | fifo_segment_t * | fs | ) |
Initialize fifo segment shared header.
Definition at line 41 of file fifo_segment.c.
void fifo_segment_main_init | ( | fifo_segment_main_t * | sm, |
u64 | baseva, | ||
u32 | timeout_in_seconds | ||
) |
u32 fifo_segment_num_fifos | ( | fifo_segment_t * | fs | ) |
Get number of active fifos.
Definition at line 726 of file fifo_segment.c.
u32 fifo_segment_num_free_chunks | ( | fifo_segment_t * | fs, |
u32 | size | ||
) |
Find number of free chunks of given size.
fs | fifo segment |
size | chunk size of interest or ~0 if all should be counted |
Definition at line 751 of file fifo_segment.c.
u32 fifo_segment_num_free_fifos | ( | fifo_segment_t * | fs | ) |
int fifo_segment_prealloc_fifo_chunks | ( | fifo_segment_t * | fs, |
u32 | chunk_size, | ||
u32 | batch_size | ||
) |
Try to preallocate fifo chunks on segment.
Tries to preallocate chunks of requested size on segment and adds them to chunk freelist.
fs | fifo segment |
chunk_size | size of chunks to be allocated in bytes |
batch_size | number of chunks to be allocated |
Definition at line 542 of file fifo_segment.c.
int fifo_segment_prealloc_fifo_hdrs | ( | fifo_segment_t * | fs, |
u32 | batch_size | ||
) |
Try to preallocate fifo headers.
Tries to preallocate fifo headers and adds them to freelist.
fs | fifo segment |
batch_size | number of chunks to be allocated |
Definition at line 505 of file fifo_segment.c.
void fifo_segment_preallocate_fifo_pairs | ( | fifo_segment_t * | fs, |
u32 | rx_fifo_size, | ||
u32 | tx_fifo_size, | ||
u32 * | n_fifo_pairs | ||
) |
Pre-allocates fifo pairs in fifo segment.
The number of fifos pre-allocated is the minimum of the requested number of pairs and the maximum number that fit within the segment. If the maximum is hit, the number of fifo pairs requested is updated by subtracting the number of fifos that have been successfully allocated.
fs | fifo segment for fifo |
rx_fifo_size | data size of rx fifos |
tx_fifo_size | data size of tx fifos |
n_fifo_pairs | number of pairs requested. Prior to returning, this is decremented by the the number of pairs allocated. |
Definition at line 594 of file fifo_segment.c.
void fifo_segment_update_free_bytes | ( | fifo_segment_t * | fs | ) |
Update fifo segment free bytes estimate.
Forces fifo segment free bytes estimate synchronization with underlying memory allocator.
fs | fifo segment |
Definition at line 797 of file fifo_segment.c.
Segment format function.
Definition at line 848 of file fifo_segment.c.
Definition at line 827 of file fifo_segment.c.
|
inlinestatic |
|
static |
Fifo segment free space.
Queries the underlying memory manager, dlmalloc, for free space. Since this ends up walking the internal data structures, it should not be called indiscriminately.
fs | fifo segment |
Definition at line 29 of file fifo_segment.c.
Definition at line 170 of file fifo_segment.c.
Definition at line 176 of file fifo_segment.c.
|
static |
Try to allocate new fifo.
Tries the following steps in order:
Definition at line 331 of file fifo_segment.c.
|
static |
Definition at line 275 of file fifo_segment.c.
|
static |
Definition at line 193 of file fifo_segment.c.
|
static |
Definition at line 219 of file fifo_segment.c.
void* svm_fifo_segment_heap | ( | fifo_segment_t * | seg | ) |