aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/srv6-as/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/srv6-as/node.c')
-rw-r--r--src/plugins/srv6-as/node.c27
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);