FD.io VPP  v18.07-rc0-415-g6c78436
Vector Packet Processing
mc.c File Reference
+ Include dependency graph for mc.c:

Go to the source code of this file.

Macros

#define MSG_ID_DEBUG   0
 
#define EVENT_MC_SEND_CATCHUP_DATA   0
 
#define EVENT_MC_UNSERIALIZE_BUFFER   0
 
#define EVENT_MC_UNSERIALIZE_CATCHUP   1
 

Functions

static u32 elog_id_for_peer_id (mc_main_t *m, u64 peer_id)
 
static u32 elog_id_for_msg_name (mc_main_t *m, char *msg_name)
 
static void elog_tx_msg (mc_main_t *m, u32 stream_id, u32 local_sequence, u32 retry_count)
 
static i32 mc_seq_cmp (u32 x, u32 y)
 
void * mc_get_vlib_buffer (vlib_main_t *vm, u32 n_bytes, u32 *bi_return)
 
static void delete_peer_with_index (mc_main_t *mcm, mc_stream_t *s, uword index, int notify_application)
 
static mc_stream_peer_tget_or_create_peer_with_id (mc_main_t *mcm, mc_stream_t *s, mc_peer_id_t id, int *created)
 
static void maybe_send_window_open_event (vlib_main_t *vm, mc_stream_t *stream)
 
static void mc_retry_free (mc_main_t *mcm, mc_stream_t *s, mc_retry_t *r)
 
static void mc_resend_retired (mc_main_t *mcm, mc_stream_t *s, u32 local_sequence)
 
static uworddelete_retry_fifo_elt (mc_main_t *mcm, mc_stream_t *stream, mc_retry_t *r, uword *dead_peer_bitmap)
 
static mc_retry_tprev_retry (mc_stream_t *s, mc_retry_t *r)
 
static mc_retry_tnext_retry (mc_stream_t *s, mc_retry_t *r)
 
static void remove_retry_from_pool (mc_stream_t *s, mc_retry_t *r)
 
static void check_retry (mc_main_t *mcm, mc_stream_t *s)
 
static mc_main_tmc_node_get_main (vlib_node_runtime_t *node)
 
static uword mc_retry_process (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
static void send_join_or_leave_request (mc_main_t *mcm, u32 stream_index, u32 is_join)
 
static uword mc_join_ager_process (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
static void serialize_mc_register_stream_name (serialize_main_t *m, va_list *va)
 
static void elog_stream_name (char *buf, int n_buf_bytes, char *v)
 
static void unserialize_mc_register_stream_name (serialize_main_t *m, va_list *va)
 
 MC_SERIALIZE_MSG (mc_register_stream_name_msg, static)
 
void mc_rx_buffer_unserialize (mc_main_t *mcm, mc_stream_t *stream, mc_peer_id_t peer_id, u32 buffer_index)
 
static u8mc_internal_catchup_snapshot (mc_main_t *mcm, u8 *data_vector, u32 last_global_sequence_processed)
 
static void mc_internal_catchup (mc_main_t *mcm, u8 *data, u32 n_data_bytes)
 
void mc_stream_join_process_hold (void)
 
static u32 mc_stream_join_helper (mc_main_t *mcm, mc_stream_config_t *config, u32 is_internal)
 
u32 mc_stream_join (mc_main_t *mcm, mc_stream_config_t *config)
 
void mc_stream_leave (mc_main_t *mcm, u32 stream_index)
 
void mc_msg_join_or_leave_request_handler (mc_main_t *mcm, mc_msg_join_or_leave_request_t *req, u32 buffer_index)
 
void mc_msg_join_reply_handler (mc_main_t *mcm, mc_msg_join_reply_t *mp, u32 buffer_index)
 
void mc_wait_for_stream_ready (mc_main_t *m, char *stream_name)
 
u32 mc_stream_send (mc_main_t *mcm, u32 stream_index, u32 buffer_index)
 
void mc_msg_user_request_handler (mc_main_t *mcm, mc_msg_user_request_t *mp, u32 buffer_index)
 
void mc_msg_user_ack_handler (mc_main_t *mcm, mc_msg_user_ack_t *mp, u32 buffer_index)
 
static uword mc_catchup_process (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
static void serialize_mc_stream (serialize_main_t *m, va_list *va)
 
void unserialize_mc_stream (serialize_main_t *m, va_list *va)
 
void mc_msg_catchup_request_handler (mc_main_t *mcm, mc_msg_catchup_request_t *req, u32 catchup_opaque)
 
void mc_msg_catchup_reply_handler (mc_main_t *mcm, mc_msg_catchup_reply_t *mp, u32 catchup_opaque)
 
static void perform_catchup (mc_main_t *mcm, mc_msg_catchup_reply_t *mp)
 
static void this_node_maybe_master (mc_main_t *mcm)
 
static void this_node_slave (mc_main_t *mcm)
 
static uword mc_mastership_process (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
void mc_enable_disable_mastership (mc_main_t *mcm, int we_can_be_master)
 
void mc_msg_master_assert_handler (mc_main_t *mcm, mc_msg_master_assert_t *mp, u32 buffer_index)
 
static void mc_serialize_init (mc_main_t *mcm)
 
clib_error_tmc_serialize_va (mc_main_t *mc, u32 stream_index, u32 multiple_messages_per_vlib_buffer, mc_serialize_msg_t *msg, va_list *va)
 
clib_error_tmc_serialize_internal (mc_main_t *mc, u32 stream_index, u32 multiple_messages_per_vlib_buffer, mc_serialize_msg_t *msg,...)
 
uword mc_unserialize_message (mc_main_t *mcm, mc_stream_t *s, serialize_main_t *m)
 
void mc_unserialize_internal (mc_main_t *mcm, u32 stream_and_buffer_index)
 
void mc_unserialize (mc_main_t *mcm, mc_stream_t *s, u32 buffer_index)
 
static uword mc_unserialize_process (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
void serialize_mc_main (serialize_main_t *m, va_list *va)
 
void unserialize_mc_main (serialize_main_t *m, va_list *va)
 
void mc_main_init (mc_main_t *mcm, char *tag)
 
static u8format_mc_relay_state (u8 *s, va_list *args)
 
static u8format_mc_stream_state (u8 *s, va_list *args)
 
static int mc_peer_comp (void *a1, void *a2)
 
u8format_mc_main (u8 *s, va_list *args)
 

Variables

static format_function_t format_mc_stream_state
 

Macro Definition Documentation

#define EVENT_MC_SEND_CATCHUP_DATA   0

Definition at line 1414 of file mc.c.

#define EVENT_MC_UNSERIALIZE_BUFFER   0

Definition at line 1580 of file mc.c.

#define EVENT_MC_UNSERIALIZE_CATCHUP   1

Definition at line 1581 of file mc.c.

#define MSG_ID_DEBUG   0

Definition at line 24 of file mc.c.

Function Documentation

static void check_retry ( mc_main_t mcm,
mc_stream_t s 
)
static

Definition at line 367 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void delete_peer_with_index ( mc_main_t mcm,
mc_stream_t s,
uword  index,
int  notify_application 
)
static

Definition at line 125 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword* delete_retry_fifo_elt ( mc_main_t mcm,
mc_stream_t stream,
mc_retry_t r,
uword dead_peer_bitmap 
)
static

Definition at line 298 of file mc.c.

+ Here is the caller graph for this function:

static u32 elog_id_for_msg_name ( mc_main_t m,
char *  msg_name 
)
static

Definition at line 46 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 elog_id_for_peer_id ( mc_main_t m,
u64  peer_id 
)
static

Definition at line 29 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void elog_stream_name ( char *  buf,
int  n_buf_bytes,
char *  v 
)
static

Definition at line 597 of file mc.c.

+ Here is the caller graph for this function:

static void elog_tx_msg ( mc_main_t m,
u32  stream_id,
u32  local_sequence,
u32  retry_count 
)
static

Definition at line 69 of file mc.c.

+ Here is the caller graph for this function:

u8* format_mc_main ( u8 s,
va_list *  args 
)

Definition at line 2521 of file mc.c.

+ Here is the call graph for this function:

static u8* format_mc_relay_state ( u8 s,
va_list *  args 
)
static

Definition at line 2472 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_mc_stream_state ( u8 s,
va_list *  args 
)
static

Definition at line 2495 of file mc.c.

+ Here is the call graph for this function:

static mc_stream_peer_t* get_or_create_peer_with_id ( mc_main_t mcm,
mc_stream_t s,
mc_peer_id_t  id,
int *  created 
)
static

Definition at line 156 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void maybe_send_window_open_event ( vlib_main_t vm,
mc_stream_t stream 
)
static

Definition at line 207 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mc_catchup_process ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 1417 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_enable_disable_mastership ( mc_main_t mcm,
int  we_can_be_master 
)

Definition at line 1879 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* mc_get_vlib_buffer ( vlib_main_t vm,
u32  n_bytes,
u32 bi_return 
)

Definition at line 110 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mc_internal_catchup ( mc_main_t mcm,
u8 data,
u32  n_data_bytes 
)
static

Definition at line 710 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* mc_internal_catchup_snapshot ( mc_main_t mcm,
u8 data_vector,
u32  last_global_sequence_processed 
)
static

Definition at line 695 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mc_join_ager_process ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 513 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_main_init ( mc_main_t mcm,
char *  tag 
)

Definition at line 2417 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mc_mastership_process ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 1856 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_msg_catchup_reply_handler ( mc_main_t mcm,
mc_msg_catchup_reply_t *  mp,
u32  catchup_opaque 
)

Definition at line 1584 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_msg_catchup_request_handler ( mc_main_t mcm,
mc_msg_catchup_request_t *  req,
u32  catchup_opaque 
)

Definition at line 1494 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_msg_join_or_leave_request_handler ( mc_main_t mcm,
mc_msg_join_or_leave_request_t *  req,
u32  buffer_index 
)

Definition at line 914 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_msg_join_reply_handler ( mc_main_t mcm,
mc_msg_join_reply_t *  mp,
u32  buffer_index 
)

Definition at line 971 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_msg_master_assert_handler ( mc_main_t mcm,
mc_msg_master_assert_t *  mp,
u32  buffer_index 
)

Definition at line 1891 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_msg_user_ack_handler ( mc_main_t mcm,
mc_msg_user_ack_t *  mp,
u32  buffer_index 
)

Definition at line 1223 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_msg_user_request_handler ( mc_main_t mcm,
mc_msg_user_request_t *  mp,
u32  buffer_index 
)

Definition at line 1090 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static mc_main_t* mc_node_get_main ( vlib_node_runtime_t node)
inlinestatic

Definition at line 464 of file mc.c.

+ Here is the caller graph for this function:

static int mc_peer_comp ( void *  a1,
void *  a2 
)
static

Definition at line 2512 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void mc_resend_retired ( mc_main_t mcm,
mc_stream_t s,
u32  local_sequence 
)
static

Definition at line 244 of file mc.c.

+ Here is the caller graph for this function:

static void mc_retry_free ( mc_main_t mcm,
mc_stream_t s,
mc_retry_t r 
)
static

Definition at line 222 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mc_retry_process ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 471 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_rx_buffer_unserialize ( mc_main_t mcm,
mc_stream_t stream,
mc_peer_id_t  peer_id,
u32  buffer_index 
)

Definition at line 687 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static i32 mc_seq_cmp ( u32  x,
u32  y 
)
inlinestatic

Definition at line 104 of file mc.c.

+ Here is the caller graph for this function:

static void mc_serialize_init ( mc_main_t mcm)
static

Definition at line 1973 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* mc_serialize_internal ( mc_main_t mc,
u32  stream_index,
u32  multiple_messages_per_vlib_buffer,
mc_serialize_msg_t msg,
  ... 
)

Definition at line 2076 of file mc.c.

+ Here is the call graph for this function:

MC_SERIALIZE_MSG ( mc_register_stream_name_msg  ,
static   
)

+ Here is the caller graph for this function:

clib_error_t* mc_serialize_va ( mc_main_t mc,
u32  stream_index,
u32  multiple_messages_per_vlib_buffer,
mc_serialize_msg_t msg,
va_list *  va 
)

Definition at line 1993 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 mc_stream_join ( mc_main_t mcm,
mc_stream_config_t config 
)

Definition at line 879 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 mc_stream_join_helper ( mc_main_t mcm,
mc_stream_config_t config,
u32  is_internal 
)
static

Definition at line 727 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_stream_join_process_hold ( void  )

Definition at line 722 of file mc.c.

+ Here is the caller graph for this function:

void mc_stream_leave ( mc_main_t mcm,
u32  stream_index 
)

Definition at line 885 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 mc_stream_send ( mc_main_t mcm,
u32  stream_index,
u32  buffer_index 
)

Definition at line 1016 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_unserialize ( mc_main_t mcm,
mc_stream_t s,
u32  buffer_index 
)

Definition at line 2264 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_unserialize_internal ( mc_main_t mcm,
u32  stream_and_buffer_index 
)

Definition at line 2223 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword mc_unserialize_message ( mc_main_t mcm,
mc_stream_t s,
serialize_main_t m 
)

Definition at line 2101 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword mc_unserialize_process ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 2277 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mc_wait_for_stream_ready ( mc_main_t m,
char *  stream_name 
)

Definition at line 993 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static mc_retry_t* next_retry ( mc_stream_t s,
mc_retry_t r 
)
inlinestatic

Definition at line 342 of file mc.c.

+ Here is the caller graph for this function:

static void perform_catchup ( mc_main_t mcm,
mc_msg_catchup_reply_t *  mp 
)
static

Definition at line 1594 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static mc_retry_t* prev_retry ( mc_stream_t s,
mc_retry_t r 
)
inlinestatic

Definition at line 335 of file mc.c.

+ Here is the caller graph for this function:

static void remove_retry_from_pool ( mc_stream_t s,
mc_retry_t r 
)
inlinestatic

Definition at line 349 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void send_join_or_leave_request ( mc_main_t mcm,
u32  stream_index,
u32  is_join 
)
static

Definition at line 490 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_mc_main ( serialize_main_t m,
va_list *  va 
)

Definition at line 2316 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void serialize_mc_register_stream_name ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 590 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void serialize_mc_stream ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 1449 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void this_node_maybe_master ( mc_main_t mcm)
static

Definition at line 1717 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void this_node_slave ( mc_main_t mcm)
static

Definition at line 1814 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void unserialize_mc_main ( serialize_main_t m,
va_list *  va 
)

Definition at line 2340 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void unserialize_mc_register_stream_name ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 604 of file mc.c.

+ Here is the call graph for this function:

void unserialize_mc_stream ( serialize_main_t m,
va_list *  va 
)

Definition at line 1467 of file mc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

format_function_t format_mc_stream_state
static

Definition at line 26 of file mc.c.