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/vnet/ipsec/ipsec_format.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/vnet/ipsec/ipsec_format.c')
-rw-r--r-- | src/vnet/ipsec/ipsec_format.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/ipsec/ipsec_format.c b/src/vnet/ipsec/ipsec_format.c index 04a2a0b5be1..dc66569702e 100644 --- a/src/vnet/ipsec/ipsec_format.c +++ b/src/vnet/ipsec/ipsec_format.c @@ -238,6 +238,7 @@ format_ipsec_sa (u8 * s, va_list * args) { u32 sai = va_arg (*args, u32); ipsec_main_t *im = &ipsec_main; + vlib_counter_t counts; u32 tx_table_id; ipsec_sa_t *sa; @@ -261,6 +262,8 @@ format_ipsec_sa (u8 * s, va_list * args) s = format (s, "\n integrity alg %U%s%U", format_ipsec_integ_alg, sa->integ_alg, sa->integ_alg ? " key " : "", format_ipsec_key, &sa->integ_key); + vlib_get_combined_counter (&ipsec_sa_counters, sai, &counts); + s = format (s, "\n packets %u bytes %u", counts.packets, counts.bytes); if (sa->is_tunnel) { |