diff options
author | Andrew Yourtchenko <ayourtch@gmail.com> | 2018-10-25 18:21:33 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-26 19:50:45 +0000 |
commit | 40421a17c744b504891324c41a9a78d2fb702fe5 (patch) | |
tree | 6257b24842ee31cd8d1da52a052afb0c2f3796e1 /src/plugins | |
parent | 2a1da5218a7bf4ccd970d74a6e22578513affc32 (diff) |
acl-plugin: fix the node multiarch function selection
Thanks to Damjan for rewriting my previous patch into
not-to-be-deprecated soon form!
Change-Id: I595a13c44ed07d4c6d60e2aef0f0bd807a76cbba
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/acl/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/plugins/acl/dataplane_node.c | 52 |
2 files changed, 22 insertions, 33 deletions
diff --git a/src/plugins/acl/CMakeLists.txt b/src/plugins/acl/CMakeLists.txt index 75a1221bb13..803c8f97eba 100644 --- a/src/plugins/acl/CMakeLists.txt +++ b/src/plugins/acl/CMakeLists.txt @@ -19,6 +19,9 @@ add_vpp_plugin(acl sess_mgmt_node.c dataplane_node.c + MULTIARCH_SOURCES + dataplane_node.c + API_FILES acl.api diff --git a/src/plugins/acl/dataplane_node.c b/src/plugins/acl/dataplane_node.c index 53176fdd2c5..4c8d104b919 100644 --- a/src/plugins/acl/dataplane_node.c +++ b/src/plugins/acl/dataplane_node.c @@ -165,7 +165,7 @@ is_permitted_ethertype (acl_main_t * am, int sw_if_index0, int is_output, always_inline uword nonip_in_out_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame, - int is_output, vlib_node_registration_t * fa_node) + int is_output) { acl_main_t *am = &acl_main; u32 n_left, *from; @@ -174,7 +174,7 @@ nonip_in_out_node_fn (vlib_main_t * vm, vlib_node_runtime_t *error_node; from = vlib_frame_vector_args (frame); - error_node = vlib_node_get_runtime (vm, fa_node->index); + error_node = vlib_node_get_runtime (vm, node->node_index); vlib_get_buffers (vm, from, bufs, frame->n_vectors); /* set the initial values for the current buffer the next pointers */ b = bufs; @@ -222,28 +222,23 @@ nonip_in_out_node_fn (vlib_main_t * vm, return frame->n_vectors; } -vlib_node_registration_t acl_in_nonip_node; VLIB_NODE_FN (acl_in_nonip_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return nonip_in_out_node_fn (vm, node, frame, 0, &acl_in_nonip_node); + return nonip_in_out_node_fn (vm, node, frame, 0); } -vlib_node_registration_t acl_out_nonip_node; VLIB_NODE_FN (acl_out_nonip_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return nonip_in_out_node_fn (vm, node, frame, 1, &acl_in_nonip_node); + return nonip_in_out_node_fn (vm, node, frame, 1); } /* *INDENT-OFF* */ -VLIB_NODE_FUNCTION_MULTIARCH (acl_in_nonip_node, acl_in_nonip_node_fn) -VLIB_NODE_FUNCTION_MULTIARCH (acl_out_nonip_node, acl_out_nonip_node_fn) - VLIB_REGISTER_NODE (acl_in_nonip_node) = { .name = "acl-plugin-in-nonip-l2", @@ -308,8 +303,7 @@ get_current_policy_epoch (acl_main_t * am, int is_input, u32 sw_if_index0) always_inline uword acl_fa_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame, int is_ip6, - int is_input, int is_l2_path, - vlib_node_registration_t * acl_fa_node) + int is_input, int is_l2_path) { u32 n_left, *from; u32 pkts_acl_checked = 0; @@ -330,7 +324,7 @@ acl_fa_node_fn (vlib_main_t * vm, from = vlib_frame_vector_args (frame); - error_node = vlib_node_get_runtime (vm, acl_fa_node->index); + error_node = vlib_node_get_runtime (vm, node->node_index); vlib_get_buffers (vm, from, bufs, frame->n_vectors); /* set the initial values for the current buffer the next pointers */ @@ -544,86 +538,78 @@ acl_fa_node_fn (vlib_main_t * vm, vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors); - vlib_node_increment_counter (vm, acl_fa_node->index, + vlib_node_increment_counter (vm, node->node_index, ACL_FA_ERROR_ACL_CHECK, pkts_acl_checked); - vlib_node_increment_counter (vm, acl_fa_node->index, + vlib_node_increment_counter (vm, node->node_index, ACL_FA_ERROR_ACL_PERMIT, pkts_acl_permit); - vlib_node_increment_counter (vm, acl_fa_node->index, + vlib_node_increment_counter (vm, node->node_index, ACL_FA_ERROR_ACL_NEW_SESSION, pkts_new_session); - vlib_node_increment_counter (vm, acl_fa_node->index, + vlib_node_increment_counter (vm, node->node_index, ACL_FA_ERROR_ACL_EXIST_SESSION, pkts_exist_session); - vlib_node_increment_counter (vm, acl_fa_node->index, + vlib_node_increment_counter (vm, node->node_index, ACL_FA_ERROR_ACL_RESTART_SESSION_TIMER, pkts_restart_session_timer); return frame->n_vectors; } -vlib_node_registration_t acl_in_l2_ip6_node; VLIB_NODE_FN (acl_in_l2_ip6_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return acl_fa_node_fn (vm, node, frame, 1, 1, 1, &acl_in_l2_ip6_node); + return acl_fa_node_fn (vm, node, frame, 1, 1, 1); } -vlib_node_registration_t acl_in_l2_ip4_node; VLIB_NODE_FN (acl_in_l2_ip4_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return acl_fa_node_fn (vm, node, frame, 0, 1, 1, &acl_in_l2_ip4_node); + return acl_fa_node_fn (vm, node, frame, 0, 1, 1); } -vlib_node_registration_t acl_out_l2_ip6_node; VLIB_NODE_FN (acl_out_l2_ip6_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return acl_fa_node_fn (vm, node, frame, 1, 0, 1, &acl_out_l2_ip6_node); + return acl_fa_node_fn (vm, node, frame, 1, 0, 1); } -vlib_node_registration_t acl_out_l2_ip4_node; VLIB_NODE_FN (acl_out_l2_ip4_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return acl_fa_node_fn (vm, node, frame, 0, 0, 1, &acl_out_l2_ip4_node); + return acl_fa_node_fn (vm, node, frame, 0, 0, 1); } /**** L3 processing path nodes ****/ -vlib_node_registration_t acl_in_fa_ip6_node; VLIB_NODE_FN (acl_in_fa_ip6_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return acl_fa_node_fn (vm, node, frame, 1, 1, 0, &acl_in_fa_ip6_node); + return acl_fa_node_fn (vm, node, frame, 1, 1, 0); } -vlib_node_registration_t acl_in_fa_ip4_node; VLIB_NODE_FN (acl_in_fa_ip4_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return acl_fa_node_fn (vm, node, frame, 0, 1, 0, &acl_in_fa_ip4_node); + return acl_fa_node_fn (vm, node, frame, 0, 1, 0); } -vlib_node_registration_t acl_out_fa_ip6_node; VLIB_NODE_FN (acl_out_fa_ip6_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return acl_fa_node_fn (vm, node, frame, 1, 0, 0, &acl_out_fa_ip6_node); + return acl_fa_node_fn (vm, node, frame, 1, 0, 0); } -vlib_node_registration_t acl_out_fa_ip4_node; VLIB_NODE_FN (acl_out_fa_ip4_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { - return acl_fa_node_fn (vm, node, frame, 0, 0, 0, &acl_out_fa_ip4_node); + return acl_fa_node_fn (vm, node, frame, 0, 0, 0); } static u8 * |