FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
svm_fifo_segment.h File Reference
+ Include dependency graph for svm_fifo_segment.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  svm_fifo_segment_header_t
 
struct  svm_fifo_segment_private_t
 
struct  svm_fifo_segment_main_t
 
struct  svm_fifo_segment_create_args_t
 

Macros

#define FIFO_SEGMENT_MIN_FIFO_SIZE   4096
 
#define FIFO_SEGMENT_MAX_FIFO_SIZE   (8<<20) /* 8mb max fifo size */
 
#define FIFO_SEGMENT_ALLOC_CHUNK_SIZE   32 /* Allocation quantum */
 
#define FIFO_SEGMENT_F_IS_PRIVATE   1 << 0 /* Private segment */
 
#define FIFO_SEGMENT_F_IS_MAIN_HEAP   1 << 1 /* Segment is main heap */
 
#define FIFO_SEGMENT_F_IS_PREALLOCATED   1 << 2 /* Segment is preallocated */
 
#define foreach_ssvm_fifo_segment_api_error   _(OUT_OF_SPACE, "Out of space in segment", -200)
 

Enumerations

enum  svm_fifo_segment_freelist_t { FIFO_SEGMENT_FREELIST_NONE = -1, FIFO_SEGMENT_RX_FREELIST = 0, FIFO_SEGMENT_TX_FREELIST, FIFO_SEGMENT_N_FREELISTS }
 
enum  ssvm_fifo_segment_api_error_enum_t { foreach_ssvm_fifo_segment_api_error }
 

Functions

static svm_fifo_segment_private_tsvm_fifo_segment_get_segment (u32 segment_index)
 
static u8 svm_fifo_segment_has_fifos (svm_fifo_segment_private_t *fifo_segment)
 
static svm_fifo_tsvm_fifo_segment_get_fifo_list (svm_fifo_segment_private_t *fifo_segment)
 
int svm_fifo_segment_create (svm_fifo_segment_create_args_t *a)
 (master) create an svm fifo segment More...
 
int svm_fifo_segment_create_process_private (svm_fifo_segment_create_args_t *a)
 Create an svm fifo segment in process-private memory. More...
 
int svm_fifo_segment_attach (svm_fifo_segment_create_args_t *a)
 (slave) attach to an svm fifo segment More...
 
void svm_fifo_segment_delete (svm_fifo_segment_private_t *s)
 
svm_fifo_tsvm_fifo_segment_alloc_fifo (svm_fifo_segment_private_t *s, u32 data_size_in_bytes, svm_fifo_segment_freelist_t index)
 
void svm_fifo_segment_free_fifo (svm_fifo_segment_private_t *s, svm_fifo_t *f, svm_fifo_segment_freelist_t index)
 
void svm_fifo_segment_init (u64 baseva, u32 timeout_in_seconds)
 
u32 svm_fifo_segment_index (svm_fifo_segment_private_t *s)
 
u32 svm_fifo_segment_num_fifos (svm_fifo_segment_private_t *fifo_segment)
 Get number of active fifos. More...
 
u32 svm_fifo_segment_num_free_fifos (svm_fifo_segment_private_t *fifo_segment, u32 fifo_size_in_bytes)
 
svm_fifo_segment_private_tsvm_fifo_segment_segments_pool (void)
 Retrieve svm segments pool. More...
 

Variables

svm_fifo_segment_main_t svm_fifo_segment_main
 
format_function_t format_svm_fifo_segment
 

Macro Definition Documentation

#define FIFO_SEGMENT_ALLOC_CHUNK_SIZE   32 /* Allocation quantum */

Definition at line 32 of file svm_fifo_segment.h.

#define FIFO_SEGMENT_F_IS_MAIN_HEAP   1 << 1 /* Segment is main heap */

Definition at line 35 of file svm_fifo_segment.h.

#define FIFO_SEGMENT_F_IS_PREALLOCATED   1 << 2 /* Segment is preallocated */

Definition at line 36 of file svm_fifo_segment.h.

#define FIFO_SEGMENT_F_IS_PRIVATE   1 << 0 /* Private segment */

Definition at line 34 of file svm_fifo_segment.h.

#define FIFO_SEGMENT_MAX_FIFO_SIZE   (8<<20) /* 8mb max fifo size */

Definition at line 31 of file svm_fifo_segment.h.

#define FIFO_SEGMENT_MIN_FIFO_SIZE   4096

Definition at line 30 of file svm_fifo_segment.h.

#define foreach_ssvm_fifo_segment_api_error   _(OUT_OF_SPACE, "Out of space in segment", -200)

Definition at line 97 of file svm_fifo_segment.h.

Enumeration Type Documentation

Enumerator
foreach_ssvm_fifo_segment_api_error 

Definition at line 100 of file svm_fifo_segment.h.

Enumerator
FIFO_SEGMENT_FREELIST_NONE 
FIFO_SEGMENT_RX_FREELIST 
FIFO_SEGMENT_TX_FREELIST 
FIFO_SEGMENT_N_FREELISTS 

Definition at line 22 of file svm_fifo_segment.h.

Function Documentation

svm_fifo_t* svm_fifo_segment_alloc_fifo ( svm_fifo_segment_private_t s,
u32  data_size_in_bytes,
svm_fifo_segment_freelist_t  index 
)

Definition at line 355 of file svm_fifo_segment.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int svm_fifo_segment_attach ( svm_fifo_segment_create_args_t a)

(slave) attach to an svm fifo segment

Definition at line 300 of file svm_fifo_segment.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int svm_fifo_segment_create ( svm_fifo_segment_create_args_t a)

(master) create an svm fifo segment

Definition at line 169 of file svm_fifo_segment.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int svm_fifo_segment_create_process_private ( svm_fifo_segment_create_args_t a)

Create an svm fifo segment in process-private memory.

Definition at line 219 of file svm_fifo_segment.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void svm_fifo_segment_delete ( svm_fifo_segment_private_t s)

Definition at line 335 of file svm_fifo_segment.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void svm_fifo_segment_free_fifo ( svm_fifo_segment_private_t s,
svm_fifo_t f,
svm_fifo_segment_freelist_t  index 
)

Definition at line 450 of file svm_fifo_segment.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static svm_fifo_t* svm_fifo_segment_get_fifo_list ( svm_fifo_segment_private_t fifo_segment)
inlinestatic

Definition at line 92 of file svm_fifo_segment.h.

+ Here is the caller graph for this function:

static svm_fifo_segment_private_t* svm_fifo_segment_get_segment ( u32  segment_index)
inlinestatic

Definition at line 79 of file svm_fifo_segment.h.

+ Here is the caller graph for this function:

static u8 svm_fifo_segment_has_fifos ( svm_fifo_segment_private_t fifo_segment)
inlinestatic

Definition at line 86 of file svm_fifo_segment.h.

+ Here is the caller graph for this function:

u32 svm_fifo_segment_index ( svm_fifo_segment_private_t s)

Definition at line 519 of file svm_fifo_segment.c.

void svm_fifo_segment_init ( u64  baseva,
u32  timeout_in_seconds 
)

Definition at line 510 of file svm_fifo_segment.c.

+ Here is the caller graph for this function:

u32 svm_fifo_segment_num_fifos ( svm_fifo_segment_private_t fifo_segment)

Get number of active fifos.

Definition at line 538 of file svm_fifo_segment.c.

+ Here is the caller graph for this function:

u32 svm_fifo_segment_num_free_fifos ( svm_fifo_segment_private_t fifo_segment,
u32  fifo_size_in_bytes 
)

Definition at line 544 of file svm_fifo_segment.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

svm_fifo_segment_private_t* svm_fifo_segment_segments_pool ( void  )

Retrieve svm segments pool.

Used only for debug purposes.

Definition at line 528 of file svm_fifo_segment.c.

+ Here is the caller graph for this function:

Variable Documentation

format_function_t format_svm_fifo_segment

Definition at line 126 of file svm_fifo_segment.h.

svm_fifo_segment_main_t svm_fifo_segment_main

Definition at line 18 of file svm_fifo_segment.c.