FD.io VPP  v18.01-8-g0eacf49
Vector Packet Processing
segment_manager.c File Reference
+ Include dependency graph for segment_manager.c:

Go to the source code of this file.

Functions

segment_manager_properties_tsegment_manager_properties_alloc (void)
 
void segment_manager_properties_free (segment_manager_properties_t *props)
 
segment_manager_properties_tsegment_manager_properties_get (u32 smp_index)
 
u32 segment_manager_properties_index (segment_manager_properties_t *p)
 
void segment_manager_get_segment_info (u32 index, u8 **name, u32 *size)
 
static int session_manager_add_segment_i (segment_manager_t *sm, u32 segment_size, u8 *segment_name)
 
int session_manager_add_segment (segment_manager_t *sm)
 
int session_manager_add_first_segment (segment_manager_t *sm, u32 segment_size)
 
segment_manager_tsegment_manager_new ()
 
int segment_manager_init (segment_manager_t *sm, u32 props_index, u32 first_seg_size)
 Initializes segment manager based on options provided. More...
 
u8 segment_manager_has_fifos (segment_manager_t *sm)
 
static u8 segment_manager_app_detached (segment_manager_t *sm)
 
void segment_manager_app_detach (segment_manager_t *sm)
 
static void segment_manager_del_segment (segment_manager_t *sm, u32 segment_index)
 
void segment_manager_del_sessions (segment_manager_t *sm)
 Initiate disconnects for all sessions 'owned' by a segment manager. More...
 
void segment_manager_del (segment_manager_t *sm)
 Removes segment manager. More...
 
void segment_manager_init_del (segment_manager_t *sm)
 
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...
 
static clib_error_tsegment_manager_show_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

u32 segment_name_counter = 0
 Counter used to build segment names. More...
 
segment_manager_tsegment_managers = 0
 Pool of segment managers. More...
 
static segment_manager_properties_tsegment_manager_properties_pool
 
u32private_segment_indices
 Process private segment index. More...
 
u32 default_fifo_size = 1 << 16
 Default fifo and segment size. More...
 
u32 default_segment_size = 1 << 20
 
static vlib_cli_command_t segment_manager_show_command
 (constructor) VLIB_CLI_COMMAND (segment_manager_show_command) More...
 

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 534 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 373 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void segment_manager_app_detach ( segment_manager_t sm)

Definition at line 249 of file segment_manager.c.

+ Here is the caller graph for this function:

static u8 segment_manager_app_detached ( segment_manager_t sm)
static

Definition at line 243 of file segment_manager.c.

+ 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 478 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 559 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 propagates into transport.

Definition at line 332 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void segment_manager_del_segment ( segment_manager_t sm,
u32  segment_index 
)
static

Definition at line 255 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_sessions ( segment_manager_t sm)

Initiate disconnects for all sessions 'owned' by a segment manager.

Definition at line 278 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 77 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8 segment_manager_has_fifos ( segment_manager_t sm)

Definition at line 225 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int segment_manager_init ( segment_manager_t sm,
u32  props_index,
u32  first_seg_size 
)

Initializes segment manager based on options provided.

Returns error if svm segment allocation fails.

Definition at line 205 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void segment_manager_init_del ( segment_manager_t sm)

Definition at line 360 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

segment_manager_t* segment_manager_new ( )

Definition at line 192 of file segment_manager.c.

+ Here is the caller graph for this function:

segment_manager_properties_t* segment_manager_properties_alloc ( void  )

Definition at line 47 of file segment_manager.c.

+ Here is the caller graph for this function:

void segment_manager_properties_free ( segment_manager_properties_t props)

Definition at line 56 of file segment_manager.c.

+ Here is the caller graph for this function:

segment_manager_properties_t* segment_manager_properties_get ( u32  smp_index)

Definition at line 63 of file segment_manager.c.

+ Here is the caller graph for this function:

u32 segment_manager_properties_index ( segment_manager_properties_t p)

Definition at line 71 of file segment_manager.c.

+ Here is the caller graph for this function:

static clib_error_t* segment_manager_show_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 577 of file segment_manager.c.

+ Here is the call graph for this function:

int session_manager_add_first_segment ( segment_manager_t sm,
u32  segment_size 
)

Definition at line 180 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 160 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int session_manager_add_segment_i ( segment_manager_t sm,
u32  segment_size,
u8 segment_name 
)
inlinestatic

Definition at line 86 of file segment_manager.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

u32 default_fifo_size = 1 << 16

Default fifo and segment size.

TODO config.

Definition at line 43 of file segment_manager.c.

u32 default_segment_size = 1 << 20

Definition at line 44 of file segment_manager.c.

u32* private_segment_indices

Process private segment index.

Definition at line 38 of file segment_manager.c.

segment_manager_properties_t* segment_manager_properties_pool
static

Definition at line 33 of file segment_manager.c.

vlib_cli_command_t segment_manager_show_command
static
Initial value:
=
{
.path = "show segment-manager",
.short_help = "show segment-manager [segments][verbose]",
}
static clib_error_t * segment_manager_show_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (segment_manager_show_command)

Definition at line 659 of file segment_manager.c.

segment_manager_t* segment_managers = 0

Pool of segment managers.

Definition at line 28 of file segment_manager.c.

u32 segment_name_counter = 0

Counter used to build segment names.

Definition at line 23 of file segment_manager.c.