diff options
author | Francois Clad <fclad@cisco.com> | 2018-06-13 15:03:28 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-07-11 13:17:46 +0000 |
commit | 151b32249245880fbe4060769b7edc02026fe566 (patch) | |
tree | ed14fafea82ffd5f6bedaf5e7df2a34654854e7e /src/plugins/srv6-as/node.c | |
parent | d47da680eb8d55a6eef64becb7459030df3c7241 (diff) |
srv6-as: Adding rewrite counters
Change-Id: I57f1db6fabfdb8ddfba514ad754707b24d47c962
Signed-off-by: Francois Clad <fclad@cisco.com>
Diffstat (limited to 'src/plugins/srv6-as/node.c')
-rw-r--r-- | src/plugins/srv6-as/node.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/plugins/srv6-as/node.c b/src/plugins/srv6-as/node.c index 4685c23dae0..0e5a16e5e7b 100644 --- a/src/plugins/srv6-as/node.c +++ b/src/plugins/srv6-as/node.c @@ -163,8 +163,6 @@ srv6_as_localsid_fn (vlib_main_t * vm, n_left_from = frame->n_vectors; next_index = node->cached_next_index; - u32 thread_index = vlib_get_thread_index (); - while (n_left_from > 0) { u32 n_left_to_next; @@ -210,9 +208,10 @@ srv6_as_localsid_fn (vlib_main_t * vm, SRV6_AS_LOCALSID_NEXT_ERROR) ? &(sm->sr_ls_invalid_counters) : &(sm->sr_ls_valid_counters)), - thread_index, ls0 - sm->localsids, - 1, vlib_buffer_length_in_chain (vm, - b0)); + vm->thread_index, + ls0 - sm->localsids, 1, + vlib_buffer_length_in_chain (vm, + b0)); vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, next0); @@ -344,6 +343,15 @@ srv6_as4_rewrite_fn (vlib_main_t * vm, } } + /* Increment per-SID AS rewrite counters */ + vlib_increment_combined_counter (((next0 == + SRV6_AS_LOCALSID_NEXT_ERROR) ? + &(sm->invalid_counters) : + &(sm->valid_counters)), + vm->thread_index, ls0_mem->index, + 1, vlib_buffer_length_in_chain (vm, + b0)); + vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, next0); @@ -473,6 +481,15 @@ srv6_as6_rewrite_fn (vlib_main_t * vm, } } + /* Increment per-SID AS rewrite counters */ + vlib_increment_combined_counter (((next0 == + SRV6_AS_LOCALSID_NEXT_ERROR) ? + &(sm->invalid_counters) : + &(sm->valid_counters)), + vm->thread_index, ls0_mem->index, + 1, vlib_buffer_length_in_chain (vm, + b0)); + vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, next0); |