FD.io VPP  v18.10-34-gcce845e
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_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_config_main_t_ vnet_feature_config_main_t
 

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 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, vnet_feature_registration_t *first_reg, char ***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...
 

Variables

vnet_feature_main_t feature_main
 

Macro Definition Documentation

#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
#define VLIB_REMOVE_FROM_LINKED_LIST(first, p, next)
Definition: init.h:82
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:72

Definition at line 103 of file feature.h.

#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:76
#define fm
#define VLIB_REMOVE_FROM_LINKED_LIST(first, p, next)
Definition: init.h:82
vnet_feature_main_t feature_main
Definition: feature.c:19
struct _vnet_feature_registration vnet_feature_registration_t
feature registration object

Definition at line 123 of file feature.h.

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

Definition at line 386 of file feature.h.

Typedef Documentation

typedef struct _vnet_feature_arc_registration vnet_feature_arc_registration_t

feature registration object

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

Definition at line 40 of file feature.h.

typedef struct _vnet_feature_registration vnet_feature_registration_t

feature registration object

Function Documentation

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

Definition at line 252 of file feature.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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,
vnet_feature_registration_t first_reg,
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
[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 118 of file registration.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 226 of file feature.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 207 of file feature.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 233 of file feature.c.

+ Here is the call graph for this function:

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 181 of file feature.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline vnet_feature_config_main_t* vnet_feature_get_config_main ( u16  arc)

Definition at line 185 of file feature.h.

+ Here is the caller graph for this function:

static_always_inline void vnet_feature_next ( u32 next0,
vlib_buffer_t b0 
)

Definition at line 246 of file feature.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 233 of file feature.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 259 of file feature.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 289 of file feature.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 328 of file feature.h.

+ Here is the call graph for this function:

static vnet_feature_config_main_t* vnet_get_feature_arc_config_main ( u8  arc_index)
inlinestatic

Definition at line 174 of file feature.h.

+ Here is the caller graph for this function:

u8 vnet_get_feature_arc_index ( const char *  s)

Definition at line 127 of file feature.c.

+ Here is the caller graph for this function:

static_always_inline u32 vnet_get_feature_config_index ( u8  arc,
u32  sw_if_index 
)

Definition at line 199 of file feature.h.

+ Here is the caller graph for this function:

u32 vnet_get_feature_index ( u8  arc,
const char *  s 
)

Definition at line 163 of file feature.c.

+ Here is the caller graph for this function:

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

Definition at line 142 of file feature.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline int vnet_have_features ( u8  arc,
u32  sw_if_index 
)

Definition at line 192 of file feature.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 338 of file feature.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

vnet_feature_main_t feature_main

Definition at line 19 of file feature.c.