63 f64 delay = 1e-6 * us;
105 uword main_heap_size = (1ULL << 30);
111 const char *msg =
"ERROR: This binary requires CPU with %s extensions.\n";
113 if (!clib_cpu_supports_ ## a ()) \ 115 fprintf(stderr, msg, b); \ 143 if ((argc == 3) && !strncmp (argv[1],
"-c", 2))
152 fp = fopen (argv[2],
"r");
155 fprintf (stderr,
"open configuration file '%s' failed\n", argv[2]);
158 argv_ = calloc (1,
sizeof (
char *));
161 arg = strndup (argv[0], 1024);
168 if (fgets (inbuf, 4096, fp) == 0)
170 p = strtok (inbuf,
" \t\n");
176 char **tmp = realloc (argv_, argc_ *
sizeof (
char *));
180 arg = strndup (p, 1024);
183 argv_[argc_ - 1] = arg;
184 p = strtok (
NULL,
" \t\n");
190 char **tmp = realloc (argv_, (argc_ + 1) *
sizeof (
char *));
207 for (i = 1; i < (argc - 1); i++)
209 if (!strncmp (argv[i],
"plugin_path", 11))
214 else if (!strncmp (argv[i],
"heapsize", 8))
216 sizep = (
u8 *) argv[i + 1];
218 while (*sizep >=
'0' && *sizep <=
'9')
221 size += *sizep++ -
'0';
227 "warning: heapsize parse error '%s', use default %lld\n",
228 argv[i], (
long long int) main_heap_size);
232 main_heap_size =
size;
234 if (*sizep ==
'g' || *sizep ==
'G')
235 main_heap_size <<= 30;
236 else if (*sizep ==
'm' || *sizep ==
'M')
237 main_heap_size <<= 20;
264 int rv __attribute__ ((unused)) =
265 write (2,
"Main heap allocation failure!\r\n", 31);
330 static int recursion_block;
378 u64 *p = (
u64 *) 0xdefec8ed;
388 .path =
"test crash",
389 .short_help =
"crash the bus!",
sll srl srl sll sra u16x4 i
void vl_msg_api_barrier_sync(void)
vlib_node_runtime_t node_runtime
int main(int argc, char *argv[])
static vlib_main_t * vlib_get_main(void)
int rte_delay_us_override(unsigned us)
#define vlib_mark_init_function_complete(vm, x)
static void dpdk_pmd_constructor_init()
uword admin_up_down_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
void vl_msg_api_set_first_available_msg_id(u16 first_avail)
ethernet_main_t * ethernet_main
static uword vlib_process_suspend(vlib_main_t *vm, f64 dt)
Suspend a vlib cooperative multi-tasking thread for a period of time.
ethernet_main_t ethernet_main
vnet_main_t * vnet_get_main(void)
vlib_node_function_t * function
void vl_msg_api_barrier_release(void)
static void vpe_main_init(vlib_main_t *vm)
void vlib_set_get_handoff_structure_cb(void *cb)
void vl_msg_api_post_mortem_dump(void)
void vlib_unix_cli_set_prompt(char *prompt)
Set the CLI prompt.
uword os_get_cpu_number(void)
static clib_error_t * plugin_path_config(vlib_main_t *vm, unformat_input_t *input)
#define VLIB_CONFIG_FUNCTION(x, n,...)
void vhost_user_unmap_all(void)
uword * init_functions_called
void * clib_mem_init(void *heap, uword size)
static vlib_process_t * vlib_get_current_process(vlib_main_t *vm)
#define vec_free(V)
Free vector's memory (no header).
vlib_main_t vlib_global_main
void vlib_worker_thread_barrier_sync(vlib_main_t *vm)
#define hash_create(elts, value_bytes)
u32 vlib_app_num_thread_stacks_needed(void)
void * vnet_get_handoff_structure(void)
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
clib_error_t * unix_physmem_init(vlib_main_t *vm, int physical_memory_required)
int vlib_unix_main(int argc, char *argv[])
static uword vlib_in_process_context(vlib_main_t *vm)
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
static clib_error_t * heapsize_config(vlib_main_t *vm, unformat_input_t *input)
static clib_error_t * srp_init(vlib_main_t *vm)
static clib_error_t * test_crash_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_error_return(e, args...)
#define VLIB_PROCESS_IS_RUNNING