FD.io VPP  v17.07.01-10-g3be13f0
Vector Packet Processing
svm_fifo.c File Reference
+ Include dependency graph for svm_fifo.c:

Go to the source code of this file.

Macros

#define SVM_ENQUEUE_CLONE_TEMPLATE(arch, fn, tgt)
 
#define SVM_FIFO_DEQUEUE_CLONE_TEMPLATE(arch, fn, tgt)
 
#define SVM_FIFO_PEEK_CLONE_TEMPLATE(arch, fn, tgt)
 

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)
 
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...
 
static int svm_fifo_enqueue_internal (svm_fifo_t *f, u32 max_bytes, u8 *copy_from_here)
 
static int svm_fifo_enqueue_nowait_ma (svm_fifo_t *f, u32 max_bytes, u8 *copy_from_here)
 
 foreach_march_variant (SVM_ENQUEUE_CLONE_TEMPLATE, svm_fifo_enqueue_nowait_ma)
 
 CLIB_MULTIARCH_SELECT_FN (svm_fifo_enqueue_nowait_ma)
 
int svm_fifo_enqueue_nowait (svm_fifo_t *f, u32 max_bytes, u8 *copy_from_here)
 
static int svm_fifo_enqueue_with_offset_internal (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)
 
static int svm_fifo_dequeue_internal (svm_fifo_t *f, u32 max_bytes, u8 *copy_here)
 
static int svm_fifo_dequeue_nowait_ma (svm_fifo_t *f, u32 max_bytes, u8 *copy_here)
 
 foreach_march_variant (SVM_FIFO_DEQUEUE_CLONE_TEMPLATE, svm_fifo_dequeue_nowait_ma)
 
 CLIB_MULTIARCH_SELECT_FN (svm_fifo_dequeue_nowait_ma)
 
int svm_fifo_dequeue_nowait (svm_fifo_t *f, u32 max_bytes, u8 *copy_here)
 
static int svm_fifo_peek_ma (svm_fifo_t *f, u32 relative_offset, u32 max_bytes, u8 *copy_here)
 
 foreach_march_variant (SVM_FIFO_PEEK_CLONE_TEMPLATE, svm_fifo_peek_ma)
 
 CLIB_MULTIARCH_SELECT_FN (svm_fifo_peek_ma)
 
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)
 
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...
 

Macro Definition Documentation

#define SVM_ENQUEUE_CLONE_TEMPLATE (   arch,
  fn,
  tgt 
)
Value:
uword \
__attribute__ ((flatten)) \
__attribute__ ((target (tgt))) \
CLIB_CPU_OPTIMIZED \
fn ## _ ## arch ( svm_fifo_t * f, u32 max_bytes, u8 * copy_from_here) \
{ return fn (f, max_bytes, copy_from_here);}
struct _svm_fifo svm_fifo_t
unsigned int u32
Definition: types.h:88
unsigned char u8
Definition: types.h:56

Definition at line 421 of file svm_fifo.c.

#define SVM_FIFO_DEQUEUE_CLONE_TEMPLATE (   arch,
  fn,
  tgt 
)
Value:
uword \
__attribute__ ((flatten)) \
__attribute__ ((target (tgt))) \
CLIB_CPU_OPTIMIZED \
fn ## _ ## arch ( svm_fifo_t * f, u32 max_bytes, \
u8 * copy_here) \
{ return fn (f, max_bytes, copy_here);}
struct _svm_fifo svm_fifo_t
unsigned int u32
Definition: types.h:88
unsigned char u8
Definition: types.h:56

Definition at line 579 of file svm_fifo.c.

#define SVM_FIFO_PEEK_CLONE_TEMPLATE (   arch,
  fn,
  tgt 
)
Value:
uword \
__attribute__ ((flatten)) \
__attribute__ ((target (tgt))) \
CLIB_CPU_OPTIMIZED \
fn ## _ ## arch ( svm_fifo_t * f, u32 relative_offset, u32 max_bytes, \
u8 * copy_here) \
{ return fn (f, relative_offset, max_bytes, copy_here);}
struct _svm_fifo svm_fifo_t
unsigned int u32
Definition: types.h:88
unsigned char u8
Definition: types.h:56

Definition at line 646 of file svm_fifo.c.

Function Documentation

CLIB_MULTIARCH_SELECT_FN ( svm_fifo_enqueue_nowait_ma  )

+ Here is the caller graph for this function:

CLIB_MULTIARCH_SELECT_FN ( svm_fifo_dequeue_nowait_ma  )
CLIB_MULTIARCH_SELECT_FN ( svm_fifo_peek_ma  )
foreach_march_variant ( SVM_ENQUEUE_CLONE_TEMPLATE  ,
svm_fifo_enqueue_nowait_ma   
)

+ Here is the caller graph for this function:

foreach_march_variant ( SVM_FIFO_DEQUEUE_CLONE_TEMPLATE  ,
svm_fifo_dequeue_nowait_ma   
)
foreach_march_variant ( SVM_FIFO_PEEK_CLONE_TEMPLATE  ,
svm_fifo_peek_ma   
)
u8* format_ooo_list ( u8 s,
va_list *  args 
)

Definition at line 64 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 54 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 80 of file svm_fifo.c.

+ Here is the call 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 175 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 146 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 131 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 315 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 107 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 675 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_dequeue_internal ( svm_fifo_t f,
u32  max_bytes,
u8 copy_here 
)
static

Definition at line 524 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_nowait ( svm_fifo_t f,
u32  max_bytes,
u8 copy_here 
)

Definition at line 593 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_dequeue_nowait_ma ( svm_fifo_t f,
u32  max_bytes,
u8 copy_here 
)
static

Definition at line 574 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,
u32  max_bytes,
u8 copy_from_here 
)
static

Definition at line 364 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,
u8 copy_from_here 
)

Definition at line 441 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_nowait_ma ( svm_fifo_t f,
u32  max_bytes,
u8 copy_from_here 
)
static

Definition at line 430 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 514 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_internal ( svm_fifo_t f,
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 463 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 717 of file svm_fifo.c.

+ Here is the caller graph for this function:

void svm_fifo_free ( svm_fifo_t f)

Definition at line 124 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 726 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 711 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,
u32  relative_offset,
u32  max_bytes,
u8 copy_here 
)

Definition at line 659 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_peek_ma ( svm_fifo_t f,
u32  relative_offset,
u32  max_bytes,
u8 copy_here 
)
static

Definition at line 608 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: