FD.io VPP  v21.06
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 foreach_size_in_u32x4
 
#define VNET_CLASSIFY_ENTRY_FREE   (1<<0)
 
#define VNET_CLASSIFY_VECTOR_SIZE   sizeof (((vnet_classify_table_t *) 0)->mask[0])
 The vector size for the classifier in the add/del table 'match' is the number of vectors of this size. More...
 

Typedefs

typedef enum vnet_classify_flags_t_ vnet_classify_flags_t
 
typedef enum vnet_classify_action_t_ vnet_classify_action_t
 
typedef struct _vnet_classify_main vnet_classify_main_t
 
typedef struct _vnet_classify_entry vnet_classify_entry_t
 

Enumerations

enum  vnet_classify_flags_t_ { CLASSIFY_FLAG_NONE = 0, CLASSIFY_FLAG_USE_CURR_DATA = (1 << 0) }
 
enum  vnet_classify_action_t_ { CLASSIFY_ACTION_NONE = 0, CLASSIFY_ACTION_SET_IP4_FIB_INDEX = 1, CLASSIFY_ACTION_SET_IP6_FIB_INDEX = 2, CLASSIFY_ACTION_SET_METADATA = 3 }
 

Functions

 STATIC_ASSERT_OFFSET_OF (vnet_classify_entry_t, key, 32)
 Check there's no padding in the entry. More...
 
static int vnet_classify_entry_is_free (vnet_classify_entry_t *e)
 
static int vnet_classify_entry_is_busy (vnet_classify_entry_t *e)
 
 STATIC_ASSERT_OFFSET_OF (vnet_classify_table_t, cacheline1, CLIB_CACHE_LINE_BYTES)
 Ensure DP fields don't spill over to cache-line 2. More...
 
u8format_classify_table (u8 *s, va_list *args)
 
u8format_vnet_classify_table (u8 *s, va_list *args)
 
u64 vnet_classify_hash_packet (vnet_classify_table_t *t, u8 *h)
 
static_always_inline vnet_classify_table_tvnet_classify_table_get (u32 table_index)
 
static u64 vnet_classify_hash_packet_inline (vnet_classify_table_t *t, const u8 *h)
 
static void vnet_classify_prefetch_bucket (vnet_classify_table_t *t, u64 hash)
 
static vnet_classify_entry_tvnet_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_tvnet_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_tvnet_classify_find_entry (vnet_classify_table_t *t, u8 *h, u64 hash, f64 now)
 
static vnet_classify_entry_tvnet_classify_find_entry_inline (vnet_classify_table_t *t, const u8 *h, u64 hash, f64 now)
 
vnet_classify_table_tvnet_classify_new_table (vnet_classify_main_t *cm, const 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, const u8 *match, u32 hit_next_index, u32 opaque_index, i32 advance, u8 action, u16 metadata, int is_add)
 
int vnet_classify_add_del_table (vnet_classify_main_t *cm, const 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_delete_table_index (vnet_classify_main_t *cm, u32 table_index, 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)
 
u32 classify_get_pcap_chain (vnet_classify_main_t *cm, u32 sw_if_index)
 
void classify_set_pcap_chain (vnet_classify_main_t *cm, u32 sw_if_index, u32 table_index)
 
u32 classify_get_trace_chain (void)
 
void classify_set_trace_chain (vnet_classify_main_t *cm, u32 table_index)
 
u32 classify_sort_table_chain (vnet_classify_main_t *cm, u32 table_index)
 
u32 classify_lookup_chain (u32 table_index, u8 *mask, u32 n_skip, u32 n_match)
 

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

◆ CLASSIFY_TRACE

#define CLASSIFY_TRACE   0

Definition at line 30 of file vnet_classify.h.

◆ foreach_size_in_u32x4

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

Definition at line 63 of file vnet_classify.h.

◆ VNET_CLASSIFY_ENTRY_FREE

#define VNET_CLASSIFY_ENTRY_FREE   (1<<0)

Definition at line 94 of file vnet_classify.h.

◆ VNET_CLASSIFY_VECTOR_SIZE

#define VNET_CLASSIFY_VECTOR_SIZE   sizeof (((vnet_classify_table_t *) 0)->mask[0])

The vector size for the classifier in the add/del table 'match' is the number of vectors of this size.

Definition at line 211 of file vnet_classify.h.

Typedef Documentation

◆ vnet_classify_action_t

◆ vnet_classify_entry_t

typedef struct _vnet_classify_entry vnet_classify_entry_t

◆ vnet_classify_flags_t

◆ vnet_classify_main_t

typedef struct _vnet_classify_main vnet_classify_main_t

Definition at line 61 of file vnet_classify.h.

Enumeration Type Documentation

◆ vnet_classify_action_t_

Enumerator
CLASSIFY_ACTION_NONE 
CLASSIFY_ACTION_SET_IP4_FIB_INDEX 
CLASSIFY_ACTION_SET_IP6_FIB_INDEX 
CLASSIFY_ACTION_SET_METADATA 

Definition at line 52 of file vnet_classify.h.

◆ vnet_classify_flags_t_

Enumerator
CLASSIFY_FLAG_NONE 
CLASSIFY_FLAG_USE_CURR_DATA 

Definition at line 37 of file vnet_classify.h.

Function Documentation

◆ classify_get_pcap_chain()

u32 classify_get_pcap_chain ( vnet_classify_main_t cm,
u32  sw_if_index 
)

Definition at line 1749 of file vnet_classify.c.

+ Here is the caller graph for this function:

◆ classify_get_trace_chain()

u32 classify_get_trace_chain ( void  )

Definition at line 30 of file pnat_test_stubs.h.

+ Here is the caller graph for this function:

◆ classify_lookup_chain()

u32 classify_lookup_chain ( u32  table_index,
u8 mask,
u32  n_skip,
u32  n_match 
)

Definition at line 1800 of file vnet_classify.c.

+ Here is the caller graph for this function:

◆ classify_set_pcap_chain()

void classify_set_pcap_chain ( vnet_classify_main_t cm,
u32  sw_if_index,
u32  table_index 
)

Definition at line 1761 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ classify_set_trace_chain()

void classify_set_trace_chain ( vnet_classify_main_t cm,
u32  table_index 
)

Definition at line 1734 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ classify_sort_table_chain()

u32 classify_sort_table_chain ( vnet_classify_main_t cm,
u32  table_index 
)

Definition at line 1680 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_classify_table()

u8* format_classify_table ( u8 s,
va_list *  args 
)

Definition at line 687 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_vnet_classify_table()

u8* format_vnet_classify_table ( u8 s,
va_list *  args 
)

Definition at line 2207 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ STATIC_ASSERT_OFFSET_OF() [1/2]

STATIC_ASSERT_OFFSET_OF ( vnet_classify_entry_t  ,
key  ,
32   
)

Check there's no padding in the entry.

the key lies on a 16 byte boundary.

◆ STATIC_ASSERT_OFFSET_OF() [2/2]

STATIC_ASSERT_OFFSET_OF ( vnet_classify_table_t  ,
cacheline1  ,
CLIB_CACHE_LINE_BYTES   
)

Ensure DP fields don't spill over to cache-line 2.

◆ vnet_classify_add_del_session()

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

Definition at line 2745 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_add_del_table()

int vnet_classify_add_del_table ( vnet_classify_main_t cm,
const 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 747 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_delete_table_index()

void vnet_classify_delete_table_index ( vnet_classify_main_t cm,
u32  table_index,
int  del_chain 
)

Definition at line 164 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_entry_at_index()

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 357 of file vnet_classify.h.

+ Here is the caller graph for this function:

◆ vnet_classify_entry_is_busy()

static int vnet_classify_entry_is_busy ( vnet_classify_entry_t e)
inlinestatic

Definition at line 117 of file vnet_classify.h.

+ Here is the caller graph for this function:

◆ vnet_classify_entry_is_free()

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_find_entry()

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

Definition at line 657 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_find_entry_inline()

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

Definition at line 399 of file vnet_classify.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_get_entry()

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

Definition at line 335 of file vnet_classify.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_get_offset()

static uword vnet_classify_get_offset ( vnet_classify_table_t t,
vnet_classify_entry_t v 
)
inlinestatic

Definition at line 344 of file vnet_classify.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_hash_packet()

u64 vnet_classify_hash_packet ( vnet_classify_table_t t,
u8 h 
)
+ Here is the caller graph for this function:

◆ vnet_classify_hash_packet_inline()

static u64 vnet_classify_hash_packet_inline ( vnet_classify_table_t t,
const u8 h 
)
inlinestatic

Definition at line 250 of file vnet_classify.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_new_table()

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

Definition at line 131 of file vnet_classify.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_prefetch_bucket()

static void vnet_classify_prefetch_bucket ( vnet_classify_table_t t,
u64  hash 
)
inlinestatic

Definition at line 323 of file vnet_classify.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_prefetch_entry()

static void vnet_classify_prefetch_entry ( vnet_classify_table_t t,
u64  hash 
)
inlinestatic

Definition at line 371 of file vnet_classify.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_classify_register_unformat_acl_next_index_fn()

void vnet_classify_register_unformat_acl_next_index_fn ( unformat_function_t fn)

Definition at line 106 of file vnet_classify.c.

+ Here is the caller graph for this function:

◆ vnet_classify_register_unformat_ip_next_index_fn()

void vnet_classify_register_unformat_ip_next_index_fn ( unformat_function_t fn)

Definition at line 98 of file vnet_classify.c.

+ Here is the caller graph for this function:

◆ vnet_classify_register_unformat_l2_next_index_fn()

void vnet_classify_register_unformat_l2_next_index_fn ( unformat_function_t fn)

Definition at line 90 of file vnet_classify.c.

+ Here is the caller graph for this function:

◆ vnet_classify_register_unformat_opaque_index_fn()

void vnet_classify_register_unformat_opaque_index_fn ( unformat_function_t fn)

Definition at line 123 of file vnet_classify.c.

+ Here is the caller graph for this function:

◆ vnet_classify_register_unformat_policer_next_index_fn()

void vnet_classify_register_unformat_policer_next_index_fn ( unformat_function_t fn)

Definition at line 114 of file vnet_classify.c.

+ Here is the caller graph for this function:

◆ vnet_classify_table_get()

static_always_inline vnet_classify_table_t* vnet_classify_table_get ( u32  table_index)

Definition at line 242 of file vnet_classify.h.

Variable Documentation

◆ foreach_size_in_u32x4

foreach_size_in_u32x4

Definition at line 129 of file vnet_classify.h.

◆ ip4_classify_node

vlib_node_registration_t ip4_classify_node

(constructor) VLIB_REGISTER_NODE (ip4_classify_node)

Definition at line 313 of file ip_classify.c.

◆ ip6_classify_node

vlib_node_registration_t ip6_classify_node

(constructor) VLIB_REGISTER_NODE (ip6_classify_node)

Definition at line 334 of file ip_classify.c.

◆ unformat_classify_mask

unformat_function_t unformat_classify_mask

Definition at line 555 of file vnet_classify.h.

◆ unformat_classify_match

unformat_function_t unformat_classify_match

Definition at line 564 of file vnet_classify.h.

◆ unformat_ip4_mask

unformat_function_t unformat_ip4_mask

Definition at line 551 of file vnet_classify.h.

◆ unformat_ip4_match

unformat_function_t unformat_ip4_match

Definition at line 558 of file vnet_classify.h.

◆ unformat_ip6_mask

unformat_function_t unformat_ip6_mask

Definition at line 552 of file vnet_classify.h.

◆ unformat_ip6_match

unformat_function_t unformat_ip6_match

Definition at line 559 of file vnet_classify.h.

◆ unformat_ip_next_index

unformat_function_t unformat_ip_next_index

Definition at line 557 of file vnet_classify.h.

◆ unformat_l2_mask

unformat_function_t unformat_l2_mask

Definition at line 554 of file vnet_classify.h.

◆ unformat_l2_match

unformat_function_t unformat_l2_match

Definition at line 563 of file vnet_classify.h.

◆ unformat_l2_next_index

unformat_function_t unformat_l2_next_index

Definition at line 556 of file vnet_classify.h.

◆ unformat_l3_mask

unformat_function_t unformat_l3_mask

Definition at line 553 of file vnet_classify.h.

◆ unformat_l3_match

unformat_function_t unformat_l3_match

Definition at line 560 of file vnet_classify.h.

◆ unformat_l4_match

unformat_function_t unformat_l4_match

Definition at line 561 of file vnet_classify.h.

◆ unformat_vlan_tag

unformat_function_t unformat_vlan_tag

Definition at line 562 of file vnet_classify.h.

◆ vnet_classify_main

vnet_classify_main_t vnet_classify_main

Definition at line 32 of file vnet_classify.c.