18 #ifndef included_vnet_l2_output_h 19 #define included_vnet_l2_output_h 73 u32 feat_next_node_index[32];
96 #define foreach_l2output_feat \ 97 _(SPAN, "feature-bitmap-drop") \ 98 _(CFM, "feature-bitmap-drop") \ 99 _(QOS, "feature-bitmap-drop") \ 100 _(ACL, "l2-output-acl") \ 101 _(L2PT, "feature-bitmap-drop") \ 102 _(EFP_FILTER, "l2-efp-filter") \ 103 _(IPIW, "feature-bitmap-drop") \ 104 _(STP_BLOCKED, "feature-bitmap-drop") \ 105 _(LINESTATUS_DOWN, "feature-bitmap-drop") \ 106 _(OUTPUT_CLASSIFY, "l2-output-classify") \ 112 #define _(sym,str) L2OUTPUT_FEAT_##sym##_BIT, 121 #define _(sym,str) L2OUTPUT_FEAT_##sym = (1<<L2OUTPUT_FEAT_##sym##_BIT), 126 #define foreach_l2output_error \ 127 _(L2OUTPUT, "L2 output packets") \ 128 _(EFP_DROP, "L2 EFP filter pre-rewrite drops") \ 129 _(VTR_DROP, "L2 output tag rewrite drops") \ 130 _(SHG_DROP, "L2 split horizon drops") \ 131 _(DROP, "L2 output drops") \ 132 _(MAPPING_DROP, "L2 Output interface mapping in progress") 143 #define _(sym,str) L2OUTPUT_ERROR_##sym, 162 u32 * output_node_index_vec,
184 u32 sw_if_index,
u32 ** output_node_index_vec)
192 next =
vec_elt (*output_node_index_vec, sw_if_index);
200 *output_node_index_vec,
214 u32 * cached_sw_if_index,
215 u32 * cached_next_index,
218 u32 sw_if_index,
u32 feature_bitmap,
u32 * next0)
225 vnet_buffer (b0)->l2.feature_bitmap = feature_bitmap;
240 if (sw_if_index == *cached_sw_if_index)
243 *next0 = *cached_next_index;
260 b0->
error = node->
errors[L2OUTPUT_ERROR_MAPPING_DROP];
264 *cached_sw_if_index = sw_if_index;
265 *cached_next_index = *next0;
275 u32 feature_bitmap,
u32 enable);
#define foreach_l2output_error
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
char ** l2output_get_feat_names(void)
void l2output_intf_bitmap_enable(u32 sw_if_index, u32 feature_bitmap, u32 enable)
Enable (or disable) the feature in the bitmap for the given interface.
l2_output_next_nodes_st next_nodes
Per-interface vlan tag rewrite configuration There will be one instance of this struct for each sw_if...
static u32 l2output_get_output_node(vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 node_index, u32 sw_if_index, u32 **output_node_index_vec)
Get a mapping from the output node mapping table, creating the entry if necessary.
ptr_config_t output_pbb_vtr
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
u32 feat_next_node_index[32]
#define VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED
l2output_main_t l2output_main
static u32 feat_bitmap_get_next_node_index(u32 *next_nodes, u32 bitmap)
Return the graph node index for the feature corresponding to the first set bit in the bitmap...
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define foreach_l2output_feat
#define vec_elt(v, i)
Get vector value at index i.
u32 * output_node_index_vec
ptr_config_t input_pbb_vtr
l2_output_config_t * l2output_intf_config(u32 sw_if_index)
Get a pointer to the config for the given interface.
u32 l2output_create_output_node_mapping(vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 node_index, u32 *output_node_index_vec, u32 sw_if_index)
The next set of functions is for use by output feature graph nodes.
l2_output_config_t * configs
static void l2_output_dispatch(vlib_main_t *vlib_main, vnet_main_t *vnet_main, vlib_node_runtime_t *node, u32 node_index, u32 *cached_sw_if_index, u32 *cached_next_index, l2_output_next_nodes_st *next_nodes, vlib_buffer_t *b0, u32 sw_if_index, u32 feature_bitmap, u32 *next0)
Determine the next L2 node based on the output feature bitmap.
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
static void l2output_init_output_node_vec(u32 **output_node_index_vec)