|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
40 #ifndef __included_ip4_forward_h__
41 #define __included_ip4_forward_h__
72 #if (CLIB_N_PREFETCHES >= 8)
78 u32 lb_index0, lb_index1, lb_index2, lb_index3;
81 u32 hash_c0, hash_c1, hash_c2, hash_c3;
82 const dpo_id_t *dpo0, *dpo1, *dpo2, *dpo3;
116 dst_addr0, dst_addr1, dst_addr2, dst_addr3, &lb_index0, &lb_index1,
117 &lb_index2, &lb_index3);
119 ASSERT (lb_index0 && lb_index1 && lb_index2 && lb_index3);
222 #elif (CLIB_N_PREFETCHES >= 4)
228 u32 lb_index0, lb_index1;
230 u32 hash_c0, hash_c1;
253 dst_addr0, dst_addr1, &lb_index0, &lb_index1);
255 ASSERT (lb_index0 && lb_index1);
371 return frame->n_vectors;
u16 dpoi_next_node
The next VLIB node to follow.
vnet_interface_main_t * im
u16 lb_n_buckets
number of buckets in the load-balance.
index_t dpoi_index
the index of objects of that type
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
void ip4_forward_next_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_rx_or_tx_t which_adj_index)
ip4_main_t ip4_main
Global ip4 main structure.
vlib_get_buffers(vm, from, b, n_left_from)
vlib_main_t vlib_node_runtime_t * node
flow_hash_config_t lb_hash_config
the hash config to use when selecting a bucket.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
#define CLIB_PREFETCH(addr, size, type)
load_balance_main_t load_balance_main
The one instance of load-balance main.
static const dpo_id_t * load_balance_get_fwd_bucket(const load_balance_t *lb, u16 bucket)
#define VLIB_NODE_FLAG_TRACE
static uword ip4_lookup_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
enum flow_hash_config_t_ flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
static_always_inline void ip4_fib_forwarding_lookup_x4(u32 fib_index0, u32 fib_index1, u32 fib_index2, u32 fib_index3, const ip4_address_t *addr0, const ip4_address_t *addr1, const ip4_address_t *addr2, const ip4_address_t *addr3, index_t *lb0, index_t *lb1, index_t *lb2, index_t *lb3)
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
vnet_feature_config_main_t * cm
static_always_inline void ip4_fib_forwarding_lookup_x2(u32 fib_index0, u32 fib_index1, const ip4_address_t *addr0, const ip4_address_t *addr1, index_t *lb0, index_t *lb1)
vlib_combined_counter_main_t lbm_to_counters
A collection of combined counters.
static load_balance_t * load_balance_get(index_t lbi)
static u32 ip4_compute_flow_hash(const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
static void ip_lookup_set_buffer_fib_index(u32 *fib_index_by_sw_if_index, vlib_buffer_t *b)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
u16 nexts[VLIB_FRAME_SIZE]
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
static index_t ip4_fib_forwarding_lookup(u32 fib_index, const ip4_address_t *addr)
static uword is_pow2(uword x)
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
VLIB buffer representation.