X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fl2%2Fl2_input.h;h=4d6f1a321772978ab7147db08178c2be196d4567;hb=b474380f;hp=f3fada6a7d35f84e5e087ec3afb4925863e04ff2;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vnet/l2/l2_input.h b/src/vnet/l2/l2_input.h index f3fada6a7d3..4d6f1a32177 100644 --- a/src/vnet/l2/l2_input.h +++ b/src/vnet/l2/l2_input.h @@ -35,6 +35,12 @@ typedef struct u32 output_sw_if_index; /* for xconnect */ }; + /* config for which input features are configured on this interface */ + u32 feature_bitmap; + + /* split horizon group */ + u8 shg; + /* Interface mode. If both are 0, this interface is in L3 mode */ u8 xconnect; u8 bridge; @@ -42,17 +48,6 @@ typedef struct /* this is the bvi interface for the bridge-domain */ u8 bvi; - /* config for which input features are configured on this interface */ - u32 feature_bitmap; - - /* some of these flags are also in the feature bitmap */ - u8 learn_enable; - u8 fwd_enable; - u8 flood_enable; - - /* split horizon group */ - u8 shg; - } l2_input_config_t; @@ -86,26 +81,44 @@ l2input_bd_config_from_index (l2input_main_t * l2im, u32 bd_index) return bd_is_valid (bd_config) ? bd_config : NULL; } +static_always_inline l2_bridge_domain_t * +l2input_bd_config (u32 bd_index) +{ + l2input_main_t *mp = &l2input_main; + l2_bridge_domain_t *bd_config; + + vec_validate (mp->bd_configs, bd_index); + bd_config = vec_elt_at_index (mp->bd_configs, bd_index); + return bd_config; +} + /* L2 input indication packet is from BVI, using -2 */ #define L2INPUT_BVI ((u32) (~0-1)) /* L2 input features */ -/* Mappings from feature ID to graph node name */ +/* Mappings from feature ID to graph node name in reverse order */ #define foreach_l2input_feat \ _(DROP, "feature-bitmap-drop") \ _(XCONNECT, "l2-output") \ _(FLOOD, "l2-flood") \ _(ARP_TERM, "arp-term-l2bd") \ _(UU_FLOOD, "l2-flood") \ + _(UU_FWD, "l2-uu-fwd") \ + _(GBP_FWD, "gbp-fwd") \ _(FWD, "l2-fwd") \ _(RW, "l2-rw") \ _(LEARN, "l2-learn") \ + _(L2_EMULATION, "l2-emulation") \ + _(GBP_NULL_CLASSIFY, "gbp-null-classify") \ + _(GBP_SRC_CLASSIFY, "gbp-src-classify") \ _(VTR, "l2-input-vtr") \ + _(L2_IP_QOS_RECORD, "l2-ip-qos-record") \ _(VPATH, "vpath-input-l2") \ _(ACL, "l2-input-acl") \ _(POLICER_CLAS, "l2-policer-classify") \ - _(INPUT_CLASSIFY, "l2-input-classify") + _(INPUT_CLASSIFY, "l2-input-classify") \ + _(SPAN, "span-l2-input") /* Feature bitmap positions */ typedef enum @@ -113,20 +126,31 @@ typedef enum #define _(sym,str) L2INPUT_FEAT_##sym##_BIT, foreach_l2input_feat #undef _ - L2INPUT_N_FEAT, + L2INPUT_N_FEAT } l2input_feat_t; +STATIC_ASSERT (L2INPUT_N_FEAT <= 32, "too many l2 input features"); + /* Feature bit masks */ typedef enum { #define _(sym,str) L2INPUT_FEAT_##sym = (1<