FD.io VPP  v17.04.2-2-ga8f93f8
Vector Packet Processing
svm_fifo.c File Reference
+ Include dependency graph for svm_fifo.c:

Go to the source code of this file.

Functions

svm_fifo_tsvm_fifo_create (u32 data_size_in_bytes)
 create an svm fifo, in the current heap. More...
 
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...
 
static int svm_fifo_enqueue_internal (svm_fifo_t *f, int pid, u32 max_bytes, u8 *copy_from_here)
 
int svm_fifo_enqueue_nowait (svm_fifo_t *f, int pid, u32 max_bytes, u8 *copy_from_here)
 
static int svm_fifo_enqueue_with_offset_internal2 (svm_fifo_t *f, int pid, u32 offset, u32 required_bytes, u8 *copy_from_here)
 Enqueue a future segment. More...
 
int svm_fifo_enqueue_with_offset (svm_fifo_t *f, int pid, u32 offset, u32 required_bytes, u8 *copy_from_here)
 
static int svm_fifo_dequeue_internal2 (svm_fifo_t *f, int pid, u32 max_bytes, u8 *copy_here)
 
int svm_fifo_dequeue_nowait (svm_fifo_t *f, int pid, u32 max_bytes, u8 *copy_here)
 
int svm_fifo_peek (svm_fifo_t *f, int pid, u32 offset, u32 max_bytes, u8 *copy_here)
 
int svm_fifo_dequeue_drop (svm_fifo_t *f, int pid, u32 max_bytes)
 

Function Documentation

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 103 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 74 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 59 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 253 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 20 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,
int  pid,
u32  max_bytes 
)

Definition at line 527 of file svm_fifo.c.

+ Here is the caller graph for this function:

static int svm_fifo_dequeue_internal2 ( svm_fifo_t f,
int  pid,
u32  max_bytes,
u8 copy_here 
)
static

Definition at line 433 of file svm_fifo.c.

+ Here is the caller graph for this function:

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

Definition at line 484 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int svm_fifo_enqueue_internal ( svm_fifo_t f,
int  pid,
u32  max_bytes,
u8 copy_from_here 
)
static

Definition at line 302 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,
int  pid,
u32  max_bytes,
u8 copy_from_here 
)

Definition at line 359 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,
int  pid,
u32  offset,
u32  required_bytes,
u8 copy_from_here 
)

Definition at line 422 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int svm_fifo_enqueue_with_offset_internal2 ( svm_fifo_t f,
int  pid,
u32  offset,
u32  required_bytes,
u8 copy_from_here 
)
static

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int svm_fifo_peek ( svm_fifo_t f,
int  pid,
u32  offset,
u32  max_bytes,
u8 copy_here 
)

Definition at line 491 of file svm_fifo.c.

+ Here is the caller graph for this function: