46 u32 * from, n_left, thread_index;
61 u32 adj_index0, adj_index1, adj_index2, adj_index3;
63 const dpo_id_t *dpo0, *dpo1, *dpo2, *dpo3;
104 adj0->rewrite_header.sw_if_index,
110 adj1->rewrite_header.sw_if_index,
116 adj2->rewrite_header.sw_if_index,
122 adj3->rewrite_header.sw_if_index,
177 adj0->rewrite_header.sw_if_index,
206 s =
format(s,
"adj-midchain:[%d]:%U", tr->
ai,
223 .name =
"adj-midchain-tx",
224 .vector_size =
sizeof (
u32),
244 .name =
"adj-midchain-tx-no-count",
245 .vector_size =
sizeof (
u32),
248 .sibling_of =
"adj-midchain-tx",
251 #ifndef CLIB_MARCH_VARIANT 366 adj->rewrite_header.sw_if_index,
368 (
u8*)
"interface-output")->index);
410 adj->rewrite_header.sw_if_index,
436 const void *fixup_data,
486 adj->rewrite_header.sw_if_index,
505 adj->rewrite_header.next_index =
512 adj->rewrite_header.sw_if_index,
535 entry_indicies = NULL;
569 entry_indicies = NULL;
652 entries = *entry_indicies;
675 u32 indent = va_arg(*ap,
u32);
680 s =
format(s,
" [features]");
686 &adj->rewrite_header, sizeof (adj->rewrite_data), indent);
687 s =
format (s,
"\n%Ustacked-on",
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.
adj_flags_t ia_flags
Flags on the adjacency 1-bytes.
Contribute an object that is to be used to forward IP6 packets.
vlib_node_registration_t ip6_midchain_node
(constructor) VLIB_REGISTER_NODE (ip6_midchain_node)
A virtual function table regisitered for a DPO type.
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.
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.
const u8 * adj_get_rewrite(adj_index_t ai)
Return the rewrite string of the adjacency.
static u32 ip4_compute_flow_hash(const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
void fib_entry_contribute_forwarding(fib_node_index_t fib_entry_index, fib_forward_chain_type_t fct, dpo_id_t *dpo)
flow_hash_config_t lb_hash_config
the hash config to use when selecting a bucket.
vlib_node_registration_t ip4_midchain_node
(constructor) VLIB_REGISTER_NODE (ip4_midchain_node)
dpo_proto_t fib_forw_chain_type_to_dpo_proto(fib_forward_chain_type_t fct)
Convert from a chain type to the DPO proto it will install.
This packet is to be rewritten and forwarded to the next processing node.
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Contribute an object that is to be used to forward IP4 packets.
ip_lookup_main_t lookup_main
union ip_adjacency_t_::@137 sub_type
void(* adj_midchain_fixup_t)(vlib_main_t *vm, const struct ip_adjacency_t_ *adj, vlib_buffer_t *b0, const void *data)
A function type for post-rewrite fixups on midchain adjacency.
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)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
#define vlib_worker_thread_barrier_sync(X)
vnet_link_t ia_link
link/ether-type 1 bytes
Adjacency to punt this packet.
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.
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)
this adj performs IP4 over IP4 fixup
dpo_proto_t vnet_link_to_dpo_proto(vnet_link_t linkt)
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
vlib_combined_counter_main_t * combined_sw_if_counters
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
void adj_nbr_midchain_update_next_node(adj_index_t adj_index, u32 next_node)
Update the VLIB node to which packets are sent post processing.
static const char *const *const midchain_nodes[DPO_PROTO_NUM]
void adj_nbr_midchain_stack_on_fib_entry(adj_index_t ai, fib_node_index_t fei, fib_forward_chain_type_t fct)
[re]stack a midchain.
struct ip_adjacency_t_::@137::@139 midchain
IP_LOOKUP_NEXT_MIDCHAIN.
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 ...
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
static u32 adj_get_midchain_node(vnet_link_t link)
dpo_type_t dpoi_type
the type
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
Trace data for packets traversing the midchain tx node.
void adj_midchain_module_init(void)
Module initialisation.
int adj_ndr_midchain_recursive_loop_detect(adj_index_t ai, fib_node_index_t **entry_indicies)
descend the FIB graph looking for loops
adj_index_t ai
the midchain adj we are traversing
load-balancing over a choice of [un]equal cost paths
static u32 ip6_compute_flow_hash(const ip6_header_t *ip, flow_hash_config_t flow_hash_config)
u32 ia_node_index
The VLIB node in which this adj is used to forward packets.
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
u32 vnet_feature_modify_end_node(u8 arc_index, u32 sw_if_index, u32 end_node_index)
static u8 adj_midchain_get_feature_arc_index_for_link_type(const ip_adjacency_t *adj)
vlib_node_registration_t adj_midchain_tx_no_count_node
(constructor) VLIB_REGISTER_NODE (adj_midchain_tx_no_count_node)
format_function_t format_ip46_address
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
Adjacency to drop this packet.
#define VLIB_REGISTER_NODE(x,...)
static_always_inline void vlib_buffer_enqueue_to_next(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 *nexts, uword count)
static void adj_dpo_unlock(dpo_id_t *dpo)
#define vec_free(V)
Free vector's memory (no header).
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
int fib_entry_recursive_loop_detect(fib_node_index_t entry_index, fib_node_index_t **entry_indicies)
u32 fib_node_index_t
A typedef of a node index.
void adj_midchain_teardown(ip_adjacency_t *adj)
adj_midchain_setup
u32 adj_index_t
An index for adjacencies.
vlib_main_t vlib_node_runtime_t * node
u8 * format_adj_midchain(u8 *s, va_list *ap)
Format a midchain adjacency.
This packets follow a mid-chain adjacency.
static u32 adj_nbr_midchain_get_tx_node(ip_adjacency_t *adj)
struct ip_adjacency_t_::@137::@138 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
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.
static load_balance_t * load_balance_get(index_t lbi)
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
u32 ia_cfg_index
feature [arc] config index
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.
static vlib_main_t * vlib_get_main(void)
static void adj_dpo_lock(dpo_id_t *dpo)
enum adj_flags_t_ adj_flags_t
Flags on an IP adjacency.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
This packets needs to go to ICMP error.
This packet is for one of our own IP addresses.
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
u8 adj_is_midchain(adj_index_t ai)
index_t dpoi_index
the index of objects of that type
#define FIB_NODE_INDEX_INVALID
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
VLIB buffer representation.
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 void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
void adj_nbr_midchain_reset_next_node(adj_index_t adj_index)
Return the adjacency's next node to its default value.
ip4_main_t ip4_main
Global ip4 main structure.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define vec_foreach(var, vec)
Vector iterator.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
u16 flags
Copy of main node flags.
#define CLIB_MEMORY_BARRIER()
u8 * format_vnet_link(u8 *s, va_list *ap)
u16 dpoi_next_node
The next VLIB node to follow.
static_always_inline void vlib_get_buffers(vlib_main_t *vm, u32 *bi, vlib_buffer_t **b, int count)
Translate array of buffer indices into buffer pointers.
#define VLIB_NODE_FLAG_TRACE
This adjacency/interface has output features configured.
static const char *const midchain_ethernet_nodes[]
u8 output_feature_arc_index
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.