48 u32 * from, * to_next, n_left_from, n_left_to_next;
63 while (n_left_from > 0)
68 while (n_left_from >= 8 && n_left_to_next > 4)
70 u32 bi0, adj_index0, next0;
74 u32 bi1, adj_index1, next1;
78 u32 bi2, adj_index2, next2;
82 u32 bi3, adj_index3, next3;
153 adj0->rewrite_header.sw_if_index,
159 adj1->rewrite_header.sw_if_index,
165 adj2->rewrite_header.sw_if_index,
171 adj3->rewrite_header.sw_if_index,
202 to_next, n_left_to_next,
204 next0, next1, next2, next3);
206 while (n_left_from > 0 && n_left_to_next > 0)
208 u32 bi0, adj_index0, next0;
234 adj0->rewrite_header.sw_if_index,
247 to_next, n_left_to_next,
264 s =
format(s,
"adj-midchain:[%d]:%U", tr->
ai,
281 .name =
"adj-midchain-tx",
282 .vector_size =
sizeof (
u32),
302 .name =
"adj-midchain-tx-no-count",
303 .vector_size =
sizeof (
u32),
314 .arc_name =
"ip4-output",
315 .node_name =
"adj-midchain-tx",
320 .arc_name =
"ip4-output",
321 .node_name =
"adj-midchain-tx-no-count",
326 .arc_name =
"ip6-output",
327 .node_name =
"adj-midchain-tx",
332 .arc_name =
"ip6-output",
333 .node_name =
"adj-midchain-tx-no-count",
338 .arc_name =
"mpls-output",
339 .node_name =
"adj-midchain-tx",
344 .arc_name =
"mpls-output",
345 .node_name =
"adj-midchain-tx-no-count",
350 .arc_name =
"ethernet-output",
351 .node_name =
"adj-midchain-tx",
356 .arc_name =
"ethernet-output",
357 .node_name =
"adj-midchain-tx-no-count",
362 .arc_name =
"nsh-output",
363 .node_name =
"adj-midchain-tx",
368 .arc_name =
"nsh-output",
369 .node_name =
"adj-midchain-tx-no-count",
466 u32 feature_index, tx_node;
483 adj->rewrite_header.sw_if_index,
508 const void *fixup_data,
591 u32 indent = va_arg(*ap,
u32);
600 &adj->rewrite_header, sizeof (adj->rewrite_data), indent);
601 s =
format (s,
"\n%Ustacked-on:\n%U%U",
static uword adj_midchain_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static const char *const midchain_nsh_nodes[]
static const char *const midchain_ip6_nodes[]
void dpo_stack_from_node(u32 child_node_index, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child parent relationship.
dpo_lock_fn_t dv_lock
A reference counting lock function.
#define VNET_LINK_NUM
Number of link types.
static u32 adj_midchain_tx_no_count_feature_node[VNET_LINK_NUM]
adj_flags_t ia_flags
Flags on the adjacency 1-bytes.
vlib_node_registration_t ip6_midchain_node
(constructor) VLIB_REGISTER_NODE (ip6_midchain_node)
A virtual function table regisitered for a DPO type.
static vlib_node_registration_t adj_midchain_tx_node
(constructor) VLIB_REGISTER_NODE (adj_midchain_tx_node)
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
void adj_lock(adj_index_t adj_index)
Take a reference counting lock on the adjacency.
struct ip_adjacency_t_::@43::@45 midchain
IP_LOOKUP_NEXT_MIDCHAIN.
vnet_main_t * vnet_get_main(void)
static uword adj_midchain_tx_no_count(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vnet_interface_main_t interface_main
static const char *const midchain_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a midchain object.
vlib_node_registration_t ip4_midchain_node
(constructor) VLIB_REGISTER_NODE (ip4_midchain_node)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
struct ip_adjacency_t_::@43::@44 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
#define vlib_validate_buffer_enqueue_x4(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, bi2, bi3, next0, next1, next2, next3)
Finish enqueueing four buffers forward in the graph.
ip_lookup_main_t lookup_main
void adj_nbr_update_rewrite_internal(ip_adjacency_t *adj, ip_lookup_next_t adj_next_index, u32 complete_next_index, u32 next_index, u8 *rewrite)
adj_nbr_update_rewrite_internal
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
u32 adj_dpo_get_urpf(const dpo_id_t *dpo)
union ip_adjacency_t_::@43 sub_type
vnet_link_t ia_link
link/ether-type 1 bytes
const dpo_id_t * drop_dpo_get(dpo_proto_t proto)
u8 output_feature_arc_index
ethernet_main_t ethernet_main
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
enum ip_adjacency_flags_t_ adj_flags_t
Flags on an IP adjacency.
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
vlib_node_registration_t adj_nsh_midchain_node
(constructor) VLIB_REGISTER_NODE (adj_nsh_midchain_node)
dpo_proto_t vnet_link_to_dpo_proto(vnet_link_t linkt)
vlib_combined_counter_main_t * combined_sw_if_counters
int vnet_feature_enable_disable_with_index(u8 arc_index, u32 feature_index, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static const char *const *const midchain_nodes[DPO_PROTO_NUM]
u8 output_feature_arc_index
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
vlib_node_registration_t mpls_midchain_node
(constructor) VLIB_REGISTER_NODE (mpls_midchain_node)
format_function_t format_vnet_rewrite
static uword adj_midchain_tx_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int interface_count)
u8 output_feature_arc_index
vlib_node_registration_t adj_l2_midchain_node
(constructor) VLIB_REGISTER_NODE (adj_l2_midchain_node)
static const char *const midchain_mpls_nodes[]
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
static u32 adj_get_midchain_node(vnet_link_t link)
Trace data for packets traversing the midchain tx node.
void adj_midchain_module_init(void)
Module initialisation.
adj_index_t ai
the midchain adj we are traversing
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
static u8 adj_midchain_get_feature_arc_index_for_link_type(const ip_adjacency_t *adj)
static vlib_node_registration_t adj_midchain_tx_no_count_node
(constructor) VLIB_REGISTER_NODE (adj_midchain_tx_no_count_node)
#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).
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
#define VLIB_REGISTER_NODE(x,...)
static void adj_dpo_unlock(dpo_id_t *dpo)
Multicast Midchain Adjacency.
static u8 * format_adj_midchain_tx_trace(u8 *s, va_list *args)
void adj_nbr_midchain_update_rewrite(adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *fixup_data, adj_flags_t flags, u8 *rewrite)
adj_nbr_midchain_update_rewrite
Packets TX through the midchain do not increment the interface counters.
void(* adj_midchain_fixup_t)(vlib_main_t *vm, struct ip_adjacency_t_ *adj, vlib_buffer_t *b0, const void *data)
A function type for post-rewrite fixups on midchain adjacency.
u32 adj_index_t
An index for adjacencies.
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.
u8 * format_adj_midchain(u8 *s, va_list *ap)
Format a midchain adjacency.
This packets follow a mid-chain adjacency.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static u32 adj_nbr_midchain_get_tx_node(ip_adjacency_t *adj)
void adj_nbr_midchain_stack(adj_index_t adj_index, const dpo_id_t *next)
adj_nbr_midchain_stack
ip_lookup_main_t lookup_main
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
void adj_nbr_midchain_unstack(adj_index_t adj_index)
adj_nbr_midchain_unstack
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject
#define VNET_FEATURES(...)
static void adj_dpo_lock(dpo_id_t *dpo)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
index_t dpoi_index
the index of objects of that type
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
void adj_midchain_setup(adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *data, adj_flags_t flags)
adj_midchain_setup
nsh_main_dummy_t nsh_main_dummy
struct adj_midchain_tx_trace_t_ adj_midchain_tx_trace_t
Trace data for packets traversing the midchain tx node.
static u32 adj_midchain_tx_feature_node[VNET_LINK_NUM]
The two midchain tx feature node indices.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
ip4_main_t ip4_main
Global ip4 main structure.
#define CLIB_MEMORY_BARRIER()
u8 * format_vnet_link(u8 *s, va_list *ap)
u16 dpoi_next_node
The next VLIB node to follow.
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 const char *const midchain_ethernet_nodes[]
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
VNET_FEATURE_INIT(adj_midchain_tx_ip4, static)
static u32 adj_nbr_midchain_get_feature_node(ip_adjacency_t *adj)
static ip46_type_t adj_proto_to_46(fib_protocol_t proto)
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child-parent relationship.