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 _(OUTPUT, "interface-output") \ 98 _(SPAN, "feature-bitmap-drop") \ 99 _(CFM, "feature-bitmap-drop") \ 100 _(QOS, "feature-bitmap-drop") \ 101 _(ACL, "l2-output-acl") \ 102 _(L2PT, "feature-bitmap-drop") \ 103 _(EFP_FILTER, "l2-efp-filter") \ 104 _(IPIW, "feature-bitmap-drop") \ 105 _(STP_BLOCKED, "feature-bitmap-drop") \ 106 _(LINESTATUS_DOWN, "feature-bitmap-drop") \ 107 _(OUTPUT_CLASSIFY, "l2-output-classify") \ 113 #define _(sym,str) L2OUTPUT_FEAT_##sym##_BIT, 122 #define _(sym,str) L2OUTPUT_FEAT_##sym = (1<<L2OUTPUT_FEAT_##sym##_BIT), 127 #define foreach_l2output_error \ 128 _(L2OUTPUT, "L2 output packets") \ 129 _(EFP_DROP, "L2 EFP filter pre-rewrite drops") \ 130 _(VTR_DROP, "L2 output tag rewrite drops") \ 131 _(SHG_DROP, "L2 split horizon drops") \ 132 _(DROP, "L2 output drops") \ 133 _(MAPPING_DROP, "L2 Output interface mapping in progress") 144 #define _(sym,str) L2OUTPUT_ERROR_##sym, 163 u32 * output_node_index_vec,
185 u32 sw_if_index,
u32 ** output_node_index_vec)
193 next =
vec_elt (*output_node_index_vec, sw_if_index);
201 *output_node_index_vec,
215 u32 * cached_sw_if_index,
216 u32 * cached_next_index,
219 u32 sw_if_index,
u32 feature_bitmap,
u32 * next0)
232 || ((feature_bitmap & ~L2OUTPUT_FEAT_OUTPUT) != 0))
235 ASSERT (feature_bitmap != 0);
238 vnet_buffer (b0)->l2.feature_bitmap = feature_bitmap;
253 if (sw_if_index == *cached_sw_if_index)
256 *next0 = *cached_next_index;
273 b0->
error = node->
errors[L2OUTPUT_ERROR_MAPPING_DROP];
277 *cached_sw_if_index = sw_if_index;
278 *cached_next_index = *next0;
288 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.
vlib_error_t * errors
Vector of errors for this node.
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
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
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
#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)