33 #define WORD_SIZE sizeof(u32) 142 {
"invalid/unused user index"}
251 {
"seq-id or config option",
368 #define LOG_TABLE_MAX_ENTRIES \ 369 (sizeof(spp_cnat_logger_table)/sizeof(spp_cnat_logger_table[0])) 388 u32 spp_trace_log_get_sys_up_time_in_ms (
void)
390 spp_node_main_vector_t *nmv;
393 nmv = spp_get_node_main_vectorized_inline();
395 sys_up_time = (
u32) (nmv->ticks / nmv->ticks_per_ms);
397 return (sys_up_time);
402 spp_node_main_vector_t *nmv;
405 nmv = spp_get_node_main_vectorized_inline();
407 unix_time = (
u32) (nmv->ticks / nmv->ticks_per_second);
424 spp_node_t *output_node;
426 output_node = spp_get_nodes() +
429 if (
PREDICT_TRUE(output_node->sf.nused < SPP_MAXDISPATCH)) {
433 spp_dispatch_make_node_runnable(output_node);
434 output_node->sf.ctxs[output_node->sf.nused++] =
464 spp_node_t *output_node;
467 output_node = spp_get_nodes() +
470 if (
PREDICT_TRUE(output_node->sf.nused < SPP_MAXDISPATCH)) {
474 spp_dispatch_make_node_runnable(output_node);
475 output_node->sf.ctxs[output_node->sf.nused++] =
517 void spp_trace_log_send_pkt_always_success (
519 spp_node_t *output_node)
526 output_node->sf.ctxs[output_node->sf.nused++] =
534 output_node->sf.ctxs[output_node->sf.nused++] =
543 spp_dispatch_make_node_runnable(output_node);
558 void spp_create_trace_log_context (
570 spp_trace_log_send_queued_pkt(trace_logging_info);
586 if (spp_ctx_alloc(&ctx, 1) < 1) {
595 spp_trace_log_get_sys_up_time_in_ms();
597 ctx->flags = SPP_CTX_END_OF_PACKET;
599 ctx->ru.tx.dst_ip_port_idx = EXT_TRACE_BACKUP_INDEX;
600 ctx->next_ctx_this_packet = (
spp_ctx_t*) SPP_CTX_NO_NEXT_CTX;
602 ctx->current_length = 0;
631 spp_host_to_net_byte_order_32(0);
667 spp_trace_log_info_pool +
671 spp_create_trace_log_context(trace_logging_info);
682 spp_trace_log_add_record_create(trace_logging_info);
689 spp_host_to_net_byte_order_16(error_code);
691 spp_host_to_net_byte_order_16(num_args);
693 for (i = 0; i < num_args; i++) {
695 spp_host_to_net_byte_order_32(*(arg + i));
725 spp_trace_log_send_pkt(trace_logging_info);
739 void spp_trace_log_timer_handler (
spp_timer_t * timer_p)
741 spp_node_t *output_node;
743 u32 current_timestamp = spp_trace_log_get_sys_up_time_in_ms();
746 output_node = spp_get_nodes() +
749 sf_nused = output_node->sf.nused;
751 pool_foreach (trace_logging_info, spp_trace_log_info_pool, ({
769 spp_trace_log_send_pkt_always_success(trace_logging_info,
776 spp_timer_in_n_ms_inline(1000);
781 void spp_sensor_timer_handler (
spp_timer_t * timer_p)
783 #ifdef TARGET_RODDICK 790 spp_timer_in_n_ms_inline(60000);
810 pool_foreach (my_spp_log_info, spp_trace_log_info_pool, ({
811 if (my_spp_log_info->
log_type == log_type) {
821 pool_get(spp_trace_log_info_pool, my_spp_log_info);
822 memset(my_spp_log_info, 0,
sizeof(*my_spp_log_info));
831 my_spp_log_info->
log_type = log_type;
853 #ifdef TARGET_RODDICK 855 spp_lookup_node_index(
"roddick_infra_l3_tx");
856 #elif defined(TARGET_BOOSTER) 858 spp_lookup_node_index(
"booster_infra_l3_tx");
865 spp_timer_in_n_ms_inline(1000);
872 spp_timer_in_n_ms_inline(60000);
881 #ifdef TARGET_RODDICK 882 dst_ipv4_port_table[EXT_TRACE_BACKUP_INDEX].ipv4_address =
883 vpp_boot_params.msc_ip_address;
884 switch(vpp_boot_params.octeon_number) {
886 dst_ipv4_port_table[EXT_TRACE_BACKUP_INDEX].port = 0x15BF;
889 dst_ipv4_port_table[EXT_TRACE_BACKUP_INDEX].port = 0x15BF;
892 dst_ipv4_port_table[EXT_TRACE_BACKUP_INDEX].port = 0x15BF;
895 dst_ipv4_port_table[EXT_TRACE_BACKUP_INDEX].port = 0x15BF;
899 dst_ipv4_port_table[EXT_TRACE_BACKUP_INDEX].ipv4_address = 0x01020304;
900 dst_ipv4_port_table[EXT_TRACE_BACKUP_INDEX].port = 0x15BF;
908 u32 current_timestamp;
909 spp_node_main_vector_t *nmv;
920 nmv = spp_get_node_main_vectorized_inline();
921 current_timestamp = nmv->ticks / nmv->ticks_per_second;
926 #ifdef TARGET_RODDICK || defined(TARGET_BOOSTER) 931 printf(
"PKT DUMP :: ");
932 for (j = 0 ; j < num_args; j++) {
933 printf(
"0x%x ", arg[j]);
934 if (j == (num_args - 1)) {
940 spp_cnat_logger_table[error_code].rate_limit_time)) {
944 #ifdef TARGET_RODDICK || defined(TARGET_BOOSTER) 949 for (j = 0 ; j < num_args; j++) {
950 printf(
"%s: %d ", spp_cnat_logger_table[error_code].param_name[j], arg[j]);
951 if (j == (num_args - 1)) {
u16 spp_timer_register_callback(void(*fp)(spp_timer_t *))
sll srl srl sll sra u16x4 i
static vlib_main_t * vlib_get_main(void)
Fixed length block allocator.
static f64 vlib_time_now(vlib_main_t *vm)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
u64 spp_trace_log_downstream_constipation_count
spp_ctx_t * current_logging_context
spp_trace_log_t * log_record
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
int vlib_main(vlib_main_t *vm, unformat_input_t *input)
u8 spp_trace_log_init_done
u16 max_length_minus_max_record_size
u64 spp_trace_log_context_creation_deferred_count
void spp_timer_start(spp_timer_t *tp)
u32 current_logging_context_timestamp
spp_ctx_t * queued_logging_context
u32 spp_log_pool_index[SPP_LOG_MAX]
Bitmaps built as vectors of machine words.
struct _spp_ctx spp_ctx_t
spp_trace_log_hdr_t * log_header
u16 spp_trace_log_disp_node_index
u64 spp_trace_log_context_creation_fail_count
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".