|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
41 #define bier_error(n,s) s,
49 #define foreach_bier_lookup_next \
50 _(DROP, "bier-drop") \
51 _(OUTPUT, "bier-output")
54 #define _(s,n) BIER_LOOKUP_NEXT_##s,
61 #define bier_error(n,s) BIER_LOOKUP_ERROR_##n,
98 to_next, n_left_to_next);
124 next0 = BIER_LOOKUP_NEXT_DROP;
143 num_buckets =
n_bytes /
sizeof(int);
165 fbs += (((num_buckets - 1) -
index) *
194 next0 = BIER_LOOKUP_NEXT_OUTPUT;
203 BIER_LOOKUP_ERROR_FMASK_UNRES, 1);
215 u16 num_cloned, clone;
229 if (num_cloned != n_clones)
234 BIER_LOOKUP_ERROR_BUFFER_ALLOCATION_FAILURE, 1);
237 for (clone = 0; clone < num_cloned; clone++)
261 to_next, n_left_to_next,
276 to_next, n_left_to_next);
285 next0 = BIER_LOOKUP_NEXT_DROP;
301 to_next, n_left_to_next,
310 BIER_LOOKUP_ERROR_NONE,
322 s =
format (s,
"BIER: next [%d], tbl:%d BFM:%d",
331 .name =
"bier-lookup",
333 .vector_size =
sizeof (
u32),
341 [BIER_LOOKUP_NEXT_DROP] =
"bier-drop",
342 [BIER_LOOKUP_NEXT_OUTPUT] =
"bier-output",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static void bier_bit_string_clear_string(const bier_bit_string_t *src, bier_bit_string_t *dest)
static u32 vlib_num_workers()
#define foreach_bier_lookup_next
nat44_ei_hairpin_src_next_t next_index
bier_bit_string_t bfmb_input_reset_string
each bit in the mask needs to be reference counted and set/cleared on the 0->1 and 1->0 transitions.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
struct bier_lookup_main_t_ bier_lookup_main_t
Struct maintaining the per-worker thread data for BIER lookups.
vlib_main_t vlib_node_runtime_t * node
void bier_bit_string_clear_bit(bier_bit_string_t *bit_string, bier_bp_t bp)
u32 bier_hdr_len_id_to_num_buckets(bier_hdr_len_id_t id)
Conversion functions for the enumerated bit-string length values, to bit and bytes.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define VLIB_BUFFER_CLONE_HEAD_SIZE
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
u32 bier_bp_t
A bit positon as assigned to egress PEs.
clib_error_t * bier_lookup_module_init(vlib_main_t *vm)
Packet trace record for a BIER lookup.
u16 bbs_len
The length of the string in BYTES.
static void bier_bit_string_init(bier_bit_string_t *bbs, bier_hdr_len_id_t len, bier_bit_mask_bucket_t *buckets)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword bier_lookup(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
int bier_table_is_main(const bier_table_t *bt)
u8 bier_bit_mask_bucket_t
A bucket is a byte.
static_always_inline uword vlib_get_thread_index(void)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static bier_table_t * bier_table_get(index_t bti)
static u16 vlib_buffer_clone(vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset)
Create multiple clones of buffer and store them in the supplied array.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
struct _vlib_node_registration vlib_node_registration_t
bier_hdr_len_id_t bti_hdr_len
The size of the bit string processed by this table.
static char * bier_lookup_error_strings[]
#define vec_set_len(v, l)
Set vector length to a user-defined value.
#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.
static bier_lookup_main_t bier_lookup_main
Single instance of the lookup main.
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
#define VLIB_INIT_FUNCTION(x)
struct bier_lookup_trace_t_ bier_lookup_trace_t
Packet trace record for a BIER lookup.
bier_table_id_t bt_id
The identity/key or the table.
Struct maintaining the per-worker thread data for BIER lookups.
bier_bit_mask_bucket_t * bbs_buckets
The buckets in the string.
bier_fmask_bits_t bfm_bits
The bits, and their ref counts, that are set on this mask This mask changes as BIER entries link to a...
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
#define BIER_BIT_MASK_BITS_PER_INT
A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mp...
vlib_node_registration_t bier_lookup_node
(constructor) VLIB_REGISTER_NODE (bier_lookup_node)
A BIER Table is the bit-indexed forwarding table.
bier_bit_mask_bucket_t bh_bit_string[0]
The variable length bit-string.
static u8 * format_bier_lookup_trace(u8 *s, va_list *args)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
#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).
A Variable length BitString.
static bier_fmask_t * bier_fmask_get(u32 index)
static int bier_find_first_bit_string_set(int mask)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
static const index_t bier_table_fwd_lookup(const bier_table_t *bt, bier_bp_t bp)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)