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

Go to the source code of this file.

Typedefs

typedef struct _segment_manager_properties segment_manager_properties_t
 
typedef struct _segment_manager segment_manager_t
 

Functions

static segment_manager_tsegment_manager_new ()
 
static segment_manager_tsegment_manager_get (u32 index)
 
static segment_manager_tsegment_manager_get_if_valid (u32 index)
 
static u32 segment_manager_index (segment_manager_t *sm)
 
int segment_manager_init (segment_manager_t *sm, segment_manager_properties_t *properties, u32 seg_size)
 Initializes segment manager based on options provided. More...
 
void segment_manager_get_segment_info (u32 index, u8 **name, u32 *size)
 
int session_manager_add_first_segment (segment_manager_t *sm, u32 segment_size)
 
int session_manager_add_segment (segment_manager_t *sm)
 
void segment_manager_del (segment_manager_t *sm)
 Removes segment manager. More...
 
int segment_manager_alloc_session_fifos (segment_manager_t *sm, svm_fifo_t **server_rx_fifo, svm_fifo_t **server_tx_fifo, u32 *fifo_segment_index)
 
void segment_manager_dealloc_fifos (u32 svm_segment_index, svm_fifo_t *rx_fifo, svm_fifo_t *tx_fifo)
 
unix_shared_memory_queue_tsegment_manager_alloc_queue (segment_manager_t *sm, u32 queue_size)
 Allocates shm queue in the first segment. More...
 
void segment_manager_dealloc_queue (segment_manager_t *sm, unix_shared_memory_queue_t *q)
 Frees shm queue allocated in the first segment. More...
 

Variables

segment_manager_tsegment_managers
 Pool of segment managers. More...
 

Typedef Documentation

typedef struct _segment_manager_properties segment_manager_properties_t
typedef struct _segment_manager segment_manager_t

Function Documentation

unix_shared_memory_queue_t* segment_manager_alloc_queue ( segment_manager_t sm,
u32  queue_size 
)

Allocates shm queue in the first segment.

Definition at line 378 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int segment_manager_alloc_session_fifos ( segment_manager_t sm,
svm_fifo_t **  server_rx_fifo,
svm_fifo_t **  server_tx_fifo,
u32 fifo_segment_index 
)

Definition at line 240 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void segment_manager_dealloc_fifos ( u32  svm_segment_index,
svm_fifo_t rx_fifo,
svm_fifo_t tx_fifo 
)

Definition at line 344 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void segment_manager_dealloc_queue ( segment_manager_t sm,
unix_shared_memory_queue_t q 
)

Frees shm queue allocated in the first segment.

Definition at line 403 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void segment_manager_del ( segment_manager_t sm)

Removes segment manager.

Since the fifos allocated in the segment keep backpointers to the sessions prior to removing the segment, we call session disconnect. This subsequently propages into transport.

Definition at line 178 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static segment_manager_t* segment_manager_get ( u32  index)
inlinestatic

Definition at line 72 of file segment_manager.h.

+ Here is the caller graph for this function:

static segment_manager_t* segment_manager_get_if_valid ( u32  index)
inlinestatic

Definition at line 78 of file segment_manager.h.

+ Here is the caller graph for this function:

void segment_manager_get_segment_info ( u32  index,
u8 **  name,
u32 size 
)

Definition at line 42 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 segment_manager_index ( segment_manager_t sm)
inlinestatic

Definition at line 86 of file segment_manager.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int segment_manager_init ( segment_manager_t sm,
segment_manager_properties_t properties,
u32  first_seg_size 
)

Initializes segment manager based on options provided.

Returns error if svm segment allocation fails.

Definition at line 138 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static segment_manager_t* segment_manager_new ( )
inlinestatic

Definition at line 63 of file segment_manager.h.

+ Here is the caller graph for this function:

int session_manager_add_first_segment ( segment_manager_t sm,
u32  segment_size 
)

Definition at line 98 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int session_manager_add_segment ( segment_manager_t sm)

Definition at line 80 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

segment_manager_t* segment_managers

Pool of segment managers.

Definition at line 28 of file segment_manager.c.