diff options
author | Neale Ranns <nranns@cisco.com> | 2019-02-17 18:04:27 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-02-18 13:05:17 +0000 |
commit | eba31ecebed1a7d168da17194cab7a8955761f2b (patch) | |
tree | fe640b26f9dc98d7aaf5ff0ade2d643a1b86cbbe /src/plugins/dpdk/ipsec/esp_encrypt.c | |
parent | 684586786e98bc779e269c0d879a2a4d3f1f4bce (diff) |
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 <nranns@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/ipsec/esp_encrypt.c')
-rw-r--r-- | src/plugins/dpdk/ipsec/esp_encrypt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/dpdk/ipsec/esp_encrypt.c b/src/plugins/dpdk/ipsec/esp_encrypt.c index eea99eb8694..d29ca55ea2e 100644 --- a/src/plugins/dpdk/ipsec/esp_encrypt.c +++ b/src/plugins/dpdk/ipsec/esp_encrypt.c @@ -112,7 +112,7 @@ dpdk_esp_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, next_index; + u32 n_left_from, *from, *to_next, next_index, thread_index; ipsec_main_t *im = &ipsec_main; u32 thread_idx = vlib_get_thread_index (); dpdk_crypto_main_t *dcm = &dpdk_crypto_main; @@ -129,6 +129,7 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm, from = vlib_frame_vector_args (from_frame); n_left_from = from_frame->n_vectors; + thread_index = vm->thread_index; ret = crypto_alloc_ops (numa, ops, n_left_from); if (ret) @@ -280,7 +281,9 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm, orig_sz = b0->current_length; /* TODO multi-seg support - total_length_not_including_first_buffer */ - sa0->total_data_size += b0->current_length; + vlib_increment_combined_counter + (&ipsec_sa_counters, thread_index, sa_index0, + 1, b0->current_length); res->ops[res->n_ops] = op; res->bi[res->n_ops] = bi0; |