65 s =
format (s,
"CACHE: flow_label %d, next index %d",
70 #define foreach_cache_ts_error \ 71 _(RECORDED, "ip6 iOAM headers cached") 75 #define _(sym,str) CACHE_TS_ERROR_##sym, 82 #define _(sym,string) string, 99 u32 n_left_from, *from, *to_next;
107 while (n_left_from > 0)
113 while (n_left_from > 0 && n_left_to_next > 0)
122 u32 cache_ts_index = 0;
123 u8 cache_thread_id = 0;
133 if (IP_PROTOCOL_TCP ==
150 (tcp0->ack_number), &hbh_cmp,
152 &cache_thread_id, 1))
194 if (0 ==
ioam_cache_ts_lookup (ip0, hbh0->
protocol, clib_net_to_host_u16 (tcp0->src_port), clib_net_to_host_u16 (tcp0->dst_port), clib_net_to_host_u32 (tcp0->ack_number), &hbh_cmp, &cache_ts_index, &cache_thread_id, 1))
223 to_next, n_left_to_next,
231 CACHE_TS_ERROR_RECORDED, recorded);
242 .name =
"ip6-ioam-tunnel-select",
243 .vector_size =
sizeof (
u32),
273 format (s,
"IP6_IOAM_RESET_TUNNEL_SELECT_HBH: next index %d",
280 #define foreach_ip6_reset_ts_hbh_error \ 281 _(PROCESSED, "iOAM Syn/Ack Pkts processed") \ 282 _(SAVED, "iOAM Syn Pkts state saved") \ 283 _(REMOVED, "iOAM Syn/Ack Pkts state removed") 287 #define _(sym,str) IP6_RESET_TS_HBH_ERROR_##sym, 294 #define _(sym,string) string, 299 #define foreach_ip6_ioam_cache_ts_input_next \ 300 _(IP6_LOOKUP, "ip6-lookup") \ 301 _(DROP, "error-drop") 305 #define _(s,n) IP6_IOAM_CACHE_TS_INPUT_NEXT_##s, 317 u32 n_left_from, *from, *to_next;
319 u32 processed = 0, cache_ts_added = 0;
323 ioam_e2e_cache_option_t *e2e = 0;
330 while (n_left_from > 0)
337 while (n_left_from >= 4 && n_left_to_next >= 2)
344 u32 tcp_offset0, tcp_offset1;
346 u64 *copy_src0, *copy_dst0, *copy_src1, *copy_dst1;
348 u32 pool_index0 = 0, pool_index1 = 0;
350 next0 = next1 = IP6_IOAM_CACHE_TS_INPUT_NEXT_IP6_LOOKUP;
366 to_next[0] = bi0 = from[0];
367 to_next[1] = bi1 = from[1];
379 if (IP_PROTOCOL_TCP !=
388 if (no_of_responses > 0)
397 (tcp0->seq_number) + 1,
398 no_of_responses, now,
404 copy_dst0 = (
u64 *) (((
u8 *) ip0) - rewrite_length);
405 copy_src0 = (
u64 *) ip0;
407 copy_dst0[0] = copy_src0[0];
408 copy_dst0[1] = copy_src0[1];
409 copy_dst0[2] = copy_src0[2];
410 copy_dst0[3] = copy_src0[3];
411 copy_dst0[4] = copy_src0[4];
420 (ioam_e2e_cache_option_t *) ((
u8 *) hbh0 +
423 e2e->pool_index = pool_index0;
426 sizeof (ioam_e2e_cache_option_t)),
438 if (IP_PROTOCOL_TCP !=
447 if (no_of_responses > 0)
456 (tcp1->seq_number) + 1,
457 no_of_responses, now,
464 copy_dst1 = (
u64 *) (((
u8 *) ip1) - rewrite_length);
465 copy_src1 = (
u64 *) ip1;
467 copy_dst1[0] = copy_src1[0];
468 copy_dst1[1] = copy_src1[1];
469 copy_dst1[2] = copy_src1[2];
470 copy_dst1[3] = copy_src1[3];
471 copy_dst1[4] = copy_src1[4];
480 (ioam_e2e_cache_option_t *) ((
u8 *) hbh1 +
483 e2e->pool_index = pool_index1;
486 sizeof (ioam_e2e_cache_option_t)),
517 to_next, n_left_to_next,
518 bi0, bi1, next0, next1);
520 while (n_left_from > 0 && n_left_to_next > 0)
529 u64 *copy_src0, *copy_dst0;
533 next0 = IP6_IOAM_CACHE_TS_INPUT_NEXT_IP6_LOOKUP;
545 if (IP_PROTOCOL_TCP !=
554 if (no_of_responses > 0)
563 (tcp0->seq_number) + 1,
564 no_of_responses, now,
570 copy_dst0 = (
u64 *) (((
u8 *) ip0) - rewrite_length);
571 copy_src0 = (
u64 *) ip0;
573 copy_dst0[0] = copy_src0[0];
574 copy_dst0[1] = copy_src0[1];
575 copy_dst0[2] = copy_src0[2];
576 copy_dst0[3] = copy_src0[3];
577 copy_dst0[4] = copy_src0[4];
586 (ioam_e2e_cache_option_t *) ((
u8 *) hbh0 +
589 e2e->pool_index = pool_index0;
592 sizeof (ioam_e2e_cache_option_t)),
613 to_next, n_left_to_next,
621 IP6_RESET_TS_HBH_ERROR_PROCESSED, processed);
623 IP6_RESET_TS_HBH_ERROR_SAVED, cache_ts_added);
632 .name =
"ip6-add-syn-hop-by-hop",
633 .vector_size =
sizeof (
u32),
642 #define _(s,n) [IP6_IOAM_CACHE_TS_INPUT_NEXT_##s] = n, 667 s =
format (s,
"IOAM_CACHE_TS_TIMER_TICK: thread index %d",
672 #define foreach_ioam_cache_ts_timer_tick_error \ 673 _(TIMER, "Timer events") 677 #define _(sym,str) IOAM_CACHE_TS_TIMER_TICK_ERROR_##sym, 684 #define _(sym,string) string, 694 0 ? VLIB_NODE_STATE_DISABLED :
695 VLIB_NODE_STATE_POLLING);
707 for (i = 0; i <
vec_len (expired_timers); i++)
710 pool_index = expired_timers[
i] & 0x0FFFFFFF;
718 IOAM_CACHE_TS_TIMER_TICK_ERROR_TIMER, count);
728 struct timespec ts, tsrem;
730 tw_timer_expire_timers_16t_2w_512sl (&cm->
timer_wheels[my_thread_index],
734 while (nanosleep (&ts, &tsrem) < 0)
744 .name =
"ioam-cache-ts-timer-tick",
753 .state = VLIB_NODE_STATE_DISABLED,
ip_lookup_next_t
Common (IP4/IP6) next index stored in adjacency.
u8 rewrite_pool_index_offset
ip6_address_t sr_localsid_ts
sll srl srl sll sra u16x4 i
static f64 vlib_time_now(vlib_main_t *vm)
static int ip6_ioam_analyse_compare_path_delay(ip6_hop_by_hop_header_t *hbh0, ip6_hop_by_hop_header_t *hbh1, bool oneway)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
struct _vlib_node_registration vlib_node_registration_t
static int ioam_cache_ts_update(u32 thread_id, i32 pool_index, u32 buffer_index, ip6_hop_by_hop_header_t *hbh)
struct _tcp_header tcp_header_t
static char * ip6_reset_ts_hbh_error_strings[]
#define foreach_ip6_ioam_cache_ts_input_next
vlib_node_registration_t ioam_cache_ts_node
(constructor) VLIB_REGISTER_NODE (ioam_cache_ts_node)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static int ioam_cache_ts_add(ip6_header_t *ip0, u16 src_port, u16 dst_port, u32 seq_no, u8 max_responses, u64 now, u32 thread_id, u32 *pool_index)
#define foreach_ip6_reset_ts_hbh_error
ioam_cache_ts_timer_tick_error_t
tw_timer_wheel_16t_2w_512sl_t * timer_wheels
per thread single-wheel
static void ioam_cache_ts_check_and_send(u32 thread_id, i32 pool_index)
#define foreach_ioam_cache_ts_timer_tick_error
static void ioam_e2e_id_rewrite_handler(ioam_e2e_id_option_t *e2e_option, ip6_address_t *address)
vlib_node_registration_t ip6_reset_ts_hbh_node
(constructor) VLIB_REGISTER_NODE (ip6_reset_ts_hbh_node)
vlib_node_registration_t ioam_cache_ts_timer_tick_node
(constructor) VLIB_REGISTER_NODE (ioam_cache_ts_timer_tick_node)
uword os_get_cpu_number(void)
void ioam_cache_ts_timer_node_enable(vlib_main_t *vm, u8 enable)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
void expired_cache_ts_timer_callback(u32 *expired_timers)
static int ioam_cache_ts_lookup(ip6_header_t *ip0, u8 protocol, u16 src_port, u16 dst_port, u32 seq_no, ip6_hop_by_hop_header_t **hbh, u32 *pool_index, u8 *thread_id, u8 response_seen)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static u8 * format_ioam_cache_ts_timer_tick_trace(u8 *s, va_list *args)
#define CLIB_PREFETCH(addr, size, type)
#define VLIB_BUFFER_IS_TRACED
#define clib_memcpy(a, b, c)
static u8 * format_cache_ts_trace(u8 *s, va_list *args)
static uword ip6_reset_ts_hbh_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
ip6_ioam_cache_ts_input_next_t
static uword ioam_cache_ts_timer_tick_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define VLIB_NODE_FLAG_TRACE
static void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
static void ioam_cache_ts_send(u32 thread_id, i32 pool_index)
static int ip6_locate_header(vlib_buffer_t *p0, ip6_header_t *ip0, int find_hdr_type, u32 *offset)
#define foreach_cache_ts_error
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static uword ip6_ioam_cache_ts_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static char * cache_ts_error_strings[]
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
static u8 * format_ip6_reset_ts_hbh_trace(u8 *s, va_list *args)
Segment Routing data structures definitions.
#define VLIB_REGISTER_NODE(x,...)
static char * ioam_cache_ts_timer_tick_error_strings[]
u16 flags
Copy of main node flags.
ioam_cache_main_t ioam_cache_main
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define IOAM_CACHE_TS_TICK