60 #ifndef CLIB_MARCH_VARIANT 66 interface_output_trace_t *t = va_arg (*va, interface_output_trace_t *);
111 interface_output_trace_t *t0, *t1;
123 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
131 if (b1->
flags & VLIB_BUFFER_IS_TRACED)
147 interface_output_trace_t *t0;
153 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
170 b->
flags & VNET_BUFFER_F_IS_IP6);
181 u32 n_bytes0, n_bytes1, n_bytes2, n_bytes3;
199 ASSERT (b[0]->current_length > 0);
200 ASSERT (b[1]->current_length > 0);
201 ASSERT (b[2]->current_length > 0);
202 ASSERT (b[3]->current_length > 0);
211 u32 tx_swif0, tx_swif1, tx_swif2, tx_swif3;
243 if (do_tx_offloads && (or_flags & VNET_BUFFER_F_OFFLOAD))
259 ASSERT (b[0]->current_length > 0);
289 int sw_if_index_from_buffer)
299 if (sw_if_index_from_buffer == 0)
310 while (n_left_from > 0)
317 if (sw_if_index_from_buffer)
355 n_copy =
clib_min (n_vectors, n_free);
492 .name =
"interface-output-template",
493 .vector_size =
sizeof (
u32),
503 u32 n_left_to_next, *
from, *to_next;
509 n_left_from =
frame->n_vectors;
512 next_index = node->cached_next_index;
514 while (n_left_from > 0)
518 while (n_left_from >= 4 && n_left_to_next >= 2)
520 u32 bi0, bi1, next0, next1;
553 n_left_to_next, bi0, bi1, next0,
557 while (n_left_from > 0 && n_left_to_next > 0)
580 n_left_to_next, bi0, next0);
586 return frame->n_vectors;
621 s =
format (s,
"IP4: %U -> %U",
625 s =
format (s,
"IP6: %U -> %U",
657 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
664 if (b1->
flags & VLIB_BUFFER_IS_TRACED)
685 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
709 if (b->
flags & VNET_BUFFER_F_L2_HDR_OFFSET_VALID)
727 case ETHERNET_TYPE_IP4:
728 ip4 = (
void *) (eh + 1);
735 case ETHERNET_TYPE_IP6:
736 ip6 = (
void *) (eh + 1);
740 sizeof (ip6_address_t));
742 sizeof (ip6_address_t));
758 vnet_error_disposition_t disposition)
785 while (n_trace && n_left)
862 sw_if_index = sw_if_indices +
off;
891 i16 save_current_data;
892 u16 save_current_length;
929 if (b0->
flags & VNET_BUFFER_F_L2_HDR_OFFSET_VALID)
942 u32 error_node_index;
946 int error_string_len =
954 drop_string_len = error_string_len +
vec_len (n->
name) + 2;
957 while (last->
flags & VLIB_BUFFER_NEXT_PRESENT)
978 b0->
flags &= ~(VLIB_BUFFER_TOTAL_LENGTH_VALID);
998 #ifndef CLIB_MARCH_VARIANT 1037 .name =
"error-drop",
1038 .vector_size =
sizeof (
u32),
1050 .name =
"error-punt",
1051 .vector_size =
sizeof (
u32),
1062 .name =
"interface-output",
1063 .vector_size =
sizeof (
u32),
1083 n_left =
frame->n_vectors;
1110 n_left =
frame->n_vectors;
1111 swif = sw_if_indices[0];
1159 else if (n_free >= n_comp)
1188 used_elts[
i] |= mask[
i];
1203 .name =
"interface-output-arc-end",
1204 .vector_size =
sizeof (
u32),
1212 .arc_name =
"interface-output",
1214 .last_in_arc =
"interface-output-arc-end",
1219 .arc_name =
"interface-output",
1220 .node_name =
"span-output",
1225 .arc_name =
"interface-output",
1226 .node_name =
"ipsec-if-output",
1231 .arc_name =
"interface-output",
1232 .node_name =
"interface-output-arc-end",
1236 #ifndef CLIB_MARCH_VARIANT 1249 (vnm->
vlib_main, vnet_per_buffer_interface_output_node.index,
1266 (vnm->
vlib_main, vnet_per_buffer_interface_output_node.index, node_index);
vnet_hw_if_output_node_runtime_t * output_node_thread_runtimes
u8 * format_vnet_interface_output_trace(u8 *s, va_list *va)
vnet_config_main_t config_main
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
vnet_hw_if_tx_frame_t frame
vnet_hw_if_tx_frame_t * tf
clib_mask_compare_u32(swif, sw_if_indices, mask, frame->n_vectors)
VNET_FEATURE_ARC_INIT(interface_output, static)
#define hash_set(h, key, value)
void vnet_set_interface_output_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
Set interface output node - for interface registered without its output/tx nodes created because its ...
static u32 vlib_get_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt)
#define hash_unset(h, key)
vl_api_wireguard_peer_flags_t flags
u8 runtime_data[0]
Function dependent node-runtime data.
u32 sw_if_indices[VLIB_FRAME_SIZE]
vlib_frame_t * vlib_get_next_frame_internal(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 allocate_new_next_frame)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static_always_inline u32 clib_compress_u32(u32 *dst, u32 *src, u64 *mask, u32 n_elts)
Compare array of 32-bit elemments into destination array based on mask.
vlib_buffer_copy_indices(to, tmp, n_free)
vnet_interface_main_t interface_main
VNET_INTERFACE_OUTPUT_NEXT_DROP
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
u16 nexts[VLIB_FRAME_SIZE]
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
vnet_feature_config_main_t * cm
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
vnet_hw_interface_capabilities_t caps
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
u16 current_length
Nbytes between current data and the end of this buffer.
static heap_elt_t * last(heap_header_t *h)
clib_error_t * vnet_per_buffer_interface_output_hw_interface_add_del(vnet_main_t *vnm, u32 hw_if_index, u32 is_create)
static void vnet_interface_output_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, uword n_buffers)
#define STRUCT_OFFSET_OF(t, f)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
uword * sub_interface_sw_if_index_by_id
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 increment)
Increment a simple counter.
vlib_get_buffers(vm, from, bufs, n_buffers)
static_always_inline int vnet_have_features(u8 arc, u32 sw_if_index)
void vnet_pcap_drop_trace_filter_add_del(u32 error_index, int is_add)
#define VLIB_NODE_FN(node)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
format_function_t format_vnet_sw_if_index_name
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
#define count_trailing_zeros(x)
u16 * if_out_arc_end_next_index_by_sw_if_index
vlib_combined_counter_main_t * ccm
static_always_inline void store_tx_frame_scalar_data(vnet_hw_if_output_node_runtime_t *r, vnet_hw_if_tx_frame_t *tf)
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
#define static_always_inline
uword * pcap_drop_filter_hash
#define vlib_prefetch_buffer_with_index(vm, bi, type)
Prefetch buffer metadata by buffer index The first 64 bytes of buffer contains most header informatio...
struct vnet_error_trace_t_ vnet_error_trace_t
vlib_combined_counter_main_t * combined_sw_if_counters
vlib_main_t vlib_node_runtime_t * node
description fragment has unexpected format
vnet_hw_interface_flags_t flags
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static_always_inline void vlib_buffer_enqueue_to_single_next(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 next_index, u32 count)
vnet_main_t * vnet_get_main(void)
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
A collection of simple counters.
static_always_inline void vnet_interface_output_handle_offload(vlib_main_t *vm, vlib_buffer_t *b)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
format_function_t format_vnet_sw_interface_name
static_always_inline uword vnet_interface_output_node_inline(vlib_main_t *vm, u32 sw_if_index, vlib_combined_counter_main_t *ccm, vlib_buffer_t **b, u32 config_index, u8 arc, u32 n_left, int do_tx_offloads, int arc_or_subif)
static u8 * format_vnet_error_trace(u8 *s, va_list *va)
vlib_error_main_t error_main
static void drop_catchup_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VNET_FEATURE_INIT(span_tx, static)
static __clib_warn_unused_result int vlib_trace_buffer(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, vlib_buffer_t *b, int follow_chain)
uword vlib_error_drop_buffers(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u32 next_buffer_stride, u32 n_buffers, u32 next_index, u32 drop_error_node, u32 drop_error_code)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
u8 data[128 - 2 *sizeof(u32)]
vnet_sw_interface_flags_t flags
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
vlib_simple_counter_main_t * sw_if_counters
format_function_t * format_buffer
#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 interface_trace_buffers(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define VNET_HW_INTERFACE_CAP_SUPPORTS_TX_CKSUM
#define VLIB_REGISTER_NODE(x,...)
sll srl srl sll sra u16x4 i
static void pcap_drop_trace(vlib_main_t *vm, vnet_interface_main_t *im, vnet_pcap_t *pp, vlib_frame_t *f)
static void * vlib_frame_scalar_args(vlib_frame_t *f)
Get pointer to frame scalar data.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
#define hash_create(elts, value_bytes)
u32 output_node_next_index
u8 output_feature_arc_index
static uword hash_elts(void *v)
static void pcap_add_buffer(pcap_main_t *pm, struct vlib_main_t *vm, u32 buffer_index, u32 n_bytes_in_trace)
Add buffer (vlib_buffer_t) to the trace.
vlib_put_next_frame(vm, node, next_index, 0)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static_always_inline void vnet_interface_pcap_tx_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int sw_if_index_from_buffer)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
static_always_inline void enqueu_to_tx_node(vlib_main_t *vm, vlib_node_runtime_t *node, vnet_hw_interface_t *hi, u32 *from, u32 n_vectors)
vlib_error_desc_t * counters_heap
#define VNET_FEATURES(...)
Use the vpp classifier to decide whether to capture packets.
VNET_HW_INTERFACE_ADD_DEL_FUNCTION(vnet_per_buffer_interface_output_hw_interface_add_del)
#define vec_elt(v, i)
Get vector value at index i.
#define VLIB_BUFFER_DEFAULT_DATA_SIZE
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static_always_inline u32 vnet_get_feature_config_index(u8 arc, u32 sw_if_index)
u32 next_buffer
Next buffer for this linked-list of buffers.
vlib_node_main_t node_main
VLIB buffer representation.
vnet_sw_interface_t * sw_interfaces
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
A collection of combined counters.
static_always_inline void vnet_calc_checksums_inline(vlib_main_t *vm, vlib_buffer_t *b, int is_ip4, int is_ip6)
static_always_inline int vnet_is_packet_pcaped(vnet_pcap_t *pp, vlib_buffer_t *b, u32 sw_if_index)
vnet_is_packet_pcaped
#define clib_strnlen(s, m)
static_always_inline uword clib_count_equal_u32(u32 *data, uword max_count)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
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 void vlib_set_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt, u32 count)
static_always_inline uword interface_drop_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vnet_error_disposition_t disposition)
#define VLIB_NODE_FLAG_TRACE
static_always_inline vnet_feature_config_main_t * vnet_feature_get_config_main(u16 arc)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
node VNET_INTERFACE_OUTPUT_ERROR_INTERFACE_DELETED