|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
15 #ifndef SRC_VNET_SESSION_SEGMENT_MANAGER_H_
16 #define SRC_VNET_SESSION_SEGMENT_MANAGER_H_
24 typedef struct _segment_manager_props
30 u32 prealloc_fifo_hdrs;
32 uword add_segment_size;
51 typedef struct _segment_manager
67 u8 first_is_protected;
81 #define SEGMENT_MANAGER_INVALID_APP_INDEX ((u32) ~0)
130 u32 rx_fifo_size,
u32 tx_fifo_size,
140 u8 high_watermark,
u8 low_watermark);
175 *sm_index = segment_handle >> 32;
176 *segment_index = segment_handle & 0xFFFFFFFF;
segment_manager_t * segment_manager_alloc(void)
void segment_manager_init_free(segment_manager_t *sm)
Initiate segment manager cleanup.
segment_manager_t * segment_manager_get_if_valid(u32 index)
u64 segment_manager_segment_handle(segment_manager_t *sm, fifo_segment_t *segment)
int segment_manager_alloc_session_fifos(segment_manager_t *sm, u32 thread_index, svm_fifo_t **rx_fifo, svm_fifo_t **tx_fifo)
u64 segment_manager_make_segment_handle(u32 segment_manager_index, u32 segment_index)
void segment_manager_dealloc_queue(segment_manager_t *sm, svm_queue_t *q)
Frees shm queue allocated in the first segment.
struct _segment_manager segment_manager_t
struct _svm_queue svm_queue_t
Unidirectional shared-memory multi-ring message queue.
void segment_manager_app_detach(segment_manager_t *sm)
void segment_manager_format_sessions(segment_manager_t *sm, int verbose)
fifo_segment_t * segment_manager_get_segment_w_lock(segment_manager_t *sm, u32 segment_index)
Reads a segment from the segment manager's pool and acquires reader lock.
svm_msg_q_t * segment_manager_event_queue(segment_manager_t *sm)
void segment_manager_free(segment_manager_t *sm)
Cleanup segment manager.
u8 segment_manager_app_detached(segment_manager_t *sm)
static void segment_manager_parse_segment_handle(u64 segment_handle, u32 *sm_index, u32 *segment_index)
enum ssvm_segment_type_ ssvm_segment_type_t
struct _svm_fifo svm_fifo_t
int segment_manager_add_segment(segment_manager_t *sm, uword segment_size, u8 notify_app)
Adds segment to segment manager's pool.
segment_manager_props_t * segment_manager_props_init(segment_manager_props_t *sm)
@ SEG_MANAGER_F_DETACHED_LISTENER
void segment_manager_attach_fifo(segment_manager_t *sm, svm_fifo_t **f, session_t *s)
struct _segment_manager_props segment_manager_props_t
segment_manager_t * segment_manager_get(u32 index)
void segment_manager_del_sessions_filter(segment_manager_t *sm, session_state_t *states)
Initiate disconnects for sessions in specified state 'owned' by a segment manager.
void segment_manager_dealloc_fifos(svm_fifo_t *rx_fifo, svm_fifo_t *tx_fifo)
int segment_manager_init(segment_manager_t *sm)
void segment_manager_del_sessions(segment_manager_t *sm)
Cleanup segment manager sessions.
u8 segment_manager_has_fifos(segment_manager_t *sm)
Simple first-fit virtual space allocator.
static CLIB_NOSANITIZE_ADDR void add_segment(mstate m, char *tbase, size_t tsize, flag_t mmapped)
u32 segment_manager_index(segment_manager_t *sm)
void segment_manager_main_init(void)
int segment_manager_init_first(segment_manager_t *sm)
Initializes segment manager based on options provided.
void segment_manager_segment_reader_unlock(segment_manager_t *sm)
enum seg_manager_flag_ seg_manager_flag_t
int segment_manager_try_alloc_fifos(fifo_segment_t *fs, u32 thread_index, u32 rx_fifo_size, u32 tx_fifo_size, svm_fifo_t **rx_fifo, svm_fifo_t **tx_fifo)
void segment_manager_detach_fifo(segment_manager_t *sm, svm_fifo_t **f)
fifo_segment_t * segment_manager_get_segment_w_handle(u64 sh)
void segment_manager_set_watermarks(segment_manager_t *sm, u8 high_watermark, u8 low_watermark)
svm_msg_q_t * segment_manager_alloc_queue(fifo_segment_t *fs, segment_manager_props_t *props)
Allocates shm queue in the first segment.
void segment_manager_del_segment(segment_manager_t *sm, fifo_segment_t *fs)
Remove segment without lock.
u32 segment_manager_evt_q_expected_size(u32 q_size)
fifo_segment_t * segment_manager_get_segment(segment_manager_t *sm, u32 segment_index)
Reads a segment from the segment manager's pool without lock.
void segment_manager_lock_and_del_segment(segment_manager_t *sm, u32 fs_index)
int segment_manager_add_first_segment(segment_manager_t *sm, u32 segment_size)
void segment_manager_segment_writer_unlock(segment_manager_t *sm)
vl_api_wireguard_peer_flags_t flags