FD.io VPP  v18.01.2-1-g9b554f3
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)
 
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...
 
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 513 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 676 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 743 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 150 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 167 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 270 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 241 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 226 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 402 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 194 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 772 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 618 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 690 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 671 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 66 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 451 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 533 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 522 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 608 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 555 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 818 of file svm_fifo.c.

+ Here is the caller graph for this function:

void svm_fifo_free ( svm_fifo_t f)

Definition at line 214 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 827 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 812 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 756 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 705 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 90 of file svm_fifo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: