X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fl2%2Fl2_output.h;h=74d2829839f6aed85815d58ce77807d115977995;hb=4ba67723d;hp=9597205caed524916b3ab996e788ff0cdd323bec;hpb=cc40565b6eb3136d42fd67b57e4f0e01a5970a72;p=vpp.git diff --git a/src/vnet/l2/l2_output.h b/src/vnet/l2/l2_output.h index 9597205caed..74d2829839f 100644 --- a/src/vnet/l2/l2_output.h +++ b/src/vnet/l2/l2_output.h @@ -28,8 +28,6 @@ typedef struct { - u32 feature_bitmap; - /* * vlan tag rewrite for ingress and egress * ingress vtr is located here because the same config data is used for @@ -40,9 +38,7 @@ typedef struct ptr_config_t input_pbb_vtr; ptr_config_t output_pbb_vtr; - /* some of these flags may get integrated into the feature bitmap */ - u8 fwd_enable; - u8 flood_enable; + u32 feature_bitmap; /* split horizon group */ u8 shg; @@ -52,11 +48,6 @@ typedef struct } l2_output_config_t; - -/* - * The set of next nodes for features and interface output. - * Each output feature node should include this. - */ typedef struct { /* @@ -70,15 +61,7 @@ typedef struct * array of next node index for each output feature, indexed * by l2output_feat_t. Used to determine next feature node. */ - u32 feat_next_node_index[32]; - -} l2_output_next_nodes_st; - - -typedef struct -{ - /* Next nodes for features and output interfaces */ - l2_output_next_nodes_st next_nodes; + u32 l2_out_feat_next[32]; /* config vector indexed by sw_if_index */ l2_output_config_t *configs; @@ -88,14 +71,18 @@ typedef struct vnet_main_t *vnet_main; } l2output_main_t; -l2output_main_t l2output_main; +extern l2output_main_t l2output_main; + +extern vlib_node_registration_t l2output_node; /* L2 output features */ -/* Mappings from feature ID to graph node name */ +/* Mappings from feature ID to graph node name in reverse order */ #define foreach_l2output_feat \ _(OUTPUT, "interface-output") \ - _(SPAN, "feature-bitmap-drop") \ + _(SPAN, "span-l2-output") \ + _(GBP_POLICY_PORT, "gbp-policy-port") \ + _(GBP_POLICY_MAC, "gbp-policy-mac") \ _(CFM, "feature-bitmap-drop") \ _(QOS, "feature-bitmap-drop") \ _(ACL, "l2-output-acl") \ @@ -105,6 +92,7 @@ l2output_main_t l2output_main; _(STP_BLOCKED, "feature-bitmap-drop") \ _(LINESTATUS_DOWN, "feature-bitmap-drop") \ _(OUTPUT_CLASSIFY, "l2-output-classify") \ + _(OUTPUT_FEAT_ARC, "l2-output-feat-arc") \ _(XCRW, "l2-xcrw") /* Feature bitmap positions */ @@ -116,9 +104,12 @@ typedef enum L2OUTPUT_N_FEAT, } l2output_feat_t; +STATIC_ASSERT (L2OUTPUT_N_FEAT <= 32, "too many l2 output features"); + /* Feature bit masks */ typedef enum { + L2OUTPUT_FEAT_NONE = 0, #define _(sym,str) L2OUTPUT_FEAT_##sym = (1<l2.feature_bitmap = feature_bitmap; - - /* Determine the next node */ - *next0 = - feat_bitmap_get_next_node_index (next_nodes->feat_next_node_index, - feature_bitmap); - } - else - { - /* - * There are no features. Send packet to TX node for sw_if_index0 - * This is a little tricky in that the output interface next node indexes - * are not precomputed at init time. - */ - - if (sw_if_index == *cached_sw_if_index) - { - /* We hit in the one-entry cache. Use it. */ - *next0 = *cached_next_index; - } - else - { - /* Look up the output TX node */ - *next0 = l2output_get_output_node (vlib_main, - vnet_main, - node_index, - sw_if_index, - &next_nodes->output_node_index_vec); - - if (*next0 == L2OUTPUT_NEXT_DROP) - { - vnet_hw_interface_t *hw0; - hw0 = vnet_get_sup_hw_interface (vnet_main, sw_if_index); - - if (hw0->flags & VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED) - b0->error = node->errors[L2OUTPUT_ERROR_MAPPING_DROP]; - } - - /* Update the one-entry cache */ - *cached_sw_if_index = sw_if_index; - *cached_next_index = *next0; - } - } -} +void l2output_create_output_node_mapping (vlib_main_t * vlib_main, + vnet_main_t * vnet_main, + u32 sw_if_index); /** Get a pointer to the config for the given interface */ l2_output_config_t *l2output_intf_config (u32 sw_if_index); /** Enable (or disable) the feature in the bitmap for the given interface */ void l2output_intf_bitmap_enable (u32 sw_if_index, - u32 feature_bitmap, u32 enable); + l2output_feat_masks_t feature_bitmap, + u32 enable); #endif