diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2019-04-16 15:15:07 +0200 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-04-16 20:08:33 +0000 |
commit | e60dfd7acaae0e6bc8eaeb7d1cc75755d4cf01bc (patch) | |
tree | bea21e17703b3c015e715df0fe293df2074ba915 /src/plugins/gbp/gbp_policy_dpo.c | |
parent | 22bc2c46e316dd7d5ca4680f85337fe72896ca57 (diff) |
gbp: Add support for allow sclass/dclass 1
Change-Id: I51f61a399e3eace93011f9431cbd7968e9be627c
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/plugins/gbp/gbp_policy_dpo.c')
-rw-r--r-- | src/plugins/gbp/gbp_policy_dpo.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/plugins/gbp/gbp_policy_dpo.c b/src/plugins/gbp/gbp_policy_dpo.c index a6194df6836..a7077899fd8 100644 --- a/src/plugins/gbp/gbp_policy_dpo.c +++ b/src/plugins/gbp/gbp_policy_dpo.c @@ -270,12 +270,12 @@ gbp_policy_dpo_inline (vlib_main_t * vm, { gbp_main_t *gm = &gbp_main; u32 n_left_from, next_index, *from, *to_next, thread_index; - u32 n_allow_intra, n_allow_a_bit; + u32 n_allow_intra, n_allow_a_bit, n_allow_sclass_1; gbp_rule_t *gu; from = vlib_frame_vector_args (from_frame); n_left_from = from_frame->n_vectors; - n_allow_intra = n_allow_a_bit = 0; + n_allow_intra = n_allow_a_bit = n_allow_sclass_1 = 0; thread_index = vm->thread_index; next_index = node->cached_next_index; @@ -343,6 +343,16 @@ gbp_policy_dpo_inline (vlib_main_t * vm, n_allow_intra++; action0 = 0; } + else if (PREDICT_FALSE (key0.gck_src == 1 || key0.gck_dst == 1)) + { + /* + * sclass or dclass 1 allowed + */ + next0 = gpd0->gpd_dpo.dpoi_next_node; + vnet_buffer2 (b0)->gbp.flags |= VXLAN_GBP_GPFLAGS_A; + n_allow_sclass_1++; + action0 = 0; + } else { gci0 = gbp_contract_find (&key0); @@ -449,7 +459,9 @@ gbp_policy_dpo_inline (vlib_main_t * vm, vlib_node_increment_counter (vm, node->node_index, GBP_POLICY_DPO_ERROR_ALLOW_A_BIT, n_allow_a_bit); - + vlib_node_increment_counter (vm, node->node_index, + GBP_POLICY_DPO_ERROR_ALLOW_SCLASS_1, + n_allow_sclass_1); return from_frame->n_vectors; } |