40 #ifndef __included_ip4_forward_h__ 41 #define __included_ip4_forward_h__ 71 #if (CLIB_N_PREFETCHES >= 8) 79 u32 lb_index0, lb_index1, lb_index2, lb_index3;
82 u32 hash_c0, hash_c1, hash_c2, hash_c3;
83 const dpo_id_t *dpo0, *dpo1, *dpo2, *dpo3;
139 ASSERT (lb_index0 && lb_index1 && lb_index2 && lb_index3);
226 (cm, thread_index, lb_index0, 1,
229 (cm, thread_index, lb_index1, 1,
232 (cm, thread_index, lb_index2, 1,
235 (cm, thread_index, lb_index3, 1,
242 #elif (CLIB_N_PREFETCHES >= 4) 250 u32 lb_index0, lb_index1;
252 u32 hash_c0, hash_c1;
288 ASSERT (lb_index0 && lb_index1);
335 (cm, thread_index, lb_index0, 1,
338 (cm, thread_index, lb_index1, 1,
u16 lb_n_buckets
number of buckets in the load-balance.
vlib_combined_counter_main_t lbm_to_counters
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.
static ip4_fib_mtrie_leaf_t ip4_fib_mtrie_lookup_step(const ip4_fib_mtrie_t *m, ip4_fib_mtrie_leaf_t current_leaf, const ip4_address_t *dst_address, u32 dst_address_byte_index)
Lookup step.
static u32 ip4_compute_flow_hash(const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
flow_hash_config_t lb_hash_config
the hash config to use when selecting a bucket.
static const dpo_id_t * load_balance_get_fwd_bucket(const load_balance_t *lb, u16 bucket)
static uword ip4_lookup_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static u32 ip4_fib_mtrie_leaf_get_adj_index(ip4_fib_mtrie_leaf_t n)
From the stored slot value extract the LB index value.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static void ip_lookup_set_buffer_fib_index(u32 *fib_index_by_sw_if_index, vlib_buffer_t *b)
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
load_balance_main_t load_balance_main
The one instance of load-balance main.
ip4_fib_mtrie_t mtrie
Mtrie for fast lookups.
#define CLIB_PREFETCH(addr, size, type)
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 ip4_fib_t * ip4_fib_get(u32 index)
Get the FIB at the given index.
vlib_main_t vlib_node_runtime_t * node
static ip4_fib_mtrie_leaf_t ip4_fib_mtrie_lookup_step_one(const ip4_fib_mtrie_t *m, const ip4_address_t *dst_address)
Lookup step number 1.
static load_balance_t * load_balance_get(index_t lbi)
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
static uword is_pow2(uword x)
index_t dpoi_index
the index of objects of that type
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)
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.
A collection of combined counters.
ip4_main_t ip4_main
Global ip4 main structure.
u16 flags
Copy of main node flags.
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