FD.io VPP  v18.10-32-g1161dda
Vector Packet Processing
svm_fifo.c File Reference
+ Include dependency graph for svm_fifo.c:

Go to the source code of this file.

Functions

static u8 position_lt (svm_fifo_t *f, u32 a, u32 b)
 
static u8 position_leq (svm_fifo_t *f, u32 a, u32 b)
 
static u8 position_gt (svm_fifo_t *f, u32 a, u32 b)
 
static u32 position_diff (svm_fifo_t *f, u32 posa, u32 posb)
 
static u32 ooo_segment_end_pos (svm_fifo_t *f, ooo_segment_t *s)
 
u8format_ooo_segment (u8 *s, va_list *args)
 
u8svm_fifo_dump_trace (u8 *s, svm_fifo_t *f)
 
u8svm_fifo_replay (u8 *s, svm_fifo_t *f, u8 no_read, u8 verbose)
 
u8format_ooo_list (u8 *s, va_list *args)
 
u8format_svm_fifo (u8 *s, va_list *args)
 
svm_fifo_tsvm_fifo_create (u32 data_size_in_bytes)
 create an svm fifo, in the current heap. More...
 
void svm_fifo_free (svm_fifo_t *f)
 
static ooo_segment_tooo_segment_new (svm_fifo_t *f, u32 start, u32 length)
 
static void ooo_segment_del (svm_fifo_t *f, u32 index)
 
static void ooo_segment_add (svm_fifo_t *f, u32 offset, u32 length)
 Add segment to fifo's out-of-order segment list. More...
 
static int ooo_segment_try_collect (svm_fifo_t *f, u32 n_bytes_enqueued)
 Removes segments that can now be enqueued because the fifo's tail has advanced. More...
 
 CLIB_MARCH_FN (svm_fifo_enqueue_nowait, int, svm_fifo_t *f, u32 max_bytes, const u8 *copy_from_here)
 
int svm_fifo_enqueue_nowait (svm_fifo_t *f, u32 max_bytes, const u8 *copy_from_here)
 
 CLIB_MARCH_FN (svm_fifo_enqueue_with_offset, int, svm_fifo_t *f, u32 offset, u32 required_bytes, u8 *copy_from_here)
 Enqueue a future segment. More...
 
int svm_fifo_enqueue_with_offset (svm_fifo_t *f, u32 offset, u32 required_bytes, u8 *copy_from_here)
 
void svm_fifo_overwrite_head (svm_fifo_t *f, u8 *data, u32 len)
 
 CLIB_MARCH_FN (svm_fifo_dequeue_nowait, int, svm_fifo_t *f, u32 max_bytes, u8 *copy_here)
 
int svm_fifo_dequeue_nowait (svm_fifo_t *f, u32 max_bytes, u8 *copy_here)
 
 CLIB_MARCH_FN (svm_fifo_peek, int, svm_fifo_t *f, u32 relative_offset, u32 max_bytes, u8 *copy_here)
 
int svm_fifo_peek (svm_fifo_t *f, u32 relative_offset, u32 max_bytes, u8 *copy_here)
 
int svm_fifo_dequeue_drop (svm_fifo_t *f, u32 max_bytes)
 
void svm_fifo_dequeue_drop_all (svm_fifo_t *f)
 
int svm_fifo_segments (svm_fifo_t *f, svm_fifo_segment_t *fs)
 
void svm_fifo_segments_free (svm_fifo_t *f, svm_fifo_segment_t *fs)
 
u32 svm_fifo_number_ooo_segments (svm_fifo_t *f)
 
ooo_segment_tsvm_fifo_first_ooo_segment (svm_fifo_t *f)
 
void svm_fifo_init_pointers (svm_fifo_t *f, u32 pointer)
 Set fifo pointers to requested offset. More...
 

Function Documentation

CLIB_MARCH_FN ( svm_fifo_enqueue_nowait  ,
int  ,
svm_fifo_t f,
u32  max_bytes,
const u8 copy_from_here 
)

Definition at line 458 of file svm_fifo.c.

+ Here is the call graph for this function:

CLIB_MARCH_FN ( svm_fifo_enqueue_with_offset  ,
int  ,
svm_fifo_t f,
u32  offset,
u32  required_bytes,
u8 copy_from_here 
)

Enqueue a future segment.

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 538 of file svm_fifo.c.

+ Here is the call graph for this function:

CLIB_MARCH_FN ( svm_fifo_dequeue_nowait  ,
int  ,
svm_fifo_t f,
u32  max_bytes,
u8 copy_here 
)

Definition at line 614 of file svm_fifo.c.

+ Here is the call graph for this function:

CLIB_MARCH_FN ( svm_fifo_peek  ,
int  ,
svm_fifo_t f,
u32  relative_offset,
u32  max_bytes,
u8 copy_here 
)

Definition at line 677 of file svm_fifo.c.

+ Here is the call graph for this function:

u8* format_ooo_list ( u8 s,
va_list *  args 
)

Definition at line 152 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_ooo_segment ( u8 s,
va_list *  args 
)

Definition at line 56 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_svm_fifo ( u8 s,
va_list *  args 
)

Definition at line 169 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ooo_segment_add ( svm_fifo_t f,
u32  offset,
u32  length 
)
static

Add segment to fifo's out-of-order segment list.

Takes care of merging adjacent segments and removing overlapping ones.

Definition at line 278 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ooo_segment_del ( svm_fifo_t f,
u32  index 
)
inlinestatic

Definition at line 249 of file svm_fifo.c.

+ Here is the caller graph for this function:

static u32 ooo_segment_end_pos ( svm_fifo_t f,
ooo_segment_t s 
)
inlinestatic

Definition at line 48 of file svm_fifo.c.

+ Here is the caller graph for this function:

static ooo_segment_t* ooo_segment_new ( svm_fifo_t f,
u32  start,
u32  length 
)
inlinestatic

Definition at line 234 of file svm_fifo.c.

+ Here is the caller graph for this function:

static int ooo_segment_try_collect ( svm_fifo_t f,
u32  n_bytes_enqueued 
)
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 410 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 position_diff ( svm_fifo_t f,
u32  posa,
u32  posb 
)
inlinestatic

Definition at line 41 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 position_gt ( svm_fifo_t f,
u32  a,
u32  b 
)
inlinestatic

Definition at line 34 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 position_leq ( svm_fifo_t f,
u32  a,
u32  b 
)
inlinestatic

Definition at line 27 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 position_lt ( svm_fifo_t f,
u32  a,
u32  b 
)
inlinestatic

Definition at line 20 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

svm_fifo_t* svm_fifo_create ( u32  data_size_in_bytes)

create an svm fifo, in the current heap.

Fails vs blow up the process

Definition at line 200 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int svm_fifo_dequeue_drop ( svm_fifo_t f,
u32  max_bytes 
)

Definition at line 726 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void svm_fifo_dequeue_drop_all ( svm_fifo_t f)

Definition at line 766 of file svm_fifo.c.

+ Here is the caller graph for this function:

int svm_fifo_dequeue_nowait ( svm_fifo_t f,
u32  max_bytes,
u8 copy_here 
)

Definition at line 670 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* svm_fifo_dump_trace ( u8 s,
svm_fifo_t f 
)

Definition at line 68 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int svm_fifo_enqueue_nowait ( svm_fifo_t f,
u32  max_bytes,
const u8 copy_from_here 
)

Definition at line 523 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int svm_fifo_enqueue_with_offset ( svm_fifo_t f,
u32  offset,
u32  required_bytes,
u8 copy_from_here 
)

Definition at line 590 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ooo_segment_t* svm_fifo_first_ooo_segment ( svm_fifo_t f)

Definition at line 826 of file svm_fifo.c.

+ Here is the caller graph for this function:

void svm_fifo_free ( svm_fifo_t f)

Definition at line 221 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void svm_fifo_init_pointers ( svm_fifo_t f,
u32  pointer 
)

Set fifo pointers to requested offset.

Definition at line 835 of file svm_fifo.c.

+ Here is the caller graph for this function:

u32 svm_fifo_number_ooo_segments ( svm_fifo_t f)

Definition at line 820 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void svm_fifo_overwrite_head ( svm_fifo_t f,
u8 data,
u32  len 
)

Definition at line 599 of file svm_fifo.c.

+ Here is the caller graph for this function:

int svm_fifo_peek ( svm_fifo_t f,
u32  relative_offset,
u32  max_bytes,
u8 copy_here 
)

Definition at line 718 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* svm_fifo_replay ( u8 s,
svm_fifo_t f,
u8  no_read,
u8  verbose 
)

Definition at line 92 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int svm_fifo_segments ( svm_fifo_t f,
svm_fifo_segment_t fs 
)

Definition at line 773 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void svm_fifo_segments_free ( svm_fifo_t f,
svm_fifo_segment_t fs 
)

Definition at line 801 of file svm_fifo.c.

+ Here is the caller graph for this function: