FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | svm_fifo_seg_ |
Macros | |
#define | OOO_SEGMENT_INVALID_INDEX ((u32)~0) |
#define | SVM_FIFO_INVALID_SESSION_INDEX ((u32)~0) |
#define | SVM_FIFO_INVALID_INDEX ((u32)~0) |
#define | svm_fifo_trace_add(_f, _s, _l, _t) |
Typedefs | |
typedef enum svm_fifo_deq_ntf_ | svm_fifo_deq_ntf_t |
typedef enum svm_fifo_flag_ | svm_fifo_flag_t |
typedef struct svm_fifo_seg_ | svm_fifo_seg_t |
Enumerations | |
enum | svm_fifo_deq_ntf_ { SVM_FIFO_NO_DEQ_NOTIF = 0, SVM_FIFO_WANT_DEQ_NOTIF = 1, SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL = 2, SVM_FIFO_WANT_DEQ_NOTIF_IF_EMPTY = 4 } |
enum | svm_fifo_flag_ { SVM_FIFO_F_LL_TRACKED = 1 << 0 } |
enum | svm_fifo_err_t { SVM_FIFO_EFULL = -2, SVM_FIFO_EEMPTY = -3, SVM_FIFO_EGROW = -4 } |
Functions | |
u8 * | svm_fifo_dump_trace (u8 *s, svm_fifo_t *f) |
u8 * | svm_fifo_replay (u8 *s, svm_fifo_t *f, u8 no_read, u8 verbose) |
static void | f_load_head_tail_cons (svm_fifo_t *f, u32 *head, u32 *tail) |
Load head and tail optimized for consumer. More... | |
static void | f_load_head_tail_prod (svm_fifo_t *f, u32 *head, u32 *tail) |
Load head and tail optimized for producer. More... | |
static void | f_load_head_tail_all_acq (svm_fifo_t *f, u32 *head, u32 *tail) |
Load head and tail independent of producer/consumer role. More... | |
static u32 | f_cursize (svm_fifo_t *f, u32 head, u32 tail) |
Fifo current size, i.e., number of bytes enqueued. More... | |
static u32 | f_free_count (svm_fifo_t *f, u32 head, u32 tail) |
Fifo free bytes, i.e., number of free bytes. More... | |
static u32 | f_chunk_end (svm_fifo_chunk_t *c) |
static int | f_pos_lt (u32 a, u32 b) |
static int | f_pos_leq (u32 a, u32 b) |
static int | f_pos_gt (u32 a, u32 b) |
static int | f_pos_geq (u32 a, u32 b) |
static u8 | f_chunk_includes_pos (svm_fifo_chunk_t *c, u32 pos) |
static svm_fifo_chunk_t * | f_start_cptr (svm_fifo_t *f) |
static svm_fifo_chunk_t * | f_end_cptr (svm_fifo_t *f) |
static svm_fifo_chunk_t * | f_head_cptr (svm_fifo_t *f) |
static svm_fifo_chunk_t * | f_tail_cptr (svm_fifo_t *f) |
static svm_fifo_chunk_t * | f_cptr (svm_fifo_t *f, fs_sptr_t cp) |
static fs_sptr_t | f_csptr (svm_fifo_t *f, svm_fifo_chunk_t *c) |
static void | f_csptr_link (svm_fifo_t *f, fs_sptr_t cp, svm_fifo_chunk_t *c) |
svm_fifo_t * | svm_fifo_alloc (u32 size) |
Create fifo of requested size. More... | |
void | svm_fifo_init (svm_fifo_t *f, u32 size) |
Initialize fifo. More... | |
svm_fifo_chunk_t * | svm_fifo_chunk_alloc (u32 size) |
Allocate a fifo chunk on heap. More... | |
int | svm_fifo_fill_chunk_list (svm_fifo_t *f) |
Ensure the whole fifo size is writeable. More... | |
int | svm_fifo_provision_chunks (svm_fifo_t *f, svm_fifo_seg_t *fs, u32 n_segs, u32 len) |
Provision and return chunks for number of bytes requested. More... | |
void | svm_fifo_init_ooo_lookup (svm_fifo_t *f, u8 ooo_type) |
Initialize rbtrees used for ooo lookups. More... | |
void | svm_fifo_free (svm_fifo_t *f) |
Free fifo and associated state. More... | |
void | svm_fifo_free_chunk_lookup (svm_fifo_t *f) |
Cleanup fifo chunk lookup rb tree. More... | |
void | svm_fifo_free_ooo_data (svm_fifo_t *f) |
Cleanup fifo ooo data. More... | |
void | svm_fifo_init_pointers (svm_fifo_t *f, u32 head, u32 tail) |
Init fifo head and tail. More... | |
void | svm_fifo_clone (svm_fifo_t *df, svm_fifo_t *sf) |
Clone fifo. More... | |
int | svm_fifo_enqueue (svm_fifo_t *f, u32 len, const u8 *src) |
Enqueue data to fifo. More... | |
int | svm_fifo_enqueue_with_offset (svm_fifo_t *f, u32 offset, u32 len, u8 *src) |
Enqueue data to fifo with offset. More... | |
void | svm_fifo_enqueue_nocopy (svm_fifo_t *f, u32 len) |
Advance tail pointer. More... | |
int | svm_fifo_enqueue_segments (svm_fifo_t *f, const svm_fifo_seg_t segs[], u32 n_segs, u8 allow_partial) |
Enqueue array of svm_fifo_seg_t in order. More... | |
void | svm_fifo_overwrite_head (svm_fifo_t *f, u8 *src, u32 len) |
Overwrite fifo head with new data. More... | |
int | svm_fifo_dequeue (svm_fifo_t *f, u32 len, u8 *dst) |
Dequeue data from fifo. More... | |
int | svm_fifo_peek (svm_fifo_t *f, u32 offset, u32 len, u8 *dst) |
Peek data from fifo. More... | |
int | svm_fifo_dequeue_drop (svm_fifo_t *f, u32 len) |
Dequeue and drop bytes from fifo. More... | |
void | svm_fifo_dequeue_drop_all (svm_fifo_t *f) |
Dequeue and drop all bytes from fifo. More... | |
int | svm_fifo_segments (svm_fifo_t *f, u32 offset, svm_fifo_seg_t *fs, u32 n_segs, u32 max_bytes) |
Get pointers to fifo chunks data in svm_fifo_seg_t array. More... | |
void | svm_fifo_add_subscriber (svm_fifo_t *f, u8 sub) |
Add io events subscriber to list. More... | |
void | svm_fifo_del_subscriber (svm_fifo_t *f, u8 subscriber) |
Remove io events subscriber form list. More... | |
u32 | svm_fifo_n_ooo_segments (svm_fifo_t *f) |
Number of out-of-order segments for fifo. More... | |
ooo_segment_t * | svm_fifo_first_ooo_segment (svm_fifo_t *f) |
First out-of-order segment for fifo. More... | |
u8 | svm_fifo_is_sane (svm_fifo_t *f) |
Check if fifo is sane. More... | |
u32 | svm_fifo_n_chunks (svm_fifo_t *f) |
Number of chunks linked into the fifo. More... | |
static u32 | svm_fifo_max_dequeue_cons (svm_fifo_t *f) |
Fifo max bytes to dequeue optimized for consumer. More... | |
static u32 | svm_fifo_max_dequeue_prod (svm_fifo_t *f) |
Fifo max bytes to dequeue optimized for producer. More... | |
static u32 | svm_fifo_max_dequeue (svm_fifo_t *f) |
Fifo max bytes to dequeue. More... | |
static int | svm_fifo_is_full_prod (svm_fifo_t *f) |
Check if fifo is full optimized for producer. More... | |
static int | svm_fifo_is_full (svm_fifo_t *f) |
static int | svm_fifo_is_empty_cons (svm_fifo_t *f) |
Check if fifo is empty optimized for consumer. More... | |
static int | svm_fifo_is_empty_prod (svm_fifo_t *f) |
Check if fifo is empty optimized for producer. More... | |
static int | svm_fifo_is_empty (svm_fifo_t *f) |
Check if fifo is empty. More... | |
static u8 | svm_fifo_is_wrapped (svm_fifo_t *f) |
Check if fifo is wrapped. More... | |
static u32 | svm_fifo_max_enqueue_prod (svm_fifo_t *f) |
Maximum number of bytes that can be enqueued into fifo. More... | |
static u32 | svm_fifo_max_enqueue (svm_fifo_t *f) |
u32 | svm_fifo_max_read_chunk (svm_fifo_t *f) |
Max contiguous chunk of data that can be read. More... | |
u32 | svm_fifo_max_write_chunk (svm_fifo_t *f) |
Max contiguous chunk of data that can be written. More... | |
static svm_fifo_chunk_t * | svm_fifo_head_chunk (svm_fifo_t *f) |
Fifo head chunk getter. More... | |
static u8 * | svm_fifo_head (svm_fifo_t *f) |
Fifo head pointer getter. More... | |
static svm_fifo_chunk_t * | svm_fifo_tail_chunk (svm_fifo_t *f) |
Fifo tail chunk getter. More... | |
static u8 * | svm_fifo_tail (svm_fifo_t *f) |
Fifo tail pointer getter. More... | |
static u8 | svm_fifo_n_subscribers (svm_fifo_t *f) |
Fifo number of subscribers getter. More... | |
static u8 | svm_fifo_has_ooo_data (svm_fifo_t *f) |
Check if fifo has out-of-order data. More... | |
static ooo_segment_t * | svm_fifo_newest_ooo_segment (svm_fifo_t *f) |
static void | svm_fifo_newest_ooo_segment_reset (svm_fifo_t *f) |
static u32 | ooo_segment_offset_prod (svm_fifo_t *f, ooo_segment_t *s) |
static u32 | ooo_segment_length (svm_fifo_t *f, ooo_segment_t *s) |
static u32 | svm_fifo_size (svm_fifo_t *f) |
static void | svm_fifo_set_size (svm_fifo_t *f, u32 size) |
static int | svm_fifo_has_event (svm_fifo_t *f) |
Check if fifo has io event. More... | |
static u8 | svm_fifo_set_event (svm_fifo_t *f) |
Set fifo event flag. More... | |
static void | svm_fifo_unset_event (svm_fifo_t *f) |
Unset fifo event flag. More... | |
static void | svm_fifo_add_want_deq_ntf (svm_fifo_t *f, u8 ntf_type) |
Set specific want notification flag. More... | |
static void | svm_fifo_del_want_deq_ntf (svm_fifo_t *f, u8 ntf_type) |
Clear specific want notification flag. More... | |
static void | svm_fifo_clear_deq_ntf (svm_fifo_t *f) |
Clear the want notification flag and set has notification. More... | |
static void | svm_fifo_reset_has_deq_ntf (svm_fifo_t *f) |
Clear has notification flag. More... | |
static u8 | svm_fifo_needs_deq_ntf (svm_fifo_t *f, u32 n_last_deq) |
Check if fifo needs dequeue notification. More... | |
Variables | |
format_function_t | format_svm_fifo |
#define OOO_SEGMENT_INVALID_INDEX ((u32)~0) |
Definition at line 28 of file svm_fifo.h.
#define SVM_FIFO_INVALID_INDEX ((u32)~0) |
Definition at line 30 of file svm_fifo.h.
#define SVM_FIFO_INVALID_SESSION_INDEX ((u32)~0) |
Definition at line 29 of file svm_fifo.h.
#define svm_fifo_trace_add | ( | _f, | |
_s, | |||
_l, | |||
_t | |||
) |
Definition at line 68 of file svm_fifo.h.
typedef enum svm_fifo_deq_ntf_ svm_fifo_deq_ntf_t |
typedef enum svm_fifo_flag_ svm_fifo_flag_t |
typedef struct svm_fifo_seg_ svm_fifo_seg_t |
enum svm_fifo_deq_ntf_ |
Definition at line 32 of file svm_fifo.h.
enum svm_fifo_err_t |
Enumerator | |
---|---|
SVM_FIFO_EFULL | |
SVM_FIFO_EEMPTY | |
SVM_FIFO_EGROW |
Definition at line 45 of file svm_fifo.h.
enum svm_fifo_flag_ |
Enumerator | |
---|---|
SVM_FIFO_F_LL_TRACKED |
Definition at line 40 of file svm_fifo.h.
|
inlinestatic |
|
inlinestatic |
Definition at line 168 of file svm_fifo.h.
|
inlinestatic |
Definition at line 199 of file svm_fifo.h.
|
inlinestatic |
Definition at line 205 of file svm_fifo.h.
|
inlinestatic |
Definition at line 211 of file svm_fifo.h.
|
inlinestatic |
Fifo current size, i.e., number of bytes enqueued.
Internal function.
Definition at line 121 of file svm_fifo.h.
|
inlinestatic |
Definition at line 181 of file svm_fifo.h.
|
inlinestatic |
Fifo free bytes, i.e., number of free bytes.
Internal function
Definition at line 132 of file svm_fifo.h.
|
inlinestatic |
Definition at line 187 of file svm_fifo.h.
|
inlinestatic |
Load head and tail independent of producer/consumer role.
Internal function.
Definition at line 107 of file svm_fifo.h.
|
inlinestatic |
Load head and tail optimized for consumer.
Internal function.
Definition at line 80 of file svm_fifo.h.
|
inlinestatic |
Load head and tail optimized for producer.
Internal function
Definition at line 93 of file svm_fifo.h.
|
inlinestatic |
Definition at line 175 of file svm_fifo.h.
|
inlinestatic |
Definition at line 193 of file svm_fifo.h.
|
inlinestatic |
|
inlinestatic |
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 1387 of file svm_fifo.c.
|
inlinestatic |
Set specific want notification flag.
For list of flags see svm_fifo_deq_ntf_t
f | fifo |
ntf_type | type of notification requested |
Definition at line 817 of file svm_fifo.h.
svm_fifo_t* svm_fifo_alloc | ( | u32 | data_size_in_bytes | ) |
Create fifo of requested size.
Allocates fifo on current heap.
size | data size in bytes for fifo to be allocated. Will be rounded to the next highest power-of-two value. |
Create fifo of requested size.
Fails vs blow up the process
Definition at line 426 of file svm_fifo.c.
svm_fifo_chunk_t* svm_fifo_chunk_alloc | ( | u32 | size | ) |
Allocate a fifo chunk on heap.
If the chunk is allocated on a fifo segment, this should be called with the segment's heap pushed.
size | chunk size in bytes. Will be rounded to the next highest power-of-two |
Allocate a fifo chunk on heap.
Definition at line 462 of file svm_fifo.c.
|
inlinestatic |
Clear the want notification flag and set has notification.
Should be used after enqueuing an event. This clears the SVM_FIFO_WANT_NOTIF flag but it does not clear SVM_FIFO_WANT_NOTIF_IF_FULL. If the latter was set, has_ntf is set to avoid enqueueing events for for all dequeue operations until it is manually cleared.
f | fifo |
Definition at line 848 of file svm_fifo.h.
void svm_fifo_clone | ( | svm_fifo_t * | df, |
svm_fifo_t * | sf | ||
) |
Clone fifo.
Clones single/default chunk fifo. It does not work for fifos with multiple chunks.
Clone fifo.
Assumptions:
Definition at line 1338 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 1395 of file svm_fifo.c.
|
inlinestatic |
Clear specific want notification flag.
For list of flags see svm_fifo_ntf_t
f | fifo |
ntf_type | type of notification to be cleared |
Definition at line 831 of file svm_fifo.h.
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 1105 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 1168 of file svm_fifo.c.
void svm_fifo_dequeue_drop_all | ( | svm_fifo_t * | f | ) |
Dequeue and drop all bytes from fifo.
Advances head to tail position.
f | fifo |
Dequeue and drop all bytes from fifo.
Definition at line 1207 of file svm_fifo.c.
u8* svm_fifo_dump_trace | ( | u8 * | s, |
svm_fifo_t * | f | ||
) |
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 847 of file svm_fifo.c.
void svm_fifo_enqueue_nocopy | ( | svm_fifo_t * | f, |
u32 | len | ||
) |
Advance tail pointer.
Useful for moving tail pointer after external enqueue.
f | fifo |
len | number of bytes to add to tail |
Advance tail pointer.
Definition at line 946 of file svm_fifo.c.
int svm_fifo_enqueue_segments | ( | svm_fifo_t * | f, |
const svm_fifo_seg_t | segs[], | ||
u32 | n_segs, | ||
u8 | allow_partial | ||
) |
Enqueue array of svm_fifo_seg_t in order.
f | fifo |
segs | array of segments to enqueue |
n_segs | number of segments |
allow_partial | if set partial enqueues are allowed |
Definition at line 972 of file svm_fifo.c.
int svm_fifo_enqueue_with_offset | ( | svm_fifo_t * | f, |
u32 | offset, | ||
u32 | len, | ||
u8 * | src | ||
) |
Enqueue data to fifo with offset.
Data is enqueued without updating tail pointer. Instead, an out-of-order list of segments is generated and maintained. Fifo takes care of coalescing contiguous or overlapping segments.
f | fifo |
offset | offset at which to copy the data |
len | len of data to copy |
src | buffer from where to copy the data |
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 906 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 1228 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 1360 of file svm_fifo.c.
void svm_fifo_free | ( | svm_fifo_t * | f | ) |
Free fifo and associated state.
f | fifo |
Definition at line 768 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 761 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 115 of file svm_fifo.c.
|
inlinestatic |
Check if fifo has io event.
f | fifo |
Definition at line 776 of file svm_fifo.h.
|
inlinestatic |
Check if fifo has out-of-order data.
f | fifo |
Definition at line 718 of file svm_fifo.h.
|
inlinestatic |
Fifo head pointer getter.
f | fifo |
Definition at line 661 of file svm_fifo.h.
|
inlinestatic |
Fifo head chunk getter.
f | fifo |
Definition at line 649 of file svm_fifo.h.
void svm_fifo_init | ( | svm_fifo_t * | f, |
u32 | size | ||
) |
Initialize fifo.
f | fifo |
size | size for fifo |
Definition at line 372 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 408 of file svm_fifo.c.
void svm_fifo_init_pointers | ( | svm_fifo_t * | f, |
u32 | head, | ||
u32 | tail | ||
) |
Init fifo head and tail.
f | fifo |
head | head value that will be matched to a chunk |
tail | tail value that will be matched to a chunk |
Init fifo head and tail.
Definition at line 1369 of file svm_fifo.c.
|
inlinestatic |
Check if fifo is empty.
Note: use producer or consumer specific functions for perfomance. svm_fifo_is_empty_cons (svm_fifo_t * f) svm_fifo_is_empty_prod (svm_fifo_t * f)
Definition at line 579 of file svm_fifo.h.
|
inlinestatic |
Check if fifo is empty optimized for consumer.
f | fifo |
Definition at line 554 of file svm_fifo.h.
|
inlinestatic |
Check if fifo is empty optimized for producer.
f | fifo |
Definition at line 566 of file svm_fifo.h.
|
inlinestatic |
|
inlinestatic |
Check if fifo is full optimized for producer.
f | fifo |
Definition at line 530 of file svm_fifo.h.
u8 svm_fifo_is_sane | ( | svm_fifo_t * | f | ) |
Check if fifo is sane.
Debug only.
f | fifo |
Definition at line 1410 of file svm_fifo.c.
|
inlinestatic |
Check if fifo is wrapped.
f | fifo |
Definition at line 591 of file svm_fifo.h.
|
inlinestatic |
Fifo max bytes to dequeue.
Note: use producer or consumer specific functions for performance: svm_fifo_max_dequeue_cons (svm_fifo_t *f) svm_fifo_max_dequeue_prod (svm_fifo_t *f)
Definition at line 516 of file svm_fifo.h.
|
inlinestatic |
Fifo max bytes to dequeue optimized for consumer.
f | fifo |
Definition at line 487 of file svm_fifo.h.
|
inlinestatic |
Fifo max bytes to dequeue optimized for producer.
f | fifo |
Definition at line 501 of file svm_fifo.h.
|
inlinestatic |
Definition at line 621 of file svm_fifo.h.
|
inlinestatic |
Maximum number of bytes that can be enqueued into fifo.
Optimized for producer
f | fifo |
Definition at line 607 of file svm_fifo.h.
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 514 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 534 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 1505 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 1354 of file svm_fifo.c.
|
inlinestatic |
Fifo number of subscribers getter.
f | fifo |
Definition at line 706 of file svm_fifo.h.
|
inlinestatic |
Check if fifo needs dequeue notification.
Determines based on notification request flags and state of the fifo if an event should be generated.
f | fifo |
n_last_deq | number of bytes last dequeued |
Definition at line 882 of file svm_fifo.h.
|
inlinestatic |
|
inlinestatic |
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 781 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 1141 of file svm_fifo.c.
int svm_fifo_provision_chunks | ( | svm_fifo_t * | f, |
svm_fifo_seg_t * | fs, | ||
u32 | n_segs, | ||
u32 | len | ||
) |
Provision and return chunks for number of bytes requested.
Allocates enough chunks to cover the bytes requested and returns them in the fifo segment array. The number of bytes provisioned may be less than requested if not enough segments were provided.
f | fifo |
fs | array of fifo segments |
n_segs | length of fifo segments array |
len | number of bytes to preallocate |
Definition at line 1244 of file svm_fifo.c.
u8* svm_fifo_replay | ( | u8 * | s, |
svm_fifo_t * | f, | ||
u8 | no_read, | ||
u8 | verbose | ||
) |
Definition at line 1555 of file svm_fifo.c.
|
inlinestatic |
Clear has notification flag.
The fifo generates only one event per SVM_FIFO_WANT_NOTIF_IF_FULL request and sets has_ntf. To received new events the flag must be cleared using this function.
f | fifo |
Definition at line 866 of file svm_fifo.h.
int svm_fifo_segments | ( | svm_fifo_t * | f, |
u32 | offset, | ||
svm_fifo_seg_t * | fs, | ||
u32 | n_segs, | ||
u32 | max_bytes | ||
) |
Get pointers to fifo chunks data in svm_fifo_seg_t array.
Populates fifo segment array with pointers to fifo chunk data and lengths. Because this returns pointers to data, it must be paired with svm_fifo_dequeue_drop to actually release the fifo chunks after the data is consumed.
f | fifo |
offset | offset from where to retrieve segments |
fs | array of fifo segments allocated by caller |
n_segs | number of fifo segments in array |
max_bytes | max bytes to be mapped to fifo segments |
Definition at line 1283 of file svm_fifo.c.
|
inlinestatic |
Set fifo event flag.
Forces release semantics.
f | fifo |
Definition at line 790 of file svm_fifo.h.
|
inlinestatic |
Definition at line 760 of file svm_fifo.h.
|
inlinestatic |
|
inlinestatic |
Fifo tail pointer getter.
f | fifo |
Definition at line 690 of file svm_fifo.h.
|
inlinestatic |
Fifo tail chunk getter.
f | fifo |
Definition at line 678 of file svm_fifo.h.
|
inlinestatic |
Unset fifo event flag.
Forces acquire semantics
f | fifo |
Definition at line 803 of file svm_fifo.h.
format_function_t format_svm_fifo |
Definition at line 478 of file svm_fifo.h.