From eba31ecebed1a7d168da17194cab7a8955761f2b Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Sun, 17 Feb 2019 18:04:27 +0000 Subject: IPSEC: move SA counters into the stats segment 1) stats are accessed via the stat segment which is more condusive to monitoring 2) stats are accurate in the presence of multiple threads. There's no guarantee that an SA is access from only one worker. Change-Id: Id5e217ea253ddfc9480aaedb0d008dea031b1148 Signed-off-by: Neale Ranns --- src/vnet/ipsec/ah_encrypt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/vnet/ipsec/ah_encrypt.c') diff --git a/src/vnet/ipsec/ah_encrypt.c b/src/vnet/ipsec/ah_encrypt.c index 66286094682..5f6a0991be3 100644 --- a/src/vnet/ipsec/ah_encrypt.c +++ b/src/vnet/ipsec/ah_encrypt.c @@ -84,13 +84,14 @@ ah_encrypt_inline (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * from_frame, int is_ip6) { - u32 n_left_from, *from, *to_next = 0, next_index; + u32 n_left_from, *from, *to_next = 0, next_index, thread_index; int icv_size = 0; from = vlib_frame_vector_args (from_frame); n_left_from = from_frame->n_vectors; ipsec_main_t *im = &ipsec_main; ipsec_proto_main_t *em = &ipsec_proto_main; next_index = node->cached_next_index; + thread_index = vm->thread_index; while (n_left_from > 0) { @@ -131,9 +132,9 @@ ah_encrypt_inline (vlib_main_t * vm, AH_ENCRYPT_ERROR_SEQ_CYCLED, 1); goto trace; } - - - sa0->total_data_size += i_b0->current_length; + vlib_increment_combined_counter + (&ipsec_sa_counters, thread_index, sa_index0, + 1, i_b0->current_length); ssize_t adv; ih0 = vlib_buffer_get_current (i_b0); -- cgit 1.2.3-korg