FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
svm_fifo.h File Reference
+ Include dependency graph for svm_fifo.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ooo_segment_t
 Out-of-order segment. More...
 
struct  svm_fifo_trace_elem_t
 
struct  svm_fifo_segment_
 

Macros

#define SVM_FIFO_TRACE   (0)
 
#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 struct _svm_fifo svm_fifo_t
 
typedef struct svm_fifo_segment_ svm_fifo_segment_t
 

Enumerations

enum  { SVM_FIFO_NO_TX_NOTIF = 0, SVM_FIFO_WANT_TX_NOTIF = 1, SVM_FIFO_WANT_TX_NOTIF_IF_FULL = 2 }
 
enum  svm_fifo_err_t { SVM_FIFO_FULL = -2 }
 

Functions

u8svm_fifo_dump_trace (u8 *s, svm_fifo_t *f)
 
u8svm_fifo_replay (u8 *s, svm_fifo_t *f, u8 no_read, u8 verbose)
 
static u32 svm_fifo_max_dequeue (svm_fifo_t *f)
 
static int svm_fifo_is_full (svm_fifo_t *f)
 
static int svm_fifo_is_empty (svm_fifo_t *f)
 
static u32 svm_fifo_max_enqueue (svm_fifo_t *f)
 
static int svm_fifo_has_event (svm_fifo_t *f)
 
static u8 svm_fifo_has_ooo_data (svm_fifo_t *f)
 
static u8 svm_fifo_set_event (svm_fifo_t *f)
 Sets fifo event flag. More...
 
static void svm_fifo_unset_event (svm_fifo_t *f)
 Unsets fifo event flag. More...
 
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)
 
int svm_fifo_enqueue_nowait (svm_fifo_t *f, u32 max_bytes, const u8 *copy_from_here)
 
int svm_fifo_enqueue_with_offset (svm_fifo_t *f, u32 offset, u32 required_bytes, u8 *copy_from_here)
 
int svm_fifo_dequeue_nowait (svm_fifo_t *f, u32 max_bytes, u8 *copy_here)
 
int svm_fifo_peek (svm_fifo_t *f, u32 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)
 
void svm_fifo_init_pointers (svm_fifo_t *f, u32 pointer)
 Set fifo pointers to requested offset. More...
 
void svm_fifo_overwrite_head (svm_fifo_t *f, u8 *data, u32 len)
 
static u32 svm_fifo_max_read_chunk (svm_fifo_t *f)
 Max contiguous chunk of data that can be read. More...
 
static u32 svm_fifo_max_write_chunk (svm_fifo_t *f)
 Max contiguous chunk of data that can be written. More...
 
static void svm_fifo_enqueue_nocopy (svm_fifo_t *f, u32 bytes)
 Advance tail pointer. More...
 
static u8svm_fifo_head (svm_fifo_t *f)
 
static u8svm_fifo_tail (svm_fifo_t *f)
 
static u32 svm_fifo_nitems (svm_fifo_t *f)
 
static void svm_fifo_add_want_tx_ntf (svm_fifo_t *f, u8 ntf_type)
 
static void svm_fifo_del_want_tx_ntf (svm_fifo_t *f, u8 ntf_type)
 
static void svm_fifo_clear_tx_ntf (svm_fifo_t *f)
 
static void svm_fifo_reset_tx_ntf (svm_fifo_t *f)
 
static u8 svm_fifo_needs_tx_ntf (svm_fifo_t *f, u32 n_last_deq)
 
u32 svm_fifo_number_ooo_segments (svm_fifo_t *f)
 
ooo_segment_tsvm_fifo_first_ooo_segment (svm_fifo_t *f)
 
static ooo_segment_tsvm_fifo_newest_ooo_segment (svm_fifo_t *f)
 
static void svm_fifo_newest_ooo_segment_reset (svm_fifo_t *f)
 
static u32 ooo_segment_distance_from_tail (svm_fifo_t *f, u32 pos)
 
static u32 ooo_segment_distance_to_tail (svm_fifo_t *f, u32 pos)
 
static u32 ooo_segment_offset (svm_fifo_t *f, ooo_segment_t *s)
 
static u32 ooo_segment_end_offset (svm_fifo_t *f, ooo_segment_t *s)
 
static u32 ooo_segment_length (svm_fifo_t *f, ooo_segment_t *s)
 
static ooo_segment_tooo_segment_get_prev (svm_fifo_t *f, ooo_segment_t *s)
 
static ooo_segment_tooo_segment_next (svm_fifo_t *f, ooo_segment_t *s)
 

Variables

format_function_t format_ooo_segment
 
format_function_t format_ooo_list
 
format_function_t format_svm_fifo
 

Macro Definition Documentation

◆ OOO_SEGMENT_INVALID_INDEX

#define OOO_SEGMENT_INVALID_INDEX   ((u32)~0)

Definition at line 40 of file svm_fifo.h.

◆ SVM_FIFO_INVALID_INDEX

#define SVM_FIFO_INVALID_INDEX   ((u32)~0)

Definition at line 42 of file svm_fifo.h.

◆ SVM_FIFO_INVALID_SESSION_INDEX

#define SVM_FIFO_INVALID_SESSION_INDEX   ((u32)~0)

Definition at line 41 of file svm_fifo.h.

◆ SVM_FIFO_TRACE

#define SVM_FIFO_TRACE   (0)

Definition at line 39 of file svm_fifo.h.

◆ svm_fifo_trace_add

#define svm_fifo_trace_add (   _f,
  _s,
  _l,
  _t 
)

Definition at line 117 of file svm_fifo.h.

Typedef Documentation

◆ svm_fifo_segment_t

◆ svm_fifo_t

typedef struct _svm_fifo svm_fifo_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SVM_FIFO_NO_TX_NOTIF 
SVM_FIFO_WANT_TX_NOTIF 
SVM_FIFO_WANT_TX_NOTIF_IF_FULL 

Definition at line 44 of file svm_fifo.h.

◆ svm_fifo_err_t

Enumerator
SVM_FIFO_FULL 

Definition at line 96 of file svm_fifo.h.

Function Documentation

◆ ooo_segment_distance_from_tail()

static u32 ooo_segment_distance_from_tail ( svm_fifo_t f,
u32  pos 
)
inlinestatic

Definition at line 318 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ ooo_segment_distance_to_tail()

static u32 ooo_segment_distance_to_tail ( svm_fifo_t f,
u32  pos 
)
inlinestatic

Definition at line 328 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ ooo_segment_end_offset()

static u32 ooo_segment_end_offset ( svm_fifo_t f,
ooo_segment_t s 
)
inlinestatic

Definition at line 340 of file svm_fifo.h.

+ Here is the call graph for this function:

◆ ooo_segment_get_prev()

static ooo_segment_t* ooo_segment_get_prev ( svm_fifo_t f,
ooo_segment_t s 
)
inlinestatic

Definition at line 352 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ ooo_segment_length()

static u32 ooo_segment_length ( svm_fifo_t f,
ooo_segment_t s 
)
inlinestatic

Definition at line 346 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ ooo_segment_next()

static ooo_segment_t* ooo_segment_next ( svm_fifo_t f,
ooo_segment_t s 
)
inlinestatic

Definition at line 360 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ ooo_segment_offset()

static u32 ooo_segment_offset ( svm_fifo_t f,
ooo_segment_t s 
)
inlinestatic

Definition at line 334 of file svm_fifo.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_add_want_tx_ntf()

static void svm_fifo_add_want_tx_ntf ( svm_fifo_t f,
u8  ntf_type 
)
inlinestatic

Definition at line 253 of file svm_fifo.h.

◆ svm_fifo_clear_tx_ntf()

static void svm_fifo_clear_tx_ntf ( svm_fifo_t f)
inlinestatic

Definition at line 265 of file svm_fifo.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_create()

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_del_want_tx_ntf()

static void svm_fifo_del_want_tx_ntf ( svm_fifo_t f,
u8  ntf_type 
)
inlinestatic

Definition at line 259 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_dequeue_drop()

int svm_fifo_dequeue_drop ( svm_fifo_t f,
u32  max_bytes 
)

Definition at line 734 of file svm_fifo.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_dequeue_drop_all()

void svm_fifo_dequeue_drop_all ( svm_fifo_t f)

Definition at line 774 of file svm_fifo.c.

+ Here is the caller graph for this function:

◆ svm_fifo_dequeue_nowait()

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

Definition at line 678 of file svm_fifo.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_dump_trace()

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:

◆ svm_fifo_enqueue_nocopy()

static void svm_fifo_enqueue_nocopy ( svm_fifo_t f,
u32  bytes 
)
inlinestatic

Advance tail pointer.

Useful for moving tail pointer after external enqueue.

Definition at line 227 of file svm_fifo.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_enqueue_nowait()

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

Definition at line 530 of file svm_fifo.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_enqueue_with_offset()

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

Definition at line 598 of file svm_fifo.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_first_ooo_segment()

ooo_segment_t* svm_fifo_first_ooo_segment ( svm_fifo_t f)

Definition at line 834 of file svm_fifo.c.

+ Here is the caller graph for this function:

◆ svm_fifo_free()

void svm_fifo_free ( svm_fifo_t f)

Definition at line 227 of file svm_fifo.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_has_event()

static int svm_fifo_has_event ( svm_fifo_t f)
inlinestatic

Definition at line 148 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_has_ooo_data()

static u8 svm_fifo_has_ooo_data ( svm_fifo_t f)
inlinestatic

Definition at line 154 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_head()

static u8* svm_fifo_head ( svm_fifo_t f)
inlinestatic

Definition at line 235 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_init_pointers()

void svm_fifo_init_pointers ( svm_fifo_t f,
u32  pointer 
)

Set fifo pointers to requested offset.

Definition at line 843 of file svm_fifo.c.

+ Here is the caller graph for this function:

◆ svm_fifo_is_empty()

static int svm_fifo_is_empty ( svm_fifo_t f)
inlinestatic

Definition at line 136 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_is_full()

static int svm_fifo_is_full ( svm_fifo_t f)
inlinestatic

Definition at line 130 of file svm_fifo.h.

◆ svm_fifo_max_dequeue()

static u32 svm_fifo_max_dequeue ( svm_fifo_t f)
inlinestatic

Definition at line 124 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_max_enqueue()

static u32 svm_fifo_max_enqueue ( svm_fifo_t f)
inlinestatic

Definition at line 142 of file svm_fifo.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_max_read_chunk()

static u32 svm_fifo_max_read_chunk ( svm_fifo_t f)
inlinestatic

Max contiguous chunk of data that can be read.

Definition at line 207 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_max_write_chunk()

static u32 svm_fifo_max_write_chunk ( svm_fifo_t f)
inlinestatic

Max contiguous chunk of data that can be written.

Definition at line 216 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_needs_tx_ntf()

static u8 svm_fifo_needs_tx_ntf ( svm_fifo_t f,
u32  n_last_deq 
)
inlinestatic

Definition at line 279 of file svm_fifo.h.

+ Here is the call graph for this function:

◆ svm_fifo_newest_ooo_segment()

static ooo_segment_t* svm_fifo_newest_ooo_segment ( svm_fifo_t f)
inlinestatic

Definition at line 304 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_newest_ooo_segment_reset()

static void svm_fifo_newest_ooo_segment_reset ( svm_fifo_t f)
inlinestatic

Definition at line 312 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_nitems()

static u32 svm_fifo_nitems ( svm_fifo_t f)
inlinestatic

Definition at line 247 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_number_ooo_segments()

u32 svm_fifo_number_ooo_segments ( svm_fifo_t f)

Definition at line 828 of file svm_fifo.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_overwrite_head()

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

Definition at line 607 of file svm_fifo.c.

+ Here is the caller graph for this function:

◆ svm_fifo_peek()

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

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:

◆ svm_fifo_replay()

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:

◆ svm_fifo_reset_tx_ntf()

static void svm_fifo_reset_tx_ntf ( svm_fifo_t f)
inlinestatic

Definition at line 273 of file svm_fifo.h.

◆ svm_fifo_segments()

int svm_fifo_segments ( svm_fifo_t f,
svm_fifo_segment_t fs 
)

Definition at line 781 of file svm_fifo.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ svm_fifo_segments_free()

void svm_fifo_segments_free ( svm_fifo_t f,
svm_fifo_segment_t fs 
)

Definition at line 809 of file svm_fifo.c.

+ Here is the caller graph for this function:

◆ svm_fifo_set_event()

static u8 svm_fifo_set_event ( svm_fifo_t f)
inlinestatic

Sets fifo event flag.

Also acts as a release barrier.

Returns
1 if flag was not set.

Definition at line 167 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_tail()

static u8* svm_fifo_tail ( svm_fifo_t f)
inlinestatic

Definition at line 241 of file svm_fifo.h.

+ Here is the caller graph for this function:

◆ svm_fifo_unset_event()

static void svm_fifo_unset_event ( svm_fifo_t f)
inlinestatic

Unsets fifo event flag.

Also acts as a release barrier.

Definition at line 180 of file svm_fifo.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ format_ooo_list

format_function_t format_ooo_list

Definition at line 37 of file svm_fifo.h.

◆ format_ooo_segment

format_function_t format_ooo_segment

Definition at line 36 of file svm_fifo.h.

◆ format_svm_fifo

format_function_t format_svm_fifo

Definition at line 201 of file svm_fifo.h.