FD.io VPP  v17.04.2-2-ga8f93f8
Vector Packet Processing
vnet_classify.h File Reference
+ Include dependency graph for vnet_classify.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vnet_classify_bucket_t
 
struct  vnet_classify_table_t
 

Macros

#define CLASSIFY_TRACE   0
 
#define CLASSIFY_USE_SSE
 
#define U32X4_ALIGNED(p)   PREDICT_TRUE((((intptr_t)p) & 0xf) == 0)
 
#define CLASSIFY_FLAG_USE_CURR_DATA   1
 
#define CLASSIFY_ACTION_SET_IP4_FIB_INDEX   1
 
#define CLASSIFY_ACTION_SET_IP6_FIB_INDEX   2
 
#define foreach_size_in_u32x4
 
#define VNET_CLASSIFY_ENTRY_FREE   (1<<0)
 

Typedefs

typedef struct _vnet_classify_main vnet_classify_main_t
 

Functions

typedef CLIB_PACKED (struct _vnet_classify_entry{u32 next_index;union{struct{u32 opaque_index;i32 advance;};u64 opaque_count;};u8 flags;#define VNET_CLASSIFY_ENTRY_FREE u8 action;u16 metadata;union{u64 hits;struct _vnet_classify_entry *next_free;};f64 last_heard;u32x4 key[0];}) vnet_classify_entry_t
 
static int vnet_classify_entry_is_free (vnet_classify_entry_t *e)
 
static int vnet_classify_entry_is_busy (vnet_classify_entry_t *e)
 
u8format_classify_table (u8 *s, va_list *args)
 
u64 vnet_classify_hash_packet (vnet_classify_table_t *t, u8 *h)
 
static u64 vnet_classify_hash_packet_inline (vnet_classify_table_t *t, u8 *h)
 
static void vnet_classify_prefetch_bucket (vnet_classify_table_t *t, u64 hash)
 
static vnet_classify_entry_t * vnet_classify_get_entry (vnet_classify_table_t *t, uword offset)
 
static uword vnet_classify_get_offset (vnet_classify_table_t *t, vnet_classify_entry_t *v)
 
static vnet_classify_entry_t * vnet_classify_entry_at_index (vnet_classify_table_t *t, vnet_classify_entry_t *e, u32 index)
 
static void vnet_classify_prefetch_entry (vnet_classify_table_t *t, u64 hash)
 
vnet_classify_entry_t * vnet_classify_find_entry (vnet_classify_table_t *t, u8 *h, u64 hash, f64 now)
 
static vnet_classify_entry_t * vnet_classify_find_entry_inline (vnet_classify_table_t *t, u8 *h, u64 hash, f64 now)
 
vnet_classify_table_tvnet_classify_new_table (vnet_classify_main_t *cm, u8 *mask, u32 nbuckets, u32 memory_size, u32 skip_n_vectors, u32 match_n_vectors)
 
int vnet_classify_add_del_session (vnet_classify_main_t *cm, u32 table_index, u8 *match, u32 hit_next_index, u32 opaque_index, i32 advance, u8 action, u32 metadata, int is_add)
 
int vnet_classify_add_del_table (vnet_classify_main_t *cm, u8 *mask, u32 nbuckets, u32 memory_size, u32 skip, u32 match, u32 next_table_index, u32 miss_next_index, u32 *table_index, u8 current_data_flag, i16 current_data_offset, int is_add, int del_chain)
 
void vnet_classify_register_unformat_ip_next_index_fn (unformat_function_t *fn)
 
void vnet_classify_register_unformat_l2_next_index_fn (unformat_function_t *fn)
 
void vnet_classify_register_unformat_acl_next_index_fn (unformat_function_t *fn)
 
void vnet_classify_register_unformat_policer_next_index_fn (unformat_function_t *fn)
 
void vnet_classify_register_unformat_opaque_index_fn (unformat_function_t *fn)
 

Variables

vlib_node_registration_t ip4_classify_node
 (constructor) VLIB_REGISTER_NODE (ip4_classify_node) More...
 
vlib_node_registration_t ip6_classify_node
 (constructor) VLIB_REGISTER_NODE (ip6_classify_node) More...
 
 foreach_size_in_u32x4
 
vnet_classify_main_t vnet_classify_main
 
unformat_function_t unformat_ip4_mask
 
unformat_function_t unformat_ip6_mask
 
unformat_function_t unformat_l3_mask
 
unformat_function_t unformat_l2_mask
 
unformat_function_t unformat_classify_mask
 
unformat_function_t unformat_l2_next_index
 
unformat_function_t unformat_ip_next_index
 
unformat_function_t unformat_ip4_match
 
unformat_function_t unformat_ip6_match
 
unformat_function_t unformat_l3_match
 
unformat_function_t unformat_l4_match
 
unformat_function_t unformat_vlan_tag
 
unformat_function_t unformat_l2_match
 
unformat_function_t unformat_classify_match
 

Macro Definition Documentation

#define CLASSIFY_ACTION_SET_IP4_FIB_INDEX   1

Definition at line 65 of file vnet_classify.h.

#define CLASSIFY_ACTION_SET_IP6_FIB_INDEX   2

Definition at line 66 of file vnet_classify.h.

#define CLASSIFY_FLAG_USE_CURR_DATA   1

Definition at line 54 of file vnet_classify.h.

#define CLASSIFY_TRACE   0

Definition at line 41 of file vnet_classify.h.

#define CLASSIFY_USE_SSE

Definition at line 44 of file vnet_classify.h.

#define foreach_size_in_u32x4
Value:
_(1) \
_(2) \
_(3) \
_(4) \
_(5)

Definition at line 71 of file vnet_classify.h.

#define U32X4_ALIGNED (   p)    PREDICT_TRUE((((intptr_t)p) & 0xf) == 0)

Definition at line 47 of file vnet_classify.h.

#define VNET_CLASSIFY_ENTRY_FREE   (1<<0)

Typedef Documentation

typedef struct _vnet_classify_main vnet_classify_main_t

Definition at line 69 of file vnet_classify.h.

Function Documentation

typedef CLIB_PACKED ( struct _vnet_classify_entry{u32 next_index;union{struct{u32 opaque_index;i32 advance;};u64 opaque_count;};u8 flags;#define VNET_CLASSIFY_ENTRY_FREE u8 action;u16 metadata;union{u64 hits;struct _vnet_classify_entry *next_free;};f64 last_heard;u32x4 key[0];}  )
u8* format_classify_table ( u8 s,
va_list *  args 
)

Definition at line 592 of file vnet_classify.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vnet_classify_add_del_session ( vnet_classify_main_t cm,
u32  table_index,
u8 match,
u32  hit_next_index,
u32  opaque_index,
i32  advance,
u8  action,
u32  metadata,
int  is_add 
)

Definition at line 2000 of file vnet_classify.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vnet_classify_add_del_table ( vnet_classify_main_t cm,
u8 mask,
u32  nbuckets,
u32  memory_size,
u32  skip,
u32  match,
u32  next_table_index,
u32  miss_next_index,
u32 table_index,
u8  current_data_flag,
i16  current_data_offset,
int  is_add,
int  del_chain 
)

Definition at line 649 of file vnet_classify.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vnet_classify_entry_t* vnet_classify_entry_at_index ( vnet_classify_table_t t,
vnet_classify_entry_t *  e,
u32  index 
)
inlinestatic

Definition at line 310 of file vnet_classify.h.

+ Here is the caller graph for this function:

static int vnet_classify_entry_is_busy ( vnet_classify_entry_t *  e)
inlinestatic

Definition at line 116 of file vnet_classify.h.

+ Here is the caller graph for this function:

static int vnet_classify_entry_is_free ( vnet_classify_entry_t *  e)
inlinestatic

Definition at line 111 of file vnet_classify.h.

+ Here is the caller graph for this function:

vnet_classify_entry_t* vnet_classify_find_entry ( vnet_classify_table_t t,
u8 h,
u64  hash,
f64  now 
)

Definition at line 564 of file vnet_classify.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vnet_classify_entry_t* vnet_classify_find_entry_inline ( vnet_classify_table_t t,
u8 h,
u64  hash,
f64  now 
)
inlinestatic

Definition at line 355 of file vnet_classify.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vnet_classify_entry_t* vnet_classify_get_entry ( vnet_classify_table_t t,
uword  offset 
)
inlinestatic

Definition at line 289 of file vnet_classify.h.

+ Here is the caller graph for this function:

static uword vnet_classify_get_offset ( vnet_classify_table_t t,
vnet_classify_entry_t *  v 
)
inlinestatic

Definition at line 297 of file vnet_classify.h.

+ Here is the caller graph for this function:

u64 vnet_classify_hash_packet ( vnet_classify_table_t t,
u8 h 
)

+ Here is the caller graph for this function:

static u64 vnet_classify_hash_packet_inline ( vnet_classify_table_t t,
u8 h 
)
inlinestatic

Definition at line 205 of file vnet_classify.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vnet_classify_table_t* vnet_classify_new_table ( vnet_classify_main_t cm,
u8 mask,
u32  nbuckets,
u32  memory_size,
u32  skip_n_vectors,
u32  match_n_vectors 
)

Definition at line 108 of file vnet_classify.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vnet_classify_prefetch_bucket ( vnet_classify_table_t t,
u64  hash 
)
inlinestatic

Definition at line 277 of file vnet_classify.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vnet_classify_prefetch_entry ( vnet_classify_table_t t,
u64  hash 
)
inlinestatic

Definition at line 325 of file vnet_classify.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vnet_classify_register_unformat_acl_next_index_fn ( unformat_function_t fn)

Definition at line 85 of file vnet_classify.c.

+ Here is the caller graph for this function:

void vnet_classify_register_unformat_ip_next_index_fn ( unformat_function_t fn)

Definition at line 77 of file vnet_classify.c.

+ Here is the caller graph for this function:

void vnet_classify_register_unformat_l2_next_index_fn ( unformat_function_t fn)

Definition at line 70 of file vnet_classify.c.

+ Here is the caller graph for this function:

void vnet_classify_register_unformat_opaque_index_fn ( unformat_function_t fn)

Definition at line 100 of file vnet_classify.c.

+ Here is the caller graph for this function:

void vnet_classify_register_unformat_policer_next_index_fn ( unformat_function_t fn)

Definition at line 93 of file vnet_classify.c.

+ Here is the caller graph for this function:

Variable Documentation

foreach_size_in_u32x4

Definition at line 128 of file vnet_classify.h.

vlib_node_registration_t ip4_classify_node

(constructor) VLIB_REGISTER_NODE (ip4_classify_node)

Definition at line 38 of file ip_classify.c.

vlib_node_registration_t ip6_classify_node

(constructor) VLIB_REGISTER_NODE (ip6_classify_node)

Definition at line 39 of file ip_classify.c.

unformat_function_t unformat_classify_mask

Definition at line 499 of file vnet_classify.h.

unformat_function_t unformat_classify_match

Definition at line 508 of file vnet_classify.h.

unformat_function_t unformat_ip4_mask

Definition at line 495 of file vnet_classify.h.

unformat_function_t unformat_ip4_match

Definition at line 502 of file vnet_classify.h.

unformat_function_t unformat_ip6_mask

Definition at line 496 of file vnet_classify.h.

unformat_function_t unformat_ip6_match

Definition at line 503 of file vnet_classify.h.

unformat_function_t unformat_ip_next_index

Definition at line 501 of file vnet_classify.h.

unformat_function_t unformat_l2_mask

Definition at line 498 of file vnet_classify.h.

unformat_function_t unformat_l2_match

Definition at line 507 of file vnet_classify.h.

unformat_function_t unformat_l2_next_index

Definition at line 500 of file vnet_classify.h.

unformat_function_t unformat_l3_mask

Definition at line 497 of file vnet_classify.h.

unformat_function_t unformat_l3_match

Definition at line 504 of file vnet_classify.h.

unformat_function_t unformat_l4_match

Definition at line 505 of file vnet_classify.h.

unformat_function_t unformat_vlan_tag

Definition at line 506 of file vnet_classify.h.

vnet_classify_main_t vnet_classify_main

Definition at line 22 of file vnet_classify.c.