|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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,
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))
159 cm->criteria_oneway);
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))
206 if (p0->
flags & VLIB_BUFFER_IS_TRACED)
223 to_next, n_left_to_next,
231 CACHE_TS_ERROR_RECORDED, recorded);
232 return frame->n_vectors;
242 .name =
"ip6-ioam-tunnel-select",
243 .vector_size =
sizeof (
u32),
273 format (s,
"IP6_IOAM_RESET_TUNNEL_SELECT_HBH: next index %d",
278 #define foreach_ip6_reset_ts_hbh_error \
279 _(PROCESSED, "iOAM Syn/Ack Pkts processed") \
280 _(SAVED, "iOAM Syn Pkts state saved") \
281 _(REMOVED, "iOAM Syn/Ack Pkts state removed")
285 #define _(sym,str) IP6_RESET_TS_HBH_ERROR_##sym,
292 #define _(sym,string) string,
297 #define foreach_ip6_ioam_cache_ts_input_next \
298 _(IP6_LOOKUP, "ip6-lookup") \
299 _(DROP, "error-drop")
303 #define _(s,n) IP6_IOAM_CACHE_TS_INPUT_NEXT_##s,
317 u32 processed = 0, cache_ts_added = 0;
321 ioam_e2e_cache_option_t *e2e = 0;
322 u8 no_of_responses =
cm->wait_for_responses;
342 u32 tcp_offset0, tcp_offset1;
344 u64 *copy_src0, *copy_dst0, *copy_src1, *copy_dst1;
346 u32 pool_index0 = 0, pool_index1 = 0;
348 next0 = next1 = IP6_IOAM_CACHE_TS_INPUT_NEXT_IP6_LOOKUP;
364 to_next[0] = bi0 =
from[0];
365 to_next[1] = bi1 =
from[1];
377 if (IP_PROTOCOL_TCP !=
386 if (no_of_responses > 0)
395 (tcp0->seq_number) + 1,
396 no_of_responses,
now,
402 copy_dst0 = (
u64 *) (((
u8 *) ip0) - rewrite_length);
403 copy_src0 = (
u64 *) ip0;
405 copy_dst0[0] = copy_src0[0];
406 copy_dst0[1] = copy_src0[1];
407 copy_dst0[2] = copy_src0[2];
408 copy_dst0[3] = copy_src0[3];
409 copy_dst0[4] = copy_src0[4];
418 (ioam_e2e_cache_option_t *) ((
u8 *) hbh0 +
419 cm->rewrite_pool_index_offset);
421 e2e->pool_index = pool_index0;
424 sizeof (ioam_e2e_cache_option_t)),
425 &
cm->sr_localsid_ts);
436 if (IP_PROTOCOL_TCP !=
445 if (no_of_responses > 0)
454 (tcp1->seq_number) + 1,
455 no_of_responses,
now,
462 copy_dst1 = (
u64 *) (((
u8 *) ip1) - rewrite_length);
463 copy_src1 = (
u64 *) ip1;
465 copy_dst1[0] = copy_src1[0];
466 copy_dst1[1] = copy_src1[1];
467 copy_dst1[2] = copy_src1[2];
468 copy_dst1[3] = copy_src1[3];
469 copy_dst1[4] = copy_src1[4];
478 (ioam_e2e_cache_option_t *) ((
u8 *) hbh1 +
479 cm->rewrite_pool_index_offset);
481 e2e->pool_index = pool_index1;
484 sizeof (ioam_e2e_cache_option_t)),
485 &
cm->sr_localsid_ts);
498 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
504 if (b1->
flags & VLIB_BUFFER_IS_TRACED)
515 to_next, n_left_to_next,
516 bi0, bi1, next0, next1);
527 u64 *copy_src0, *copy_dst0;
531 next0 = IP6_IOAM_CACHE_TS_INPUT_NEXT_IP6_LOOKUP;
543 if (IP_PROTOCOL_TCP !=
552 if (no_of_responses > 0)
561 (tcp0->seq_number) + 1,
562 no_of_responses,
now,
568 copy_dst0 = (
u64 *) (((
u8 *) ip0) - rewrite_length);
569 copy_src0 = (
u64 *) ip0;
571 copy_dst0[0] = copy_src0[0];
572 copy_dst0[1] = copy_src0[1];
573 copy_dst0[2] = copy_src0[2];
574 copy_dst0[3] = copy_src0[3];
575 copy_dst0[4] = copy_src0[4];
584 (ioam_e2e_cache_option_t *) ((
u8 *) hbh0 +
585 cm->rewrite_pool_index_offset);
587 e2e->pool_index = pool_index0;
590 sizeof (ioam_e2e_cache_option_t)),
591 &
cm->sr_localsid_ts);
602 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
611 to_next, n_left_to_next,
619 IP6_RESET_TS_HBH_ERROR_PROCESSED, processed);
621 IP6_RESET_TS_HBH_ERROR_SAVED, cache_ts_added);
623 return frame->n_vectors;
629 .name =
"ip6-add-syn-hop-by-hop",
630 .vector_size =
sizeof (
u32),
639 #define _(s,n) [IP6_IOAM_CACHE_TS_INPUT_NEXT_##s] = n,
647 #ifndef CLIB_MARCH_VARIANT
665 s =
format (s,
"IOAM_CACHE_TS_TIMER_TICK: thread index %d",
670 #define foreach_ioam_cache_ts_timer_tick_error \
671 _(TIMER, "Timer events")
675 #define _(sym,str) IOAM_CACHE_TS_TIMER_TICK_ERROR_##sym,
682 #define _(sym,string) string,
687 #ifndef CLIB_MARCH_VARIANT
693 0 ? VLIB_NODE_STATE_DISABLED :
694 VLIB_NODE_STATE_POLLING);
706 for (
i = 0;
i <
vec_len (expired_timers);
i++)
709 pool_index = expired_timers[
i] & 0x0FFFFFFF;
717 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,
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)
ioam_cache_main_t ioam_cache_main
void ioam_cache_ts_timer_node_enable(vlib_main_t *vm, u8 enable)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
void expired_cache_ts_timer_callback(u32 *expired_timers)
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
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_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
@ IOAM_CACHE_TS_ERROR_NEXT_DROP
struct _tcp_header tcp_header_t
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
static void ioam_cache_ts_check_and_send(u32 thread_id, i32 pool_index)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static u8 * format_ip6_reset_ts_hbh_trace(u8 *s, va_list *args)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
vlib_node_registration_t ioam_cache_ts_timer_tick_node
(constructor) VLIB_REGISTER_NODE (ioam_cache_ts_timer_tick_node)
static char * ioam_cache_ts_timer_tick_error_strings[]
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)
ip6_ioam_cache_ts_input_next_t
ioam_cache_ts_timer_tick_error_t
#define CLIB_PREFETCH(addr, size, type)
Segment Routing data structures definitions.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define VLIB_NODE_FN(node)
static char * cache_ts_error_strings[]
static void ioam_cache_ts_send(u32 thread_id, i32 pool_index)
static u8 * format_ioam_cache_ts_timer_tick_trace(u8 *s, va_list *args)
#define foreach_ioam_cache_ts_timer_tick_error
#define VLIB_NODE_FLAG_TRACE
static_always_inline uword vlib_get_thread_index(void)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
@ IP6_RESET_TS_HBH_N_ERROR
#define foreach_ip6_ioam_cache_ts_input_next
static u8 * format_cache_ts_trace(u8 *s, va_list *args)
@ IP6_IOAM_CACHE_TS_INPUT_N_NEXT
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
@ IOAM_CACHE_TS_NEXT_POP_HBYH
sll srl srl sll sra u16x4 i
vnet_feature_config_main_t * cm
static int ip6_locate_header(vlib_buffer_t *p0, ip6_header_t *ip0, int find_hdr_type, u32 *offset)
#define CLIB_CACHE_LINE_BYTES
struct _vlib_node_registration vlib_node_registration_t
static uword ip6_ioam_cache_ts_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
@ IOAM_CACHE_TS_TIMER_TICK_N_ERROR
static void ioam_e2e_id_rewrite_handler(ioam_e2e_id_option_t *e2e_option, ip6_address_t *address)
ip_lookup_next_t
An adjacency is a representation of an attached L3 peer.
#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.
description fragment has unexpected format
vlib_node_registration_t ip6_reset_ts_hbh_node
(constructor) VLIB_REGISTER_NODE (ip6_reset_ts_hbh_node)
vlib_put_next_frame(vm, node, next_index, 0)
vlib_node_registration_t ioam_cache_ts_node
(constructor) VLIB_REGISTER_NODE (ioam_cache_ts_node)
#define IOAM_CACHE_TS_TICK
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#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.
static f64 vlib_time_now(vlib_main_t *vm)
static char * ip6_reset_ts_hbh_error_strings[]
#define foreach_cache_ts_error
#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).
#define foreach_ip6_reset_ts_hbh_error
vl_api_fib_path_type_t type
static int ip6_ioam_analyse_compare_path_delay(ip6_hop_by_hop_header_t *hbh0, ip6_hop_by_hop_header_t *hbh1, bool oneway)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
static int ioam_cache_ts_update(u32 thread_id, i32 pool_index, u32 buffer_index, ip6_hop_by_hop_header_t *hbh)