65 s =
format (s,
"CACHE: flow_label %d, next index %d",
70 #define foreach_cache_error \ 71 _(RECORDED, "ip6 iOAM headers cached") 75 #define _(sym,str) CACHE_ERROR_##sym, 82 #define _(sym,string) string, 97 u32 n_left_from, *from, *to_next;
105 while (n_left_from > 0)
111 while (n_left_from > 0 && n_left_to_next > 0)
131 if (IP_PROTOCOL_TCP ==
145 (tcp0->dst_port), hbh0,
147 (tcp0->seq_number) + 1))
155 if (p0->
flags & VLIB_BUFFER_IS_TRACED)
167 to_next, n_left_to_next,
175 CACHE_ERROR_RECORDED, recorded);
186 .name =
"ip6-ioam-cache",
187 .vector_size =
sizeof (
u32),
220 #define foreach_ip6_add_from_cache_hbh_error \ 221 _(PROCESSED, "Pkts w/ added ip6 hop-by-hop options") 225 #define _(sym,str) IP6_ADD_FROM_CACHE_HBH_ERROR_##sym, 232 #define _(sym,string) string, 237 #define foreach_ip6_ioam_cache_input_next \ 238 _(IP6_LOOKUP, "ip6-lookup") \ 239 _(DROP, "error-drop") 243 #define _(s,n) IP6_IOAM_CACHE_INPUT_NEXT_##s, 255 u32 n_left_from, *from, *to_next;
263 n_left_from =
frame->n_vectors;
264 next_index =
node->cached_next_index;
266 while (n_left_from > 0)
272 while (n_left_from > 0 && n_left_to_next > 0)
280 u64 *copy_src0, *copy_dst0;
286 next0 = IP6_IOAM_CACHE_INPUT_NEXT_IP6_LOOKUP;
298 if (IP_PROTOCOL_TCP !=
314 (tcp0->ack_number))))
317 rewrite_len =
vec_len (rewrite);
321 next0 = IP6_IOAM_CACHE_INPUT_NEXT_DROP;
330 copy_dst0 = (
u64 *) (((
u8 *) ip0) - (rewrite_len + sr_rewrite_len));
331 copy_src0 = (
u64 *) ip0;
333 copy_dst0[0] = copy_src0[0];
334 copy_dst0[1] = copy_src0[1];
335 copy_dst0[2] = copy_src0[2];
336 copy_dst0[3] = copy_src0[3];
337 copy_dst0[4] = copy_src0[4];
348 sizeof (ip6_address_t));
351 sizeof (ip6_address_t));
354 sizeof (ip6_address_t));
362 clib_net_to_host_u16 (ip0->payload_length) + rewrite_len +
364 ip0->payload_length = clib_host_to_net_u16 (new_l0);
368 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
377 to_next, n_left_to_next,
385 IP6_ADD_FROM_CACHE_HBH_ERROR_PROCESSED,
387 return frame->n_vectors;
392 .name =
"ip6-add-from-cache-hop-by-hop",
393 .vector_size =
sizeof (
u32),
402 #define _(s,n) [IP6_IOAM_CACHE_INPUT_NEXT_##s] = n,
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static ioam_cache_entry_t * ioam_cache_lookup(ip6_header_t *ip0, u16 src_port, u16 dst_port, u32 seq_no)
#define clib_memcpy_fast(a, b, c)
#define foreach_cache_error
static uword ip6_ioam_cache_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define VLIB_NODE_FN(node)
static u8 * format_ip6_add_from_cache_hbh_trace(u8 *s, va_list *args)
struct _tcp_header tcp_header_t
ip_lookup_next_t
An adjacency is a representation of an attached L3 peer.
static int ioam_cache_add(vlib_buffer_t *b0, ip6_header_t *ip0, u16 src_port, u16 dst_port, ip6_hop_by_hop_header_t *hbh0, u32 seq_no)
#define foreach_ip6_add_from_cache_hbh_error
#define IPPROTO_IPV6_ROUTE
vl_api_fib_path_type_t type
static char * cache_error_strings[]
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static void ioam_cache_entry_free(ioam_cache_entry_t *entry)
#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)
ip6_ioam_cache_input_next_t
ip6_add_from_cache_hbh_error_t
#define VLIB_REGISTER_NODE(x,...)
#define foreach_ip6_ioam_cache_input_next
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.
vlib_main_t vlib_node_runtime_t * node
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static int ip6_locate_header(vlib_buffer_t *p0, ip6_header_t *ip0, int find_hdr_type, u32 *offset)
vlib_node_registration_t ip6_add_from_cache_hbh_node
(constructor) VLIB_REGISTER_NODE (ip6_add_from_cache_hbh_node)
static char * ip6_add_from_cache_hbh_error_strings[]
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
ioam_cache_main_t ioam_cache_main
u16 flags
Copy of main node flags.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static u8 * format_cache_trace(u8 *s, va_list *args)
#define VLIB_NODE_FLAG_TRACE
u32 ip6_add_from_cache_hbh_node_index
vlib_node_registration_t ioam_cache_node
(constructor) VLIB_REGISTER_NODE (ioam_cache_node)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.