summaryrefslogtreecommitdiffstats
path: root/src/plugins/srv6-ad/node.c
diff options
context:
space:
mode:
authorFrancois Clad <fclad@cisco.com>2018-07-04 13:46:46 +0200
committerDamjan Marion <dmarion@me.com>2018-08-22 10:41:18 +0000
commita7e6cd90b8db92c5eebc103f0994bfe612eccc21 (patch)
treee5f859908c86706fb21855882a9e9acafc42afa1 /src/plugins/srv6-ad/node.c
parent0ad70113844e1700c58131ca80da31141096acae (diff)
srv6-ad: Adding rewrite counters
Change-Id: I0af61b27f3336861af2ad5e5b1053c61607b970c Signed-off-by: Francois Clad <fclad@cisco.com>
Diffstat (limited to 'src/plugins/srv6-ad/node.c')
-rw-r--r--src/plugins/srv6-ad/node.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/plugins/srv6-ad/node.c b/src/plugins/srv6-ad/node.c
index 29851968108..e6afe42650a 100644
--- a/src/plugins/srv6-ad/node.c
+++ b/src/plugins/srv6-ad/node.c
@@ -194,8 +194,6 @@ srv6_ad_localsid_fn (vlib_main_t * vm,
n_left_from = frame->n_vectors;
next_index = node->cached_next_index;
- u32 thread_index = vm->thread_index;
-
while (n_left_from > 0)
{
u32 n_left_to_next;
@@ -243,9 +241,10 @@ srv6_ad_localsid_fn (vlib_main_t * vm,
SRV6_AD_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);
@@ -377,6 +376,15 @@ srv6_ad4_rewrite_fn (vlib_main_t * vm,
}
}
+ /* Increment per-SID AD rewrite counters */
+ vlib_increment_combined_counter (((next0 ==
+ SRV6_AD_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);
@@ -506,6 +514,15 @@ srv6_ad6_rewrite_fn (vlib_main_t * vm,
}
}
+ /* Increment per-SID AD rewrite counters */
+ vlib_increment_combined_counter (((next0 ==
+ SRV6_AD_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);