summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2018-07-16 15:17:18 +0200
committerDave Barach <openvpp@barachs.net>2018-07-31 11:38:32 +0000
commit937c089ab72fad238774cc6829d2b6d167c25683 (patch)
treeb7b2c8e53d862563d5ab6d4a777336d8452d5c15 /src
parent16be62e3846750b5b7921c0b4d6408477be434f7 (diff)
acl-plugin: move the acl epoch calculation into inline function
Change-Id: Ifc8b3d30d66c7ade1e3584844ce3f82d42d2fb94 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/acl/dataplane_node.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/plugins/acl/dataplane_node.c b/src/plugins/acl/dataplane_node.c
index 3ca1be73c15..7db0efa7be3 100644
--- a/src/plugins/acl/dataplane_node.c
+++ b/src/plugins/acl/dataplane_node.c
@@ -66,6 +66,18 @@ typedef enum
/* *INDENT-ON* */
+always_inline u16
+get_current_policy_epoch (acl_main_t * am, int is_input, u32 sw_if_index0)
+{
+ u32 **p_epoch_vec =
+ is_input ? &am->input_policy_epoch_by_sw_if_index :
+ &am->output_policy_epoch_by_sw_if_index;
+ u16 current_policy_epoch =
+ sw_if_index0 < vec_len (*p_epoch_vec) ? vec_elt (*p_epoch_vec,
+ sw_if_index0)
+ : (is_input * FA_POLICY_EPOCH_IS_INPUT);
+ return current_policy_epoch;
+}
always_inline uword
acl_fa_node_fn (vlib_main_t * vm,
@@ -124,14 +136,10 @@ acl_fa_node_fn (vlib_main_t * vm,
else
lc_index0 = am->output_lc_index_by_sw_if_index[sw_if_index0];
-
- u32 **p_epoch_vec =
- is_input ? &am->input_policy_epoch_by_sw_if_index :
- &am->output_policy_epoch_by_sw_if_index;
u16 current_policy_epoch =
- sw_if_index0 < vec_len (*p_epoch_vec) ? vec_elt (*p_epoch_vec,
- sw_if_index0)
- : (is_input * FA_POLICY_EPOCH_IS_INPUT);
+ get_current_policy_epoch (am, is_input, sw_if_index0);
+
+
/*
* Extract the L3/L4 matching info into a 5-tuple structure.
*/