32 s =
format (s,
"IP_CLASSIFY: next_index %d, table %d, entry %d",
40 #define foreach_ip_classify_error \ 41 _(MISS, "Classify misses") \ 42 _(HIT, "Classify hits") \ 43 _(CHAIN_HIT, "Classify hits after chain walk") 46 #define _(sym,str) IP_CLASSIFY_ERROR_##sym, 53 #define _(sym,string) string, 63 u32 n_left_from, * from, * to_next;
86 while (n_left_from > 2)
91 u32 adj_index0, adj_index1;
93 u32 table_index0, table_index1;
121 table_index0 = adj0->
classify.table_index;
125 table_index1 = adj1->
classify.table_index;
141 vnet_buffer(b0)->l2_classify.table_index = table_index0;
143 vnet_buffer(b1)->l2_classify.table_index = table_index1;
149 while (n_left_from > 0)
166 table_index0 = adj0->
classify.table_index;
172 vnet_buffer(b0)->l2_classify.table_index = table_index0;
183 while (n_left_from > 0)
188 to_next, n_left_to_next);
191 while (n_left_from > 0 && n_left_to_next > 0)
198 vnet_classify_entry_t * e0;
210 table_index1 =
vnet_buffer(p1)->l2_classify.table_index;
230 table_index0 =
vnet_buffer(b0)->l2_classify.table_index;
248 e0->next_index:next0;
268 (t0, (
u8 *) h0, hash0, now);
275 e0->next_index:next0;
296 to_next, n_left_to_next,
304 IP_CLASSIFY_ERROR_MISS,
307 IP_CLASSIFY_ERROR_HIT,
310 IP_CLASSIFY_ERROR_CHAIN_HIT,
326 .name =
"ip4-classify",
327 .vector_size =
sizeof (
u32),
328 .sibling_of =
"ip4-lookup",
349 .name =
"ip6-classify",
350 .vector_size =
sizeof (
u32),
351 .sibling_of =
"ip6-lookup",
u64 vnet_classify_hash_packet(vnet_classify_table_t *t, u8 *h)
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.
ip_lookup_next_t
Common (IP4/IP6) next index stored in adjacency.
#define foreach_ip_classify_error
static clib_error_t * ip_classify_init(vlib_main_t *vm)
static f64 vlib_time_now(vlib_main_t *vm)
#define ethernet_buffer_header_size(b)
Determine the size of the Ethernet headers of the current frame in the buffer.
struct _vlib_node_registration vlib_node_registration_t
ip_lookup_main_t lookup_main
vlib_node_registration_t ip4_classify_node
(constructor) VLIB_REGISTER_NODE (ip4_classify_node)
#define VLIB_INIT_FUNCTION(x)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static void vnet_classify_prefetch_bucket(vnet_classify_table_t *t, u64 hash)
static void vnet_classify_prefetch_entry(vnet_classify_table_t *t, u64 hash)
static uword ip6_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static uword ip_classify_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip4)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vnet_classify_entry_t * entries
#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).
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define CLIB_PREFETCH(addr, size, type)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
struct ip_adjacency_t::@143::@146 classify
IP_LOOKUP_NEXT_CLASSIFY only.
struct _vnet_classify_main vnet_classify_main_t
static char * ip_classify_error_strings[]
ip_lookup_main_t lookup_main
#define VLIB_NODE_FLAG_TRACE
vnet_classify_main_t vnet_classify_main
#define VLIB_BUFFER_IS_TRACED
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static u8 * format_ip_classify_trace(u8 *s, va_list *args)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Packet does not match any route in table.
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
ip4_main_t ip4_main
Global ip4 main structure.
vlib_node_registration_t ip6_classify_node
(constructor) VLIB_REGISTER_NODE (ip6_classify_node)
static uword ip4_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vnet_classify_entry_t * vnet_classify_find_entry(vnet_classify_table_t *t, u8 *h, u64 hash, f64 now)
static ip_adjacency_t * ip_get_adjacency(ip_lookup_main_t *lm, u32 adj_index)