FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
feature.h File Reference
+ Include dependency graph for feature.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vnet_feature_config_main_t_
 
struct  vnet_feature_main_t
 

Macros

#define VNET_FEATURE_ARC_INIT(x, ...)
 
#define VNET_FEATURE_INIT(x, ...)
 
#define VNET_FEATURE_ARC_ORDER(x, ...)
 
#define VNET_FEATURES(...)   (char*[]) { __VA_ARGS__, 0}
 

Typedefs

typedef struct _vnet_feature_arc_registration vnet_feature_arc_registration_t
 feature registration object More...
 
typedef clib_error_t *() vnet_feature_enable_disable_function_t(u32 sw_if_index, int enable_disable)
 
typedef struct _vnet_feature_registration vnet_feature_registration_t
 feature registration object More...
 
typedef struct _vnet_feature_constraint_registration vnet_feature_constraint_registration_t
 constraint registration object More...
 
typedef struct vnet_feature_config_main_t_ vnet_feature_config_main_t
 
typedef void(* vnet_feature_update_cb_t) (u32 sw_if_index, u8 arc_index, u8 is_enable, void *cb)
 

Functions

void vnet_config_update_feature_count (vnet_feature_main_t *fm, u8 arc, u32 sw_if_index, int is_add)
 
u32 vnet_get_feature_index (u8 arc, const char *s)
 
u8 vnet_get_feature_arc_index (const char *s)
 
vnet_feature_registration_tvnet_get_feature_reg (const char *arc_name, const char *node_name)
 
int vnet_feature_enable_disable_with_index (u8 arc_index, u32 feature_index, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
 
int vnet_feature_enable_disable (const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
 
static_always_inline u32 vnet_get_feature_count (u8 arc, u32 sw_if_index)
 
static vnet_feature_config_main_tvnet_get_feature_arc_config_main (u8 arc_index)
 
static_always_inline vnet_feature_config_main_tvnet_feature_get_config_main (u16 arc)
 
static_always_inline int vnet_have_features (u8 arc, u32 sw_if_index)
 
static_always_inline u32 vnet_get_feature_config_index (u8 arc, u32 sw_if_index)
 
static_always_inline void * vnet_feature_arc_start_with_data (u8 arc, u32 sw_if_index, u32 *next, vlib_buffer_t *b, u32 n_data_bytes)
 
static_always_inline void vnet_feature_arc_start (u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
 
static_always_inline void * vnet_feature_next_with_data (u32 *next0, vlib_buffer_t *b0, u32 n_data_bytes)
 
static_always_inline void vnet_feature_next (u32 *next0, vlib_buffer_t *b0)
 
static_always_inline int vnet_device_input_have_features (u32 sw_if_index)
 
static_always_inline void vnet_feature_start_device_input_x1 (u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
 
static_always_inline void vnet_feature_start_device_input_x2 (u32 sw_if_index, u32 *next0, u32 *next1, vlib_buffer_t *b0, vlib_buffer_t *b1)
 
static_always_inline void vnet_feature_start_device_input_x4 (u32 sw_if_index, u32 *next0, u32 *next1, u32 *next2, u32 *next3, vlib_buffer_t *b0, vlib_buffer_t *b1, vlib_buffer_t *b2, vlib_buffer_t *b3)
 
clib_error_tvnet_feature_arc_init (vlib_main_t *vm, vnet_config_main_t *vcm, char **feature_start_nodes, int num_feature_start_nodes, char *last_in_arc, vnet_feature_registration_t *first_reg, vnet_feature_constraint_registration_t *first_const_set, char ***in_feature_nodes)
 Initialize a feature graph arc. More...
 
void vnet_interface_features_show (vlib_main_t *vm, u32 sw_if_index, int verbose)
 Display the set of driver features configured on a specific interface Called by "show interface" handler. More...
 
void vnet_feature_register (vnet_feature_update_cb_t cb, void *data)
 

Variables

vnet_feature_main_t feature_main
 

Macro Definition Documentation

◆ VNET_FEATURE_ARC_INIT

#define VNET_FEATURE_ARC_INIT (   x,
  ... 
)
Value:
__VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x;\
static void __vnet_add_feature_arc_registration_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_arc_registration_##x (void) \
{ \
vnet_feature_main_t * fm = &feature_main; \
vnet_feat_arc_##x.next = fm->next_arc; \
fm->next_arc = & vnet_feat_arc_##x; \
} \
static void __vnet_rm_feature_arc_registration_##x (void) \
__attribute__((__destructor__)) ; \
static void __vnet_rm_feature_arc_registration_##x (void) \
{ \
vnet_feature_main_t * fm = &feature_main; \
vnet_feature_arc_registration_t *r = &vnet_feat_arc_##x; \
VLIB_REMOVE_FROM_LINKED_LIST (fm->next_arc, r, next); \
} \
__VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x
#define fm
vnet_feature_main_t feature_main
Definition: feature.c:19
struct _vnet_feature_arc_registration vnet_feature_arc_registration_t
feature registration object
vnet_feature_arc_registration_t * next_arc
feature arc configuration list
Definition: feature.h:89

Definition at line 122 of file feature.h.

◆ VNET_FEATURE_ARC_ORDER

#define VNET_FEATURE_ARC_ORDER (   x,
  ... 
)
Value:
__VA_ARGS__ vnet_feature_constraint_registration_t \
vnet_feature_constraint_##x; \
static void __vnet_add_constraint_registration_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_constraint_registration_##x (void) \
{ \
vnet_feature_main_t * fm = &feature_main; \
vnet_feature_constraint_##x.next = fm->next_constraint; \
fm->next_constraint = & vnet_feature_constraint_##x; \
} \
static void __vnet_rm_constraint_registration_##x (void) \
__attribute__((__destructor__)) ; \
static void __vnet_rm_constraint_registration_##x (void) \
{ \
vnet_feature_main_t * fm = &feature_main; \
vnet_feature_constraint_registration_t *r = &vnet_feature_constraint_##x; \
VLIB_REMOVE_FROM_LINKED_LIST (fm->next_constraint, r, next); \
} \
__VA_ARGS__ vnet_feature_constraint_registration_t vnet_feature_constraint_##x
struct _vnet_feature_constraint_registration vnet_feature_constraint_registration_t
constraint registration object
#define fm
vnet_feature_constraint_registration_t * next_constraint
Definition: feature.h:95
vnet_feature_main_t feature_main
Definition: feature.c:19

Definition at line 162 of file feature.h.

◆ VNET_FEATURE_INIT

#define VNET_FEATURE_INIT (   x,
  ... 
)
Value:
__VA_ARGS__ vnet_feature_registration_t vnet_feat_##x; \
static void __vnet_add_feature_registration_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_##x (void) \
{ \
vnet_feature_main_t * fm = &feature_main; \
vnet_feat_##x.next = fm->next_feature; \
fm->next_feature = & vnet_feat_##x; \
} \
static void __vnet_rm_feature_registration_##x (void) \
__attribute__((__destructor__)) ; \
static void __vnet_rm_feature_registration_##x (void) \
{ \
vnet_feature_main_t * fm = &feature_main; \
vnet_feature_registration_t *r = &vnet_feat_##x; \
VLIB_REMOVE_FROM_LINKED_LIST (fm->next_feature, r, next); \
} \
__VA_ARGS__ vnet_feature_registration_t vnet_feat_##x
vnet_feature_registration_t * next_feature
feature path configuration lists
Definition: feature.h:93
#define fm
vnet_feature_main_t feature_main
Definition: feature.c:19
struct _vnet_feature_registration vnet_feature_registration_t
feature registration object

Definition at line 142 of file feature.h.

◆ VNET_FEATURES

#define VNET_FEATURES (   ...)    (char*[]) { __VA_ARGS__, 0}

Definition at line 442 of file feature.h.

Typedef Documentation

◆ vnet_feature_arc_registration_t

typedef struct _vnet_feature_arc_registration vnet_feature_arc_registration_t

feature registration object

◆ vnet_feature_config_main_t

◆ vnet_feature_constraint_registration_t

typedef struct _vnet_feature_constraint_registration vnet_feature_constraint_registration_t

constraint registration object

◆ vnet_feature_enable_disable_function_t

typedef clib_error_t*() vnet_feature_enable_disable_function_t(u32 sw_if_index, int enable_disable)

Definition at line 42 of file feature.h.

◆ vnet_feature_registration_t

typedef struct _vnet_feature_registration vnet_feature_registration_t

feature registration object

◆ vnet_feature_update_cb_t

typedef void(* vnet_feature_update_cb_t) (u32 sw_if_index, u8 arc_index, u8 is_enable, void *cb)

Definition at line 457 of file feature.h.

Function Documentation

◆ vnet_config_update_feature_count()

void vnet_config_update_feature_count ( vnet_feature_main_t fm,
u8  arc,
u32  sw_if_index,
int  is_add 
)

◆ vnet_device_input_have_features()

static_always_inline int vnet_device_input_have_features ( u32  sw_if_index)

Definition at line 308 of file feature.h.

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

◆ vnet_feature_arc_init()

clib_error_t* vnet_feature_arc_init ( vlib_main_t vm,
vnet_config_main_t vcm,
char **  feature_start_nodes,
int  num_feature_start_nodes,
char *  last_in_arc,
vnet_feature_registration_t first_reg,
vnet_feature_constraint_registration_t first_const_set,
char ***  in_feature_nodes 
)

Initialize a feature graph arc.

Parameters
vmvlib main structure pointer
vcmvnet config main structure pointer
feature_start_nodesnames of start-nodes which use this feature graph arc
num_feature_start_nodesnumber of start-nodes
first_regfirst element in [an attribute((constructor)) function built, or otherwise created] singly-linked list of feature registrations
first_constfirst element in [an attribute((constructor)) function built, or otherwise created] singly-linked list of bulk order constraints
[out]in_feature_nodesreturned vector of topologically-sorted feature node names, for use in show commands
Returns
0 on success, otherwise an error message. Errors are fatal since they invariably involve mistyped node-names, or genuinely missing node-names

Definition at line 121 of file registration.c.

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

◆ vnet_feature_arc_start()

static_always_inline void vnet_feature_arc_start ( u8  arc,
u32  sw_if_index,
u32 next0,
vlib_buffer_t b0 
)

Definition at line 282 of file feature.h.

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

◆ vnet_feature_arc_start_with_data()

static_always_inline void* vnet_feature_arc_start_with_data ( u8  arc,
u32  sw_if_index,
u32 next,
vlib_buffer_t b,
u32  n_data_bytes 
)

Definition at line 263 of file feature.h.

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

◆ vnet_feature_enable_disable()

int vnet_feature_enable_disable ( const char *  arc_name,
const char *  node_name,
u32  sw_if_index,
int  enable_disable,
void *  feature_config,
u32  n_feature_config_bytes 
)

Definition at line 304 of file feature.c.

+ Here is the call graph for this function:

◆ vnet_feature_enable_disable_with_index()

int vnet_feature_enable_disable_with_index ( u8  arc_index,
u32  feature_index,
u32  sw_if_index,
int  enable_disable,
void *  feature_config,
u32  n_feature_config_bytes 
)

Definition at line 252 of file feature.c.

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

◆ vnet_feature_get_config_main()

static_always_inline vnet_feature_config_main_t* vnet_feature_get_config_main ( u16  arc)

Definition at line 241 of file feature.h.

+ Here is the caller graph for this function:

◆ vnet_feature_next()

static_always_inline void vnet_feature_next ( u32 next0,
vlib_buffer_t b0 
)

Definition at line 302 of file feature.h.

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

◆ vnet_feature_next_with_data()

static_always_inline void* vnet_feature_next_with_data ( u32 next0,
vlib_buffer_t b0,
u32  n_data_bytes 
)

Definition at line 289 of file feature.h.

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

◆ vnet_feature_register()

void vnet_feature_register ( vnet_feature_update_cb_t  cb,
void *  data 
)

Definition at line 30 of file feature.c.

+ Here is the caller graph for this function:

◆ vnet_feature_start_device_input_x1()

static_always_inline void vnet_feature_start_device_input_x1 ( u32  sw_if_index,
u32 next0,
vlib_buffer_t b0 
)

Definition at line 315 of file feature.h.

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

◆ vnet_feature_start_device_input_x2()

static_always_inline void vnet_feature_start_device_input_x2 ( u32  sw_if_index,
u32 next0,
u32 next1,
vlib_buffer_t b0,
vlib_buffer_t b1 
)

Definition at line 345 of file feature.h.

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

◆ vnet_feature_start_device_input_x4()

static_always_inline void vnet_feature_start_device_input_x4 ( u32  sw_if_index,
u32 next0,
u32 next1,
u32 next2,
u32 next3,
vlib_buffer_t b0,
vlib_buffer_t b1,
vlib_buffer_t b2,
vlib_buffer_t b3 
)

Definition at line 384 of file feature.h.

+ Here is the call graph for this function:

◆ vnet_get_feature_arc_config_main()

static vnet_feature_config_main_t* vnet_get_feature_arc_config_main ( u8  arc_index)
inlinestatic

Definition at line 230 of file feature.h.

+ Here is the caller graph for this function:

◆ vnet_get_feature_arc_index()

u8 vnet_get_feature_arc_index ( const char *  s)

Definition at line 198 of file feature.c.

+ Here is the caller graph for this function:

◆ vnet_get_feature_config_index()

static_always_inline u32 vnet_get_feature_config_index ( u8  arc,
u32  sw_if_index 
)

Definition at line 255 of file feature.h.

+ Here is the caller graph for this function:

◆ vnet_get_feature_count()

static_always_inline u32 vnet_get_feature_count ( u8  arc,
u32  sw_if_index 
)

Definition at line 223 of file feature.h.

+ Here is the caller graph for this function:

◆ vnet_get_feature_index()

u32 vnet_get_feature_index ( u8  arc,
const char *  s 
)

Definition at line 234 of file feature.c.

+ Here is the caller graph for this function:

◆ vnet_get_feature_reg()

vnet_feature_registration_t* vnet_get_feature_reg ( const char *  arc_name,
const char *  node_name 
)

Definition at line 213 of file feature.c.

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

◆ vnet_have_features()

static_always_inline int vnet_have_features ( u8  arc,
u32  sw_if_index 
)

Definition at line 248 of file feature.h.

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

◆ vnet_interface_features_show()

void vnet_interface_features_show ( vlib_main_t vm,
u32  sw_if_index,
int  verbose 
)

Display the set of driver features configured on a specific interface Called by "show interface" handler.

Definition at line 409 of file feature.c.

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

Variable Documentation

◆ feature_main

vnet_feature_main_t feature_main

Definition at line 19 of file feature.c.